[GRASS-SVN] r52644 - grass/trunk/gui/wxpython/dbmgr

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Aug 12 13:28:14 PDT 2012


Author: martinl
Date: 2012-08-12 13:28:13 -0700 (Sun, 12 Aug 2012)
New Revision: 52644

Modified:
   grass/trunk/gui/wxpython/dbmgr/sqlbuilder.py
Log:
wxGUI/dbmgr: update sqlbuilder main fn (select|update) - patch provided by Stepan Turek


Modified: grass/trunk/gui/wxpython/dbmgr/sqlbuilder.py
===================================================================
--- grass/trunk/gui/wxpython/dbmgr/sqlbuilder.py	2012-08-12 19:47:28 UTC (rev 52643)
+++ grass/trunk/gui/wxpython/dbmgr/sqlbuilder.py	2012-08-12 20:28:13 UTC (rev 52644)
@@ -10,7 +10,7 @@
 
 Usage:
 @code
-python sqlbuilder.py vector_map
+python sqlbuilder.py select|update vector_map
 @endcode
 
 (C) 2007-2009, 2011-2012 by the GRASS Development Team
@@ -706,15 +706,28 @@
                                 }
 
 if __name__ == "__main__":
-    if len(sys.argv) != 2:
+    if len(sys.argv) not in [3, 4]:
         print >>sys.stderr, __doc__
         sys.exit()
     
+    if len(sys.argv) == 3:
+        layer = 1
+    else:
+        layer = int(sys.argv[3])
+
+    if sys.argv[1] == 'select':
+        sqlBuilder = SQLBuilderSelect
+    elif sys.argv[1] == 'update':
+        sqlBuilder = SQLBuilderUpdate
+    else:
+        print >>sys.stderr, __doc__
+        sys.exit()
+
     import gettext
     gettext.install('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale'), unicode=True)
-    
+
     app = wx.App(0)
-    sqlb = SQLFrame(parent = None, title = _('SQL Builder'), vectmap = sys.argv[1])
+    sqlb = sqlBuilder(parent = None, vectmap = sys.argv[2], layer = layer)
     sqlb.Show()
-    
+      
     app.MainLoop()



More information about the grass-commit mailing list