summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-04-29 21:40:53 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-04-29 21:40:53 +0200
commit98036ee337229602550e729a2ee79cb08caa53ff (patch)
treef36e14edd816ec2f548c203261a371168e663009
parentstatvfs fix (diff)
downloadpyload-98036ee337229602550e729a2ee79cb08caa53ff.tar.xz
import fix
-rwxr-xr-xpyLoadCore.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pyLoadCore.py b/pyLoadCore.py
index 05cfc1bfa..e59f8db10 100755
--- a/pyLoadCore.py
+++ b/pyLoadCore.py
@@ -275,7 +275,7 @@ class Core(object):
if freeSpace > 5 * 1024:
self.logger.info(_("Free space: %sGB") % (freeSpace / 1024))
else:
- self.logger.info(_("Free space: %sMB") % self.freeSpace())
+ self.logger.info(_("Free space: %sMB") % freeSpace)
self.thread_list.pause = False
@@ -495,8 +495,9 @@ class Core(object):
def freeSpace(self):
folder = self.make_path(self.config['general']['download_folder'])
if platform == 'nt':
+ import ctypes
free_bytes = ctypes.c_ulonglong(0)
- __import__("ctypes").windll.kernel32.GetDiskFreeSpaceExW(ctypes.c_wchar_p(folder), None, None, ctypes.pointer(free_bytes))
+ ctypes.windll.kernel32.GetDiskFreeSpaceExW(ctypes.c_wchar_p(folder), None, None, ctypes.pointer(free_bytes))
return free_bytes.value / 1024 / 1024 #megabyte
else:
from os import statvfs