Sfoglia il codice sorgente

wxGUI: use grass.run_command instead gcmd.Command() (2)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@35170 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 16 anni fa
parent
commit
b84bccdcf9
1 ha cambiato i file con 6 aggiunte e 8 eliminazioni
  1. 6 8
      gui/wxpython/gui_modules/gdialogs.py

+ 6 - 8
gui/wxpython/gui_modules/gdialogs.py

@@ -1003,14 +1003,12 @@ class MultiImportDialog(wx.Dialog):
         path = event.GetString()
 
         if self.inputType == 'dxf':
-            try:
-                cmd = gcmd.Command(['v.in.dxf',
-                                    'input=%s' % path,
-                                    '-l', '--q'], stderr=None)
-            except gcmd.CmdError, e:
-                wx.MessageBox(parent=self, message=_("File <%(file)s>: Unable to get list of DXF layers.\n\n%(details)s") % \
-                              { 'file' : path, 'details' : e.message },
-                              caption=_("Error"), style=wx.ID_OK | wx.ICON_ERROR | wx.CENTRE)
+            ret = gcmd.RunCommand('v.in.dxf',
+                                  quiet = True,
+                                  parent = self,
+                                  flags = 'l',
+                                  input = path)
+            if ret != 0
                 self.list.LoadData()
                 self.btn_run.Enable(False)
                 return