summaryrefslogtreecommitdiffstats
path: root/pyLoadCore.py
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2010-03-30 15:49:01 +0200
committerGravatar mkaay <mkaay@mkaay.de> 2010-03-30 15:49:01 +0200
commitd56fd050ced8c31eabae7a1ceabe8adaeec6b3bd (patch)
tree8d6329b93957ca5848f01f76c69d107268f7ad18 /pyLoadCore.py
parentnew server method (get_config) (diff)
downloadpyload-d56fd050ced8c31eabae7a1ceabe8adaeec6b3bd.tar.xz
fixes #64
Diffstat (limited to 'pyLoadCore.py')
-rwxr-xr-xpyLoadCore.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/pyLoadCore.py b/pyLoadCore.py
index 5c659e538..5264ef1e1 100755
--- a/pyLoadCore.py
+++ b/pyLoadCore.py
@@ -38,6 +38,7 @@ from os import makedirs
from os import remove
from os import sep
from os import _exit
+from os import statvfs
from os.path import abspath
from os.path import basename
from os.path import dirname
@@ -221,6 +222,9 @@ class Core(object):
self.file_list.continueAborted()
except:
pass
+
+ self.logger.info(_("Free space: %sMB") % self.freeSpace())
+ self.thread_list.pause = False
while True:
sleep(2)
@@ -432,6 +436,10 @@ class Core(object):
return args[0]
else:
return join(self.path, * args)
+
+ def freeSpace(self):
+ s = statvfs(self.make_path(self.config['general']['download_folder']))
+ return s.f_bsize * s.f_bavail / 1024 / 1024 #megabyte
####################################
########## XMLRPC Methods ##########