[GRASS-SVN] r41629 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Mar 30 12:02:15 EDT 2010


Author: martinl
Date: 2010-03-30 12:02:14 -0400 (Tue, 30 Mar 2010)
New Revision: 41629

Modified:
   grass/trunk/gui/wxpython/gui_modules/gmodeler.py
Log:
wxGUI/modeler: remove debug code


Modified: grass/trunk/gui/wxpython/gui_modules/gmodeler.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gmodeler.py	2010-03-30 15:59:09 UTC (rev 41628)
+++ grass/trunk/gui/wxpython/gui_modules/gmodeler.py	2010-03-30 16:02:14 UTC (rev 41629)
@@ -46,8 +46,6 @@
 
 from grass.script import core as grass
 
-debug = True
-
 class ModelFrame(wx.Frame):
     def __init__(self, parent, id = wx.ID_ANY, title = _("Graphical modeler (under development)"), **kwargs):
         """!Graphical modeler main window
@@ -118,17 +116,12 @@
     def OnModelOpen(self, event):
         """!Load model from file"""
         filename = ''
-        global debug
-        if debug is False:
-            dlg = wx.FileDialog(parent = self, message=_("Choose model file"),
-                                defaultDir = os.getcwd(),
-                                wildcard=_("GRASS Model File (*.gxm)|*.gxm"))
-            if dlg.ShowModal() == wx.ID_OK:
-                filename = dlg.GetPath()
-        
-        else:
-            filename = '/home/martin/model1.gxm'
-            
+        dlg = wx.FileDialog(parent = self, message=_("Choose model file"),
+                            defaultDir = os.getcwd(),
+                            wildcard=_("GRASS Model File (*.gxm)|*.gxm"))
+        if dlg.ShowModal() == wx.ID_OK:
+            filename = dlg.GetPath()
+                    
         if not filename:
             return
         
@@ -162,20 +155,17 @@
         
     def OnModelSaveAs(self, event):
         """!Create model to file as"""
-        global debug
-        if debug is False:
-            dlg = wx.FileDialog(parent = self,
-                                message = _("Choose file to save current model"),
-                                defaultDir = os.getcwd(),
-                                wildcard=_("GRASS Model File (*.gxm)|*.gxm"),
-                                style=wx.FD_SAVE)
-            
-            filename = ''
-            if dlg.ShowModal() == wx.ID_OK:
-                filename = dlg.GetPath()
-        else:
-            filename = '/home/martin/model1.gxm'
+        filename = ''
+        dlg = wx.FileDialog(parent = self,
+                            message = _("Choose file to save current model"),
+                            defaultDir = os.getcwd(),
+                            wildcard=_("GRASS Model File (*.gxm)|*.gxm"),
+                            style=wx.FD_SAVE)
         
+        
+        if dlg.ShowModal() == wx.ID_OK:
+            filename = dlg.GetPath()
+        
         if not filename:
             return
         
@@ -215,22 +205,18 @@
 
     def OnAddAction(self, event):
         """!Add action to model"""
-        global debug
-        if debug == False:
-            if self.searchDialog is None:
-                self.searchDialog = ModelSearchDialog(self)
-                self.searchDialog.CentreOnParent()
-            else:
-                self.searchDialog.Reset()
+        if self.searchDialog is None:
+            self.searchDialog = ModelSearchDialog(self)
+            self.searchDialog.CentreOnParent()
+        else:
+            self.searchDialog.Reset()
             
-            if self.searchDialog.ShowModal() == wx.ID_CANCEL:
-                self.searchDialog.Hide()
-                return
-            
-            cmd = self.searchDialog.GetCmd()
+        if self.searchDialog.ShowModal() == wx.ID_CANCEL:
             self.searchDialog.Hide()
-        else:
-            cmd = ['r.buffer']
+            return
+            
+        cmd = self.searchDialog.GetCmd()
+        self.searchDialog.Hide()
         
         # add action to canvas
         width, height = self.canvas.GetSize()



More information about the grass-commit mailing list