clean up statvfs
This commit is contained in:
parent
82e7eb2e32
commit
2e461091dd
|
@ -54,8 +54,6 @@ import re
|
||||||
import shutil
|
import shutil
|
||||||
import platform
|
import platform
|
||||||
import common
|
import common
|
||||||
if not common.windows_check():
|
|
||||||
import statvfs
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import deluge_core
|
import deluge_core
|
||||||
|
@ -798,6 +796,7 @@ class Manager:
|
||||||
|
|
||||||
def calc_free_space(self, directory):
|
def calc_free_space(self, directory):
|
||||||
if not common.windows_check():
|
if not common.windows_check():
|
||||||
|
import statvfs
|
||||||
dir_stats = os.statvfs(directory)
|
dir_stats = os.statvfs(directory)
|
||||||
block_size = dir_stats[statvfs.F_BSIZE]
|
block_size = dir_stats[statvfs.F_BSIZE]
|
||||||
avail_blocks = dir_stats[statvfs.F_BAVAIL]
|
avail_blocks = dir_stats[statvfs.F_BAVAIL]
|
||||||
|
|
Loading…
Reference in New Issue