瀏覽代碼

wxGUI/mapdisp: coding style clean up

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@44757 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 14 年之前
父節點
當前提交
609e2bc60f
共有 1 個文件被更改,包括 125 次插入130 次删除
  1. 125 130
      gui/wxpython/gui_modules/mapdisp.py

+ 125 - 130
gui/wxpython/gui_modules/mapdisp.py

@@ -85,10 +85,10 @@ class MapFrame(wx.Frame):
     """!Main frame for map display window. Drawing takes place in
     """!Main frame for map display window. Drawing takes place in
     child double buffered drawing window.
     child double buffered drawing window.
     """
     """
-    def __init__(self, parent=None, id=wx.ID_ANY, title=_("GRASS GIS - Map display"),
-                 style=wx.DEFAULT_FRAME_STYLE, toolbars=["map"],
-                 tree=None, notebook=None, lmgr=None, page=None,
-                 Map=None, auimgr=None, **kwargs):
+    def __init__(self, parent = None, id = wx.ID_ANY, title = _("GRASS GIS - Map display"),
+                 style = wx.DEFAULT_FRAME_STYLE, toolbars = ["map"],
+                 tree = None, notebook = None, lmgr = None, page = None,
+                 Map = None, auimgr = None, **kwargs):
         """!Main map display window with toolbars, statusbar and
         """!Main map display window with toolbars, statusbar and
         DrawWindow
         DrawWindow
 
 
@@ -151,26 +151,26 @@ class MapFrame(wx.Frame):
         #
         #
         # Add statusbar
         # Add statusbar
         #
         #
-        self.statusbar = self.CreateStatusBar(number=4, style=0)
+        self.statusbar = self.CreateStatusBar(number = 4, style = 0)
         self.statusbar.SetStatusWidths([-5, -2, -1, -1])
         self.statusbar.SetStatusWidths([-5, -2, -1, -1])
         self.statusbarWin = dict()
         self.statusbarWin = dict()
         self.statusbarWin['toggle'] = wx.Choice(self.statusbar, wx.ID_ANY,
         self.statusbarWin['toggle'] = wx.Choice(self.statusbar, wx.ID_ANY,
                                                 choices = globalvar.MAP_DISPLAY_STATUSBAR_MODE)
                                                 choices = globalvar.MAP_DISPLAY_STATUSBAR_MODE)
-        self.statusbarWin['toggle'].SetSelection(UserSettings.Get(group='display',
-                                                                  key='statusbarMode',
-                                                                  subkey='selection'))
+        self.statusbarWin['toggle'].SetSelection(UserSettings.Get(group = 'display',
+                                                                  key = 'statusbarMode',
+                                                                  subkey = 'selection'))
         self.statusbar.Bind(wx.EVT_CHOICE, self.OnToggleStatus, self.statusbarWin['toggle'])
         self.statusbar.Bind(wx.EVT_CHOICE, self.OnToggleStatus, self.statusbarWin['toggle'])
         # auto-rendering checkbox
         # auto-rendering checkbox
-        self.statusbarWin['render'] = wx.CheckBox(parent=self.statusbar, id=wx.ID_ANY,
-                                                  label=_("Render"))
+        self.statusbarWin['render'] = wx.CheckBox(parent = self.statusbar, id = wx.ID_ANY,
+                                                  label = _("Render"))
         self.statusbar.Bind(wx.EVT_CHECKBOX, self.OnToggleRender, self.statusbarWin['render'])
         self.statusbar.Bind(wx.EVT_CHECKBOX, self.OnToggleRender, self.statusbarWin['render'])
-        self.statusbarWin['render'].SetValue(UserSettings.Get(group='display',
-                                                              key='autoRendering',
-                                                              subkey='enabled'))
+        self.statusbarWin['render'].SetValue(UserSettings.Get(group = 'display',
+                                                              key = 'autoRendering',
+                                                              subkey = 'enabled'))
         self.statusbarWin['render'].SetToolTip(wx.ToolTip (_("Enable/disable auto-rendering")))
         self.statusbarWin['render'].SetToolTip(wx.ToolTip (_("Enable/disable auto-rendering")))
         # show region
         # show region
-        self.statusbarWin['region'] = wx.CheckBox(parent=self.statusbar, id=wx.ID_ANY,
-                                                  label=_("Show computational extent"))
+        self.statusbarWin['region'] = wx.CheckBox(parent = self.statusbar, id = wx.ID_ANY,
+                                                  label = _("Show computational extent"))
         self.statusbar.Bind(wx.EVT_CHECKBOX, self.OnToggleShowRegion, self.statusbarWin['region'])
         self.statusbar.Bind(wx.EVT_CHECKBOX, self.OnToggleShowRegion, self.statusbarWin['region'])
         
         
         self.statusbarWin['region'].SetValue(False)
         self.statusbarWin['region'].SetValue(False)
@@ -182,10 +182,10 @@ class MapFrame(wx.Frame):
                                                              "computational region inside a display region "
                                                              "computational region inside a display region "
                                                              "as a red box).")))
                                                              "as a red box).")))
         # set resolution
         # set resolution
-        self.statusbarWin['resolution'] = wx.CheckBox(parent=self.statusbar, id=wx.ID_ANY,
-                                                      label=_("Constrain display resolution to computational settings"))
+        self.statusbarWin['resolution'] = wx.CheckBox(parent = self.statusbar, id = wx.ID_ANY,
+                                                      label = _("Constrain display resolution to computational settings"))
         self.statusbar.Bind(wx.EVT_CHECKBOX, self.OnToggleResolution, self.statusbarWin['resolution'])
         self.statusbar.Bind(wx.EVT_CHECKBOX, self.OnToggleResolution, self.statusbarWin['resolution'])
-        self.statusbarWin['resolution'].SetValue(UserSettings.Get(group='display', key='compResolution', subkey='enabled'))
+        self.statusbarWin['resolution'].SetValue(UserSettings.Get(group = 'display', key = 'compResolution', subkey = 'enabled'))
         self.statusbarWin['resolution'].Hide()
         self.statusbarWin['resolution'].Hide()
         self.statusbarWin['resolution'].SetToolTip(wx.ToolTip (_("Constrain display resolution "
         self.statusbarWin['resolution'].SetToolTip(wx.ToolTip (_("Constrain display resolution "
                                                                  "to computational region settings. "
                                                                  "to computational region settings. "
@@ -194,7 +194,7 @@ class MapFrame(wx.Frame):
         # map scale
         # map scale
         self.statusbarWin['mapscale'] = wx.ComboBox(parent = self.statusbar, id = wx.ID_ANY,
         self.statusbarWin['mapscale'] = wx.ComboBox(parent = self.statusbar, id = wx.ID_ANY,
                                                     style = wx.TE_PROCESS_ENTER,
                                                     style = wx.TE_PROCESS_ENTER,
-                                                    size=(150, -1))
+                                                    size = (150, -1))
         self.statusbarWin['mapscale'].SetItems(['1:1000',
         self.statusbarWin['mapscale'].SetItems(['1:1000',
                                                 '1:5000',
                                                 '1:5000',
                                                 '1:10000',
                                                 '1:10000',
@@ -207,15 +207,15 @@ class MapFrame(wx.Frame):
         self.statusbar.Bind(wx.EVT_COMBOBOX, self.OnChangeMapScale, self.statusbarWin['mapscale'])
         self.statusbar.Bind(wx.EVT_COMBOBOX, self.OnChangeMapScale, self.statusbarWin['mapscale'])
 
 
         # go to
         # go to
-        self.statusbarWin['goto'] = wx.TextCtrl(parent=self.statusbar, id=wx.ID_ANY,
-                                                value="", style=wx.TE_PROCESS_ENTER,
-                                                size=(300, -1))
+        self.statusbarWin['goto'] = wx.TextCtrl(parent = self.statusbar, id = wx.ID_ANY,
+                                                value = "", style = wx.TE_PROCESS_ENTER,
+                                                size = (300, -1))
         self.statusbarWin['goto'].Hide()
         self.statusbarWin['goto'].Hide()
         self.statusbar.Bind(wx.EVT_TEXT_ENTER, self.OnGoTo, self.statusbarWin['goto'])
         self.statusbar.Bind(wx.EVT_TEXT_ENTER, self.OnGoTo, self.statusbarWin['goto'])
 
 
         # projection
         # projection
-        self.statusbarWin['projection'] = wx.CheckBox(parent=self.statusbar, id=wx.ID_ANY,
-                                                      label=_("Use defined projection"))
+        self.statusbarWin['projection'] = wx.CheckBox(parent = self.statusbar, id = wx.ID_ANY,
+                                                      label = _("Use defined projection"))
         self.statusbarWin['projection'].SetValue(False)
         self.statusbarWin['projection'].SetValue(False)
         size = self.statusbarWin['projection'].GetSize()
         size = self.statusbarWin['projection'].GetSize()
         self.statusbarWin['projection'].SetMinSize((size[0] + 150, size[1]))
         self.statusbarWin['projection'].SetMinSize((size[0] + 150, size[1]))
@@ -231,8 +231,8 @@ class MapFrame(wx.Frame):
         self.statusbarWin['mask'].SetForegroundColour(wx.Colour(255, 0, 0))
         self.statusbarWin['mask'].SetForegroundColour(wx.Colour(255, 0, 0))
         
         
         # on-render gauge
         # on-render gauge
-        self.statusbarWin['progress'] = wx.Gauge(parent=self.statusbar, id=wx.ID_ANY,
-                                      range=0, style=wx.GA_HORIZONTAL)
+        self.statusbarWin['progress'] = wx.Gauge(parent = self.statusbar, id = wx.ID_ANY,
+                                      range = 0, style = wx.GA_HORIZONTAL)
         self.statusbarWin['progress'].Hide()
         self.statusbarWin['progress'].Hide()
         
         
         self.StatusbarReposition() # reposition statusbar
         self.StatusbarReposition() # reposition statusbar
@@ -240,8 +240,8 @@ class MapFrame(wx.Frame):
         #
         #
         # Init map display (buffered DC & set default cursor)
         # Init map display (buffered DC & set default cursor)
         #
         #
-        self.MapWindow2D = BufferedWindow(self, id=wx.ID_ANY,
-                                          Map=self.Map, tree=self.tree, lmgr=self._layerManager)
+        self.MapWindow2D = BufferedWindow(self, id = wx.ID_ANY,
+                                          Map = self.Map, tree = self.tree, lmgr = self._layerManager)
         # default is 2D display mode
         # default is 2D display mode
         self.MapWindow = self.MapWindow2D
         self.MapWindow = self.MapWindow2D
         self.MapWindow.SetCursor(self.cursors["default"])
         self.MapWindow.SetCursor(self.cursors["default"])
@@ -347,9 +347,9 @@ class MapFrame(wx.Frame):
                 log = self._layerManager.goutput
                 log = self._layerManager.goutput
             else:
             else:
                 log = None
                 log = None
-            self.toolbars['vdigit'] = toolbars.VDigitToolbar(parent=self, mapcontent=self.Map,
-                                                             layerTree=self.tree,
-                                                             log=log)
+            self.toolbars['vdigit'] = toolbars.VDigitToolbar(parent = self, mapcontent = self.Map,
+                                                             layerTree = self.tree,
+                                                             log = log)
             
             
             self._mgr.AddPane(self.toolbars['vdigit'],
             self._mgr.AddPane(self.toolbars['vdigit'],
                               wx.aui.AuiPaneInfo().
                               wx.aui.AuiPaneInfo().
@@ -363,8 +363,8 @@ class MapFrame(wx.Frame):
             # change mouse to draw digitized line
             # change mouse to draw digitized line
             self.MapWindow.mouse['box'] = "point"
             self.MapWindow.mouse['box'] = "point"
             self.MapWindow.zoomtype = 0
             self.MapWindow.zoomtype = 0
-            self.MapWindow.pen     = wx.Pen(colour='red',   width=2, style=wx.SOLID)
-            self.MapWindow.polypen = wx.Pen(colour='green', width=2, style=wx.SOLID)
+            self.MapWindow.pen     = wx.Pen(colour = 'red',   width = 2, style = wx.SOLID)
+            self.MapWindow.polypen = wx.Pen(colour = 'green', width = 2, style = wx.SOLID)
         # georectifier
         # georectifier
         elif name == "georect":
         elif name == "georect":
             self.toolbars['georect'] = toolbars.GRToolbar(self, self.Map)
             self.toolbars['georect'] = toolbars.GRToolbar(self, self.Map)
@@ -406,8 +406,8 @@ class MapFrame(wx.Frame):
             
             
             # create GL window & NVIZ toolbar
             # create GL window & NVIZ toolbar
             if not self.MapWindow3D:
             if not self.MapWindow3D:
-                self.MapWindow3D = nviz.GLWindow(self, id=wx.ID_ANY,
-                                                 Map=self.Map, tree=self.tree, lmgr=self._layerManager)
+                self.MapWindow3D = nviz.GLWindow(self, id = wx.ID_ANY,
+                                                 Map = self.Map, tree = self.tree, lmgr = self._layerManager)
                 self.MapWindow = self.MapWindow3D
                 self.MapWindow = self.MapWindow3D
                 self.MapWindow.SetCursor(self.cursors["default"])
                 self.MapWindow.SetCursor(self.cursors["default"])
                 
                 
@@ -530,7 +530,7 @@ class MapFrame(wx.Frame):
         """!Re-render map composition (each map layer)
         """!Re-render map composition (each map layer)
         """
         """
         # delete tmp map layers (queries)
         # delete tmp map layers (queries)
-        qlayer = self.Map.GetListOfLayers(l_name=globalvar.QUERYLAYER)
+        qlayer = self.Map.GetListOfLayers(l_name = globalvar.QUERYLAYER)
         for layer in qlayer:
         for layer in qlayer:
             self.Map.DeleteLayer(layer)
             self.Map.DeleteLayer(layer)
         
         
@@ -543,9 +543,9 @@ class MapFrame(wx.Frame):
         # deselect features in vdigit
         # deselect features in vdigit
         if self.toolbars['vdigit'] and self.digit:
         if self.toolbars['vdigit'] and self.digit:
             self.digit.driver.SetSelected([])
             self.digit.driver.SetSelected([])
-            self.MapWindow.UpdateMap(render=True, renderVector=True)
+            self.MapWindow.UpdateMap(render = True, renderVector = True)
         else:
         else:
-            self.MapWindow.UpdateMap(render=True)
+            self.MapWindow.UpdateMap(render = True)
         
         
         # update statusbar
         # update statusbar
         self.StatusbarUpdate()
         self.StatusbarUpdate()
@@ -597,7 +597,7 @@ class MapFrame(wx.Frame):
         self.MapWindow.mouse['use'] = "zoom"
         self.MapWindow.mouse['use'] = "zoom"
         self.MapWindow.mouse['box'] = "box"
         self.MapWindow.mouse['box'] = "box"
         self.MapWindow.zoomtype = 1
         self.MapWindow.zoomtype = 1
-        self.MapWindow.pen = wx.Pen(colour='Red', width=2, style=wx.SHORT_DASH)
+        self.MapWindow.pen = wx.Pen(colour = 'Red', width = 2, style = wx.SHORT_DASH)
         
         
         # change the cursor
         # change the cursor
         self.MapWindow.SetCursor(self.cursors["cross"])
         self.MapWindow.SetCursor(self.cursors["cross"])
@@ -614,7 +614,7 @@ class MapFrame(wx.Frame):
         self.MapWindow.mouse['use'] = "zoom"
         self.MapWindow.mouse['use'] = "zoom"
         self.MapWindow.mouse['box'] = "box"
         self.MapWindow.mouse['box'] = "box"
         self.MapWindow.zoomtype = -1
         self.MapWindow.zoomtype = -1
-        self.MapWindow.pen = wx.Pen(colour='Red', width=2, style=wx.SHORT_DASH)
+        self.MapWindow.pen = wx.Pen(colour = 'Red', width = 2, style = wx.SHORT_DASH)
         
         
         # change the cursor
         # change the cursor
         self.MapWindow.SetCursor(self.cursors["cross"])
         self.MapWindow.SetCursor(self.cursors["cross"])
@@ -738,13 +738,13 @@ class MapFrame(wx.Frame):
         """
         """
         try:
         try:
             if self.statusbarWin['projection'].IsChecked():
             if self.statusbarWin['projection'].IsChecked():
-                if not UserSettings.Get(group='projection', key='statusbar', subkey='proj4'):
+                if not UserSettings.Get(group = 'projection', key = 'statusbar', subkey = 'proj4'):
                     self.statusbar.SetStatusText(_("Projection not defined (check the settings)"), 0)
                     self.statusbar.SetStatusText(_("Projection not defined (check the settings)"), 0)
                 else:
                 else:
                     # reproject values
                     # reproject values
-                    projIn = UserSettings.Get(group='projection',
-                                              key='statusbar',
-                                              subkey='proj4')
+                    projIn = UserSettings.Get(group = 'projection',
+                                              key = 'statusbar',
+                                              subkey = 'proj4')
                     projOut = gcmd.RunCommand('g.proj',
                     projOut = gcmd.RunCommand('g.proj',
                                               flags = 'jf',
                                               flags = 'jf',
                                               read = True)
                                               read = True)
@@ -770,7 +770,7 @@ class MapFrame(wx.Frame):
                     
                     
             region = self.Map.GetCurrentRegion()
             region = self.Map.GetCurrentRegion()
             if self.statusbarWin['projection'].IsChecked():
             if self.statusbarWin['projection'].IsChecked():
-                if not UserSettings.Get(group='projection', key='statusbar', subkey='proj4'):
+                if not UserSettings.Get(group = 'projection', key = 'statusbar', subkey = 'proj4'):
                     self.statusbar.SetStatusText(_("Projection not defined (check the settings)"), 0)
                     self.statusbar.SetStatusText(_("Projection not defined (check the settings)"), 0)
                 else:
                 else:
                     region['center_easting'], region['center_northing'] = e, n
                     region['center_easting'], region['center_northing'] = e, n
@@ -841,12 +841,12 @@ class MapFrame(wx.Frame):
                                       subkey = 'll')
                                       subkey = 'll')
             
             
             if self.statusbarWin['projection'].IsChecked():
             if self.statusbarWin['projection'].IsChecked():
-                if not UserSettings.Get(group='projection', key='statusbar', subkey='proj4'):
+                if not UserSettings.Get(group = 'projection', key = 'statusbar', subkey = 'proj4'):
                     self.statusbar.SetStatusText(_("Projection not defined (check the settings)"), 0)
                     self.statusbar.SetStatusText(_("Projection not defined (check the settings)"), 0)
                 else:
                 else:
-                    projOut = UserSettings.Get(group='projection',
-                                               key='statusbar',
-                                               subkey='proj4')
+                    projOut = UserSettings.Get(group = 'projection',
+                                               key = 'statusbar',
+                                               subkey = 'proj4')
                     proj, coord1 = utils.ReprojectCoordinates(coord = (region["w"], region["s"]),
                     proj, coord1 = utils.ReprojectCoordinates(coord = (region["w"], region["s"]),
                                                               projOut = projOut, flags = 'd')
                                                               projOut = projOut, flags = 'd')
                     proj, coord2 = utils.ReprojectCoordinates(coord = (region["e"], region["n"]),
                     proj, coord2 = utils.ReprojectCoordinates(coord = (region["e"], region["n"]),
@@ -999,9 +999,9 @@ class MapFrame(wx.Frame):
                 else:
                 else:
                     proj, coord  = utils.ReprojectCoordinates(coord = (region['center_easting'],
                     proj, coord  = utils.ReprojectCoordinates(coord = (region['center_easting'],
                                                                        region['center_northing']),
                                                                        region['center_northing']),
-                                                              projOut = UserSettings.Get(group='projection',
-                                                                                         key='statusbar',
-                                                                                         subkey='proj4'),
+                                                              projOut = UserSettings.Get(group = 'projection',
+                                                                                         key = 'statusbar',
+                                                                                         subkey = 'proj4'),
                                                               flags = 'd')
                                                               flags = 'd')
                     if coord:
                     if coord:
                         if proj in ('ll', 'latlong', 'longlat') and format == 'DMS':
                         if proj in ('ll', 'latlong', 'longlat') and format == 'DMS':
@@ -1028,7 +1028,7 @@ class MapFrame(wx.Frame):
         
         
         elif self.statusbarWin['toggle'].GetSelection() == 8: # projection
         elif self.statusbarWin['toggle'].GetSelection() == 8: # projection
             self.statusbar.SetStatusText("")
             self.statusbar.SetStatusText("")
-            epsg = UserSettings.Get(group='projection', key='statusbar', subkey='epsg')
+            epsg = UserSettings.Get(group = 'projection', key = 'statusbar', subkey = 'epsg')
             if epsg:
             if epsg:
                 label = '%s (EPSG: %s)' % (_("Use defined projection"), epsg)
                 label = '%s (EPSG: %s)' % (_("Use defined projection"), epsg)
                 self.statusbarWin['projection'].SetLabel(label)
                 self.statusbarWin['projection'].SetLabel(label)
@@ -1042,7 +1042,7 @@ class MapFrame(wx.Frame):
         else:
         else:
             self.statusbar.SetStatusText("", 1)
             self.statusbar.SetStatusText("", 1)
 
 
-    def StatusbarEnableLongHelp(self, enable=True):
+    def StatusbarEnableLongHelp(self, enable = True):
         """!Enable/disable toolbars long help"""
         """!Enable/disable toolbars long help"""
         for toolbar in self.toolbars.itervalues():
         for toolbar in self.toolbars.itervalues():
             if toolbar:
             if toolbar:
@@ -1113,7 +1113,7 @@ class MapFrame(wx.Frame):
                             message = _("Choose a file name to save the image "
                             message = _("Choose a file name to save the image "
                                         "(no need to add extension)"),
                                         "(no need to add extension)"),
                             wildcard = filetype,
                             wildcard = filetype,
-                            style=wx.SAVE | wx.FD_OVERWRITE_PROMPT)
+                            style = wx.SAVE | wx.FD_OVERWRITE_PROMPT)
         
         
         if dlg.ShowModal() == wx.ID_OK:
         if dlg.ShowModal() == wx.ID_OK:
             path = dlg.GetPath()
             path = dlg.GetPath()
@@ -1223,7 +1223,7 @@ class MapFrame(wx.Frame):
         self.toolbars['map'].action['desc'] = 'modifyAttrb'
         self.toolbars['map'].action['desc'] = 'modifyAttrb'
         
         
         self.MapWindow.mouse['use'] = "queryVector"
         self.MapWindow.mouse['use'] = "queryVector"
-        self.MapWindow.pen = wx.Pen(colour='Red', width=2, style=wx.SHORT_DASH)
+        self.MapWindow.pen = wx.Pen(colour = 'Red', width = 2, style = wx.SHORT_DASH)
         self._OnQuery()
         self._OnQuery()
         
         
     def OnNvizQuerySurface(self, event):
     def OnNvizQuerySurface(self, event):
@@ -1293,7 +1293,7 @@ class MapFrame(wx.Frame):
         
         
         # use display region settings instead of computation region settings
         # use display region settings instead of computation region settings
         self.tmpreg = os.getenv("GRASS_REGION")
         self.tmpreg = os.getenv("GRASS_REGION")
-        os.environ["GRASS_REGION"] = self.Map.SetRegion(windres=False)
+        os.environ["GRASS_REGION"] = self.Map.SetRegion(windres = False)
         
         
         # build query commands for any selected rasters and vectors
         # build query commands for any selected rasters and vectors
         if raststr != '':
         if raststr != '':
@@ -1328,8 +1328,8 @@ class MapFrame(wx.Frame):
         if self._layerManager:
         if self._layerManager:
             if raststr:
             if raststr:
                 self._layerManager.goutput.RunCmd(rcmd,
                 self._layerManager.goutput.RunCmd(rcmd,
-                                                  compReg=False,
-                                                  onDone = self._QueryMapDone)
+                                                  compReg = False,
+                                                  onDone  =  self._QueryMapDone)
             if vectstr:
             if vectstr:
                 self._layerManager.goutput.RunCmd(vcmd,
                 self._layerManager.goutput.RunCmd(vcmd,
                                                   onDone = self._QueryMapDone)
                                                   onDone = self._QueryMapDone)
@@ -1363,18 +1363,18 @@ class MapFrame(wx.Frame):
         """
         """
         if not self.tree.layer_selected or \
         if not self.tree.layer_selected or \
                 self.tree.GetPyData(self.tree.layer_selected)[0]['type'] != 'vector':
                 self.tree.GetPyData(self.tree.layer_selected)[0]['type'] != 'vector':
-            wx.MessageBox(parent=self,
-                          message=_("No vector map selected for querying."),
-                          caption=_("Vector querying"),
-                          style=wx.OK | wx.ICON_INFORMATION | wx.CENTRE)
+            wx.MessageBox(parent = self,
+                          message = _("No vector map selected for querying."),
+                          caption = _("Vector querying"),
+                          style = wx.OK | wx.ICON_INFORMATION | wx.CENTRE)
             return
             return
         
         
         if self.tree.GetPyData(self.tree.layer_selected)[0]['maplayer'].GetMapset() != \
         if self.tree.GetPyData(self.tree.layer_selected)[0]['maplayer'].GetMapset() != \
                 grass.gisenv()['MAPSET']:
                 grass.gisenv()['MAPSET']:
-            wx.MessageBox(parent=self,
-                          message=_("Only vector map from the current mapset can be modified."),
-                          caption=_("Vector querying"),
-                          style=wx.OK | wx.ICON_INFORMATION | wx.CENTRE)
+            wx.MessageBox(parent = self,
+                          message = _("Only vector map from the current mapset can be modified."),
+                          caption = _("Vector querying"),
+                          style = wx.OK | wx.ICON_INFORMATION | wx.CENTRE)
             return
             return
         
         
         posWindow = self.ClientToScreen((x + self.MapWindow.dialogOffset,
         posWindow = self.ClientToScreen((x + self.MapWindow.dialogOffset,
@@ -1389,23 +1389,23 @@ class MapFrame(wx.Frame):
         
         
         if self.dialogs['attributes'] is None:
         if self.dialogs['attributes'] is None:
             self.dialogs['attributes'] = \
             self.dialogs['attributes'] = \
-                dbm_dialogs.DisplayAttributesDialog(parent=self.MapWindow,
-                                                    map=mapName,
-                                                    query=((east, north), qdist),
-                                                    pos=posWindow,
-                                                    action="update")
+                dbm_dialogs.DisplayAttributesDialog(parent = self.MapWindow,
+                                                    map = mapName,
+                                                    query = ((east, north), qdist),
+                                                    pos = posWindow,
+                                                    action = "update")
         else:
         else:
             # selection changed?
             # selection changed?
             if not self.dialogs['attributes'].mapDBInfo or \
             if not self.dialogs['attributes'].mapDBInfo or \
                     self.dialogs['attributes'].mapDBInfo.map != mapName:
                     self.dialogs['attributes'].mapDBInfo.map != mapName:
-                self.dialogs['attributes'].UpdateDialog(map=mapName, query=((east, north), qdist))
+                self.dialogs['attributes'].UpdateDialog(map = mapName, query = ((east, north), qdist))
             else:
             else:
-                self.dialogs['attributes'].UpdateDialog(query=((east, north), qdist))
+                self.dialogs['attributes'].UpdateDialog(query = ((east, north), qdist))
                 
                 
         cats = self.dialogs['attributes'].GetCats()
         cats = self.dialogs['attributes'].GetCats()
         
         
         try:
         try:
-            qlayer = self.Map.GetListOfLayers(l_name=globalvar.QUERYLAYER)[0]
+            qlayer = self.Map.GetListOfLayers(l_name = globalvar.QUERYLAYER)[0]
         except IndexError:
         except IndexError:
             qlayer = None
             qlayer = None
         
         
@@ -1413,22 +1413,22 @@ class MapFrame(wx.Frame):
             # highlight feature & re-draw map
             # highlight feature & re-draw map
             if qlayer:
             if qlayer:
                 qlayer.SetCmd(self.AddTmpVectorMapLayer(mapName, cats,
                 qlayer.SetCmd(self.AddTmpVectorMapLayer(mapName, cats,
-                                                        useId=False,
-                                                        addLayer=False))
+                                                        useId = False,
+                                                        addLayer = False))
             else:
             else:
-                qlayer = self.AddTmpVectorMapLayer(mapName, cats, useId=False)
+                qlayer = self.AddTmpVectorMapLayer(mapName, cats, useId = False)
             
             
             # set opacity based on queried layer
             # set opacity based on queried layer
-            opacity = self.tree.GetPyData(self.tree.layer_selected)[0]['maplayer'].GetOpacity(float=True)
+            opacity = self.tree.GetPyData(self.tree.layer_selected)[0]['maplayer'].GetOpacity(float = True)
             qlayer.SetOpacity(opacity)
             qlayer.SetOpacity(opacity)
             
             
-            self.MapWindow.UpdateMap(render=False, renderVector=False)
+            self.MapWindow.UpdateMap(render = False, renderVector = False)
             if not self.dialogs['attributes'].IsShown():
             if not self.dialogs['attributes'].IsShown():
                 self.dialogs['attributes'].Show()
                 self.dialogs['attributes'].Show()
         else:
         else:
             if qlayer:
             if qlayer:
                 self.Map.DeleteLayer(qlayer)
                 self.Map.DeleteLayer(qlayer)
-                self.MapWindow.UpdateMap(render=False, renderVector=False)
+                self.MapWindow.UpdateMap(render = False, renderVector = False)
             if self.dialogs['attributes'].IsShown():
             if self.dialogs['attributes'].IsShown():
                 self.dialogs['attributes'].Hide()
                 self.dialogs['attributes'].Hide()
         
         
@@ -1458,9 +1458,9 @@ class MapFrame(wx.Frame):
             if action == "nvizQueryVector":
             if action == "nvizQueryVector":
                 vector.Check(True)
                 vector.Check(True)
         else:
         else:
-            display = wx.MenuItem(parentMenu=toolsmenu, id=wx.ID_ANY,
-                                  text=_("Query raster/vector map(s) (display mode)"),
-                                  kind=wx.ITEM_CHECK)
+            display = wx.MenuItem(parentMenu = toolsmenu, id = wx.ID_ANY,
+                                  text = _("Query raster/vector map(s) (display mode)"),
+                                  kind = wx.ITEM_CHECK)
             toolsmenu.AppendItem(display)
             toolsmenu.AppendItem(display)
             self.Bind(wx.EVT_MENU, self.OnQueryDisplay, display)
             self.Bind(wx.EVT_MENU, self.OnQueryDisplay, display)
             numLayers = 0
             numLayers = 0
@@ -1475,13 +1475,13 @@ class MapFrame(wx.Frame):
             if action == "displayAttrb":
             if action == "displayAttrb":
                 display.Check(True)
                 display.Check(True)
             
             
-            modify = wx.MenuItem(parentMenu=toolsmenu, id=wx.ID_ANY,
-                                 text=_("Query vector map (edit mode)"),
-                                 kind=wx.ITEM_CHECK)
+            modify = wx.MenuItem(parentMenu = toolsmenu, id = wx.ID_ANY,
+                                 text = _("Query vector map (edit mode)"),
+                                 kind = wx.ITEM_CHECK)
             toolsmenu.AppendItem(modify)
             toolsmenu.AppendItem(modify)
             self.Bind(wx.EVT_MENU, self.OnQueryModify, modify)
             self.Bind(wx.EVT_MENU, self.OnQueryModify, modify)
             modify.Enable(False)
             modify.Enable(False)
-        
+            
             digitToolbar = self.toolbars['vdigit']
             digitToolbar = self.toolbars['vdigit']
             if self.tree.layer_selected:
             if self.tree.layer_selected:
                 layer_selected = self.tree.GetPyData(self.tree.layer_selected)[0]['maplayer']
                 layer_selected = self.tree.GetPyData(self.tree.layer_selected)[0]['maplayer']
@@ -1503,7 +1503,7 @@ class MapFrame(wx.Frame):
         @param useId use feature id instead of category 
         @param useId use feature id instead of category 
         """
         """
         # color settings from ATM
         # color settings from ATM
-        color = UserSettings.Get(group='atm', key='highlight', subkey='color')
+        color = UserSettings.Get(group = 'atm', key = 'highlight', subkey = 'color')
         colorStr = str(color[0]) + ":" + \
         colorStr = str(color[0]) + ":" + \
             str(color[1]) + ":" + \
             str(color[1]) + ":" + \
             str(color[2])
             str(color[2])
@@ -1522,7 +1522,7 @@ class MapFrame(wx.Frame):
                    "map=%s" % name,
                    "map=%s" % name,
                    "color=%s" % colorStr,
                    "color=%s" % colorStr,
                    "fcolor=%s" % colorStr,
                    "fcolor=%s" % colorStr,
-                   "width=%d"  % UserSettings.Get(group='atm', key='highlight', subkey='width')]
+                   "width=%d"  % UserSettings.Get(group = 'atm', key = 'highlight', subkey = 'width')]
         if icon != '':
         if icon != '':
             pattern.append('icon=%s' % icon)
             pattern.append('icon=%s' % icon)
         if size > 0:
         if size > 0:
@@ -1540,18 +1540,13 @@ class MapFrame(wx.Frame):
                 cmd[-1].append("layer=%d" % layer)
                 cmd[-1].append("layer=%d" % layer)
                 cmd[-1].append("cats=%s" % utils.ListOfCatsToRange(lcats))
                 cmd[-1].append("cats=%s" % utils.ListOfCatsToRange(lcats))
         
         
-        #     if self.icon:
-        #         cmd.append("icon=%s" % (self.icon))
-        #     if self.pointsize:
-        #         cmd.append("size=%s" % (self.pointsize))
-
         if addLayer:
         if addLayer:
             if useId:
             if useId:
-                return self.Map.AddLayer(type='vector', name=globalvar.QUERYLAYER, command=cmd,
-                                         l_active=True, l_hidden=True, l_opacity=1.0)
+                return self.Map.AddLayer(type = 'vector', name = globalvar.QUERYLAYER, command = cmd,
+                                         l_active = True, l_hidden = True, l_opacity = 1.0)
             else:
             else:
-                return self.Map.AddLayer(type='command', name=globalvar.QUERYLAYER, command=cmd,
-                                         l_active=True, l_hidden=True, l_opacity=1.0)
+                return self.Map.AddLayer(type = 'command', name = globalvar.QUERYLAYER, command = cmd,
+                                         l_active = True, l_hidden = True, l_opacity = 1.0)
         else:
         else:
             return cmd
             return cmd
 
 
@@ -1594,8 +1589,8 @@ class MapFrame(wx.Frame):
         self.MapWindow.mouse['use'] = "measure"
         self.MapWindow.mouse['use'] = "measure"
         self.MapWindow.mouse['box'] = "line"
         self.MapWindow.mouse['box'] = "line"
         self.MapWindow.zoomtype = 0
         self.MapWindow.zoomtype = 0
-        self.MapWindow.pen     = wx.Pen(colour='red', width=2, style=wx.SHORT_DASH)
-        self.MapWindow.polypen = wx.Pen(colour='green', width=2, style=wx.SHORT_DASH)
+        self.MapWindow.pen     = wx.Pen(colour = 'red', width = 2, style = wx.SHORT_DASH)
+        self.MapWindow.polypen = wx.Pen(colour = 'green', width = 2, style = wx.SHORT_DASH)
 
 
         # change the cursor
         # change the cursor
         self.MapWindow.SetCursor(self.cursors["pencil"])
         self.MapWindow.SetCursor(self.cursors["pencil"])
@@ -1659,8 +1654,8 @@ class MapFrame(wx.Frame):
             raster.append(self.tree.GetPyData(self.tree.layer_selected)[0]['maplayer'].name)
             raster.append(self.tree.GetPyData(self.tree.layer_selected)[0]['maplayer'].name)
 
 
         self.profile = profile.ProfileFrame(self,
         self.profile = profile.ProfileFrame(self,
-                                            id=wx.ID_ANY, pos=wx.DefaultPosition, size=(700,300),
-                                            style=wx.DEFAULT_FRAME_STYLE, rasterList=raster)
+                                            id = wx.ID_ANY, pos = wx.DefaultPosition, size = (700,300),
+                                            style = wx.DEFAULT_FRAME_STYLE, rasterList = raster)
         self.profile.Show()
         self.profile.Show()
         # Open raster select dialog to make sure that a raster (and the desired raster)
         # Open raster select dialog to make sure that a raster (and the desired raster)
         # is selected to be profiled
         # is selected to be profiled
@@ -1717,8 +1712,8 @@ class MapFrame(wx.Frame):
         """!Init histogram display canvas and tools
         """!Init histogram display canvas and tools
         """
         """
         self.histogram = histogram.HistFrame(self,
         self.histogram = histogram.HistFrame(self,
-                                             id=wx.ID_ANY, size=globalvar.HIST_WINDOW_SIZE,
-                                             style=wx.DEFAULT_FRAME_STYLE)
+                                             id = wx.ID_ANY, size = globalvar.HIST_WINDOW_SIZE,
+                                             style = wx.DEFAULT_FRAME_STYLE)
 
 
         #show new display
         #show new display
         self.histogram.Show()
         self.histogram.Show()
@@ -1769,12 +1764,12 @@ class MapFrame(wx.Frame):
 
 
         # decoration overlay control dialog
         # decoration overlay control dialog
         self.dialogs['barscale'] = \
         self.dialogs['barscale'] = \
-            gdialogs.DecorationDialog(parent=self, title=_('Scale and North arrow'),
-                                      size=(350, 200),
-                                      style=wx.DEFAULT_DIALOG_STYLE | wx.CENTRE,
-                                      cmd=['d.barscale', 'at=0,5'],
-                                      ovlId=id,
-                                      name='barscale',
+            gdialogs.DecorationDialog(parent = self, title = _('Scale and North arrow'),
+                                      size = (350, 200),
+                                      style = wx.DEFAULT_DIALOG_STYLE | wx.CENTRE,
+                                      cmd = ['d.barscale', 'at = 0,5'],
+                                      ovlId = id,
+                                      name = 'barscale',
                                       checktxt = _("Show/hide scale and North arrow"),
                                       checktxt = _("Show/hide scale and North arrow"),
                                       ctrltxt = _("scale object"))
                                       ctrltxt = _("scale object"))
 
 
@@ -1799,12 +1794,12 @@ class MapFrame(wx.Frame):
 
 
         # Decoration overlay control dialog
         # Decoration overlay control dialog
         self.dialogs['legend'] = \
         self.dialogs['legend'] = \
-            gdialogs.DecorationDialog(parent=self, title=('Legend'),
-                                      size=(350, 200),
-                                      style=wx.DEFAULT_DIALOG_STYLE | wx.CENTRE,
-                                      cmd=cmd,
-                                      ovlId=id,
-                                      name='legend',
+            gdialogs.DecorationDialog(parent = self, title = ('Legend'),
+                                      size = (350, 200),
+                                      style = wx.DEFAULT_DIALOG_STYLE | wx.CENTRE,
+                                      cmd = cmd,
+                                      ovlId = id,
+                                      name = 'legend',
                                       checktxt = _("Show/hide legend"),
                                       checktxt = _("Show/hide legend"),
                                       ctrltxt = _("legend object")) 
                                       ctrltxt = _("legend object")) 
 
 
@@ -1826,9 +1821,9 @@ class MapFrame(wx.Frame):
             else:
             else:
                 id = 101
                 id = 101
 
 
-        self.dialogs['text'] = gdialogs.TextLayerDialog(parent=self, ovlId=id, 
-                                                        title=_('Add text layer'),
-                                                        size=(400, 200))
+        self.dialogs['text'] = gdialogs.TextLayerDialog(parent = self, ovlId = id, 
+                                                        title = _('Add text layer'),
+                                                        size = (400, 200))
         self.dialogs['text'].CenterOnParent()
         self.dialogs['text'].CenterOnParent()
 
 
         # If OK button pressed in decoration control dialog
         # If OK button pressed in decoration control dialog
@@ -1851,10 +1846,10 @@ class MapFrame(wx.Frame):
             self.MapWindow.pdc.SetId(id)
             self.MapWindow.pdc.SetId(id)
             self.MapWindow.textdict[id] = self.dialogs['text'].GetValues()
             self.MapWindow.textdict[id] = self.dialogs['text'].GetValues()
             
             
-            self.MapWindow.Draw(self.MapWindow.pdcDec, img=self.MapWindow.textdict[id],
-                                drawid=id, pdctype='text', coords=coords)
+            self.MapWindow.Draw(self.MapWindow.pdcDec, img = self.MapWindow.textdict[id],
+                                drawid = id, pdctype = 'text', coords = coords)
             
             
-            self.MapWindow.UpdateMap(render=False, renderVector=False)
+            self.MapWindow.UpdateMap(render = False, renderVector = False)
             
             
         self.MapWindow.mouse['use'] = 'pointer'
         self.MapWindow.mouse['use'] = 'pointer'
 
 
@@ -1864,8 +1859,8 @@ class MapFrame(wx.Frame):
         """
         """
         # Reset comand and rendering options in render.Map. Always render decoration.
         # Reset comand and rendering options in render.Map. Always render decoration.
         # Showing/hiding handled by PseudoDC
         # Showing/hiding handled by PseudoDC
-        self.Map.ChangeOverlay(ovltype=type, type='overlay', name='', command=dcmd,
-                               l_active=True, l_render=False)
+        self.Map.ChangeOverlay(ovltype = type, type = 'overlay', name = '', command = dcmd,
+                               l_active = True, l_render = False)
         self.params[type] = params
         self.params[type] = params
         self.propwin[type] = propwin
         self.propwin[type] = propwin
 
 
@@ -1940,8 +1935,8 @@ class MapFrame(wx.Frame):
         self.PopupMenu(zoommenu)
         self.PopupMenu(zoommenu)
         zoommenu.Destroy()
         zoommenu.Destroy()
         
         
-    def SetProperties(self, render=False, mode=0, showCompExtent=False,
-                      constrainRes=False, projection=False):
+    def SetProperties(self, render = False, mode = 0, showCompExtent = False,
+                      constrainRes = False, projection = False):
         """!Set properies of map display window"""
         """!Set properies of map display window"""
         self.statusbarWin['render'].SetValue(render)
         self.statusbarWin['render'].SetValue(render)
         self.statusbarWin['toggle'].SetSelection(mode)
         self.statusbarWin['toggle'].SetSelection(mode)
@@ -1977,8 +1972,8 @@ class MapApp(wx.App):
         else:
         else:
             Map = None
             Map = None
 
 
-        self.mapFrm = MapFrame(parent=None, id=wx.ID_ANY, Map=Map,
-                               size=globalvar.MAP_WINDOW_SIZE)
+        self.mapFrm = MapFrame(parent = None, id = wx.ID_ANY, Map = Map,
+                               size = globalvar.MAP_WINDOW_SIZE)
         #self.SetTopWindow(Map)
         #self.SetTopWindow(Map)
         self.mapFrm.Show()
         self.mapFrm.Show()
 
 
@@ -2019,7 +2014,7 @@ if __name__ == "__main__":
     cmdfilename = sys.argv[2]
     cmdfilename = sys.argv[2]
 
 
     import gettext
     import gettext
-    gettext.install('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale'), unicode=True)
+    gettext.install('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale'), unicode = True)
 
 
     print >> sys.stderr, "\nStarting monitor <%s>...\n" % (title)
     print >> sys.stderr, "\nStarting monitor <%s>...\n" % (title)