diff options
Diffstat (limited to 'module/PyPackage.py')
-rw-r--r-- | module/PyPackage.py | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/module/PyPackage.py b/module/PyPackage.py index f3be6c886..970982e68 100644 --- a/module/PyPackage.py +++ b/module/PyPackage.py @@ -17,9 +17,6 @@ @author: mkaay """ -from module.PullEvents import UpdateEvent -from module.utils import save_path - class PyPackage(): """ Represents a package object at runtime @@ -30,17 +27,13 @@ class PyPackage(): self.id = int(id) self.name = name - self._folder = folder + self.folder = folder self.site = site self.password = password self.queue = queue self.order = order self.setFinished = False - @property - def folder(self): - return save_path(self._folder) - def toDict(self): """ Returns a dictionary representation of the data. @@ -74,7 +67,13 @@ class PyPackage(): def delete(self): self.m.deletePackage(self.id) - + + def deleteIfEmpty(self): + """ True if deleted """ + if not len(self.getChildren()): + self.delete() + return True + return False + def notifyChange(self): - e = UpdateEvent("pack", self.id, "collector" if not self.queue else "queue") - self.m.core.pullManager.addEvent(e) + self.m.core.eventManager.dispatchEvent("packageUpdated", self.id) |