Clean Config Tree Node children list by type after removing one child
authorLaurent Bessard
Mon, 15 Apr 2013 00:35:04 +0200
changeset 1033 1eec9b855e47
parent 1032 c4989e53f9c3
child 1034 078bf153fb8c
Clean Config Tree Node children list by type after removing one child
ConfigTreeNode.py
--- a/ConfigTreeNode.py	Mon Apr 15 00:32:16 2013 +0200
+++ b/ConfigTreeNode.py	Mon Apr 15 00:35:04 2013 +0200
@@ -465,6 +465,8 @@
         shutil.rmtree(CTNInstance.CTNPath())
         # Remove child of Children
         self.Children[CTNInstance.CTNType].remove(CTNInstance)
+        if len(self.Children[CTNInstance.CTNType]) == 0:
+            self.Children.pop(CTNInstance.CTNType)
         # Forget it... (View have to refresh)
 
     def CTNRemove(self):