aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ventoo/AugEditTree.py3
-rw-r--r--src/ventoo/main.py9
2 files changed, 10 insertions, 2 deletions
diff --git a/src/ventoo/AugEditTree.py b/src/ventoo/AugEditTree.py
index 52bf9ac..11695ba 100644
--- a/src/ventoo/AugEditTree.py
+++ b/src/ventoo/AugEditTree.py
@@ -78,6 +78,9 @@ class AugEditTree(gtk.TreeView):
(gobject.TYPE_STRING,))
+ def clear(self):
+ self.tv_store.clear()
+
def entry_edited(self, cell, path, text):
#column = int(path)
self.tv_store[path][2] = text
diff --git a/src/ventoo/main.py b/src/ventoo/main.py
index 2900c9b..c4ee4d5 100644
--- a/src/ventoo/main.py
+++ b/src/ventoo/main.py
@@ -415,8 +415,13 @@ class MainWindow(gtk.Window):
#update the display...and get new module info.
#thse path manipulations are sketchy, should make this code clearer.
tmp = self.currentConfigFilePath
- self.currentModule = VentooModule.VentooModule(augeas_utils.getVentooModuleNameFromSysPath(self.a, osp.join('/', tmp)))
- self.refreshAugeasEditTree()
+ try:
+ self.currentModule = VentooModule.VentooModule(augeas_utils.getVentooModuleNameFromSysPath(self.a, osp.join('/', tmp)))
+ self.refreshAugeasEditTree()
+ except RuntimeError:
+ #module doesn't exist. ignore request.
+ self.edit_tv.clear()
+
def hideApplyDiffButton(self):
self.applyDiffButton.hide()