summaryrefslogtreecommitdiffstats
path: root/module/PyPackage.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/PyPackage.py')
-rw-r--r--module/PyPackage.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/module/PyPackage.py b/module/PyPackage.py
index dce501d93..d4b468f9c 100644
--- a/module/PyPackage.py
+++ b/module/PyPackage.py
@@ -69,6 +69,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):
self.m.core.eventManager.dispatchEvent("packageUpdated", self.id)