Sfoglia il codice sorgente

wxGUI: various minor fixes (wms, digitizer)
(merge https://trac.osgeo.org/grass/changeset/44548 from devbr6)


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@44549 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 14 anni fa
parent
commit
877e7cc237

+ 5 - 2
gui/wxpython/gui_modules/ogc_services.py

@@ -178,10 +178,13 @@ class WMSDialog(wx.Dialog):
             self.list.LoadData()
             self.btn_import.Enable(False)
             return # no layers found
-
+        
         lastLayer = lastStyle = ''
         for line in ret.splitlines():
-            key, value = line.split(':', 1)
+            try:
+                key, value = line.split(':', 1)
+            except ValueError:
+                continue
             key = key.strip().lower()
             value = value.strip()
             

+ 2 - 2
gui/wxpython/gui_modules/toolbars.py

@@ -1308,8 +1308,8 @@ class VDigitToolbar(AbstractToolbar):
         except gcmd.GException, e:
             self.mapLayer = None
             self.StopEditing()
-            GError(parent = self.parent,
-                   message = e)
+            gcmd.GError(parent = self.parent,
+                        message = str(e))
             return False
         
         # update toolbar

+ 11 - 4
gui/wxpython/wxgui.py

@@ -998,19 +998,26 @@ class GMFrame(wx.Frame):
                     cmd = ['r.in.wms',
                            'mapserver=%s' % dlg.GetSettings()['server'],
                            'layers=%s' % layer,
-                           'output=%s' % layer]
+                           'output=%s' % layer,
+                           'format=png',
+                           '--overwrite']
                     styles = ','.join(layers[layer])
                     if styles:
                         cmd.append('styles=%s' % styles)
                     self.goutput.RunCmd(cmd, switchPage = True)
+
+                    self.curr_page.maptree.AddLayer(ltype = 'raster',
+                                                    lname = layer,
+                                                    lcmd = ['d.rast', 'map=%s' % layer],
+                                                    multiple = False)
             else:
                 self.goutput.WriteWarning(_("Nothing to import. No WMS layer selected."))
-        
+                
+                
         dlg.Destroy()
         
     def OnShowAttributeTable(self, event):
-        """
-        Show attribute table of the given vector map layer
+        """!Show attribute table of the given vector map layer
         """
         if not self.curr_page:
             self.MsgNoLayerSelected()

+ 6 - 0
lib/gis/parser.c

@@ -473,6 +473,12 @@ int G_parser(int argc, char **argv)
 	while (--argc) {
 	    ptr = *(++argv);
 
+	    if (strcmp(ptr, "help") == 0 ||
+		strcmp(ptr, "-help") == 0 || strcmp(ptr, "--help") == 0) {
+		G_usage();
+		exit(EXIT_SUCCESS);
+	    }
+
 	    /* Overwrite option */
 	    if (strcmp(ptr, "--o") == 0 || strcmp(ptr, "--overwrite") == 0) {
 		st->overwrite = 1;