From ceb59ee0739546368135b0d86a69b17c92bfbccf Mon Sep 17 00:00:00 2001 From: RaNaN Date: Thu, 20 Dec 2012 15:33:01 +0100 Subject: added models and collections for progress --- module/FileManager.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'module/FileManager.py') diff --git a/module/FileManager.py b/module/FileManager.py index cf4989f99..1d8cdf328 100644 --- a/module/FileManager.py +++ b/module/FileManager.py @@ -29,6 +29,7 @@ from datatypes.PyPackage import PyPackage, RootPackage def invalidate(func): def new(*args): args[0].filecount = -1 + args[0].downloadcount = -1 args[0].queuecount = -1 args[0].jobCache = {} return func(*args) @@ -65,6 +66,7 @@ class FileManager: #self.lock._Verbose__verbose = True self.filecount = -1 # if an invalid value is set get current value from db + self.downloadcount = -1 # number of downloads self.queuecount = -1 # number of package to be loaded self.db = self.core.db @@ -301,6 +303,13 @@ class FileManager: return self.filecount + def getDownloadCount(self): + """ return number of downloads """ + if self.downloadcount == -1: + self.downloadcount = self.db.downloadcount() + + return self.downloadcount + def getQueueCount(self, force=False): """number of files that have to be processed""" if self.queuecount == -1 or force: -- cgit v1.2.3