Browse Source

wxGUI: cosmetics - coding style

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@44812 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 14 years ago
parent
commit
9b407e59a0
2 changed files with 249 additions and 256 deletions
  1. 171 176
      gui/wxpython/gui_modules/mapdisp_window.py
  2. 78 80
      gui/wxpython/gui_modules/toolbars.py

+ 171 - 176
gui/wxpython/gui_modules/mapdisp_window.py

@@ -7,7 +7,7 @@ Classes:
  - MapWindow
  - MapWindow
  - BufferedWindow
  - BufferedWindow
 
 
-(C) 2006-2009 by the GRASS Development Team
+(C) 2006-2010 by the GRASS Development Team
 This program is free software under the GNU General Public
 This program is free software under the GNU General Public
 License (>=v2). Read the file COPYING that comes with GRASS
 License (>=v2). Read the file COPYING that comes with GRASS
 for details.
 for details.
@@ -107,25 +107,25 @@ class MapWindow(object):
                     len(self.polycoords) > 0:
                     len(self.polycoords) > 0:
                 # for linear feature show segment and total length
                 # for linear feature show segment and total length
                 distance_seg = self.Distance(self.polycoords[-1],
                 distance_seg = self.Distance(self.polycoords[-1],
-                                             (e, n), screen=False)[0]
+                                             (e, n), screen = False)[0]
                 distance_tot = distance_seg
                 distance_tot = distance_seg
                 for idx in range(1, len(self.polycoords)):
                 for idx in range(1, len(self.polycoords)):
                     distance_tot += self.Distance(self.polycoords[idx-1],
                     distance_tot += self.Distance(self.polycoords[idx-1],
                                                   self.polycoords[idx],
                                                   self.polycoords[idx],
-                                                  screen=False )[0]
+                                                  screen = False)[0]
                 self.parent.statusbar.SetStatusText("%.*f, %.*f (seg: %.*f; tot: %.*f)" % \
                 self.parent.statusbar.SetStatusText("%.*f, %.*f (seg: %.*f; tot: %.*f)" % \
                                                  (precision, e, precision, n,
                                                  (precision, e, precision, n,
                                                   precision, distance_seg,
                                                   precision, distance_seg,
                                                   precision, distance_tot), 0)
                                                   precision, distance_tot), 0)
             else:
             else:
                 if self.parent.statusbarWin['projection'].IsChecked():
                 if self.parent.statusbarWin['projection'].IsChecked():
-                    if not UserSettings.Get(group='projection', key='statusbar', subkey='proj4'):
+                    if not UserSettings.Get(group = 'projection', key = 'statusbar', subkey = 'proj4'):
                         self.parent.statusbar.SetStatusText(_("Projection not defined (check the settings)"), 0)
                         self.parent.statusbar.SetStatusText(_("Projection not defined (check the settings)"), 0)
                     else:
                     else:
                         proj, coord  = utils.ReprojectCoordinates(coord = (e, n),
                         proj, coord  = utils.ReprojectCoordinates(coord = (e, n),
-                                                                  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:
@@ -279,10 +279,10 @@ class BufferedWindow(MapWindow, wx.Window):
 
 
         # zoom objects
         # zoom objects
         self.zoomhistory  = [] # list of past zoom extents
         self.zoomhistory  = [] # list of past zoom extents
-        self.currzoom     = 0 # current set of extents in zoom history being used
-        self.zoomtype     = 1   # 1 zoom in, 0 no zoom, -1 zoom out
+        self.currzoom     = 0  # current set of extents in zoom history being used
+        self.zoomtype     = 1  # 1 zoom in, 0 no zoom, -1 zoom out
         self.hitradius    = 10 # distance for selecting map decorations
         self.hitradius    = 10 # distance for selecting map decorations
-        self.dialogOffset = 5 # offset for dialog (e.g. DisplayAttributesDialog)
+        self.dialogOffset = 5  # offset for dialog (e.g. DisplayAttributesDialog)
 
 
         # OnSize called to make sure the buffer is initialized.
         # OnSize called to make sure the buffer is initialized.
         # This might result in OnSize getting called twice on some
         # This might result in OnSize getting called twice on some
@@ -342,9 +342,8 @@ class BufferedWindow(MapWindow, wx.Window):
         
         
         return True
         return True
     
     
-    def Draw(self, pdc, img=None, drawid=None, pdctype='image', coords=[0, 0, 0, 0]):
-        """!
-        Draws map and overlay decorations
+    def Draw(self, pdc, img = None, drawid = None, pdctype = 'image', coords = [0, 0, 0, 0]):
+        """!Draws map and overlay decorations
         """
         """
         if drawid == None:
         if drawid == None:
             if pdctype == 'image' and img:
             if pdctype == 'image' and img:
@@ -369,7 +368,7 @@ class BufferedWindow(MapWindow, wx.Window):
         
         
         ### pdc.Clear()
         ### pdc.Clear()
 
 
-        Debug.msg (5, "BufferedWindow.Draw(): id=%s, pdctype=%s, coord=%s" % \
+        Debug.msg (5, "BufferedWindow.Draw(): id=%s, pdctype = %s, coord=%s" % \
                        (drawid, pdctype, coords))
                        (drawid, pdctype, coords))
 
 
         # set PseudoDC id
         # set PseudoDC id
@@ -436,10 +435,10 @@ class BufferedWindow(MapWindow, wx.Window):
                         x,y = point
                         x,y = point
                         xlist.append(x)
                         xlist.append(x)
                         ylist.append(y)
                         ylist.append(y)
-                    x1=min(xlist)
-                    x2=max(xlist)
-                    y1=min(ylist)
-                    y2=max(ylist)
+                    x1 = min(xlist)
+                    x2 = max(xlist)
+                    y1 = min(ylist)
+                    y2 = max(ylist)
                     pdc.SetIdBounds(drawid, wx.Rect(x1,y1,x2,y2))
                     pdc.SetIdBounds(drawid, wx.Rect(x1,y1,x2,y2))
                     # self.ovlcoords[drawid] = [x1,y1,x2,y2]
                     # self.ovlcoords[drawid] = [x1,y1,x2,y2]
                     
                     
@@ -478,8 +477,7 @@ class BufferedWindow(MapWindow, wx.Window):
         return drawid
         return drawid
 
 
     def TextBounds(self, textinfo):
     def TextBounds(self, textinfo):
-        """!
-        Return text boundary data
+        """!Return text boundary data
 
 
         @param textinfo text metadata (text, font, color, rotation)
         @param textinfo text metadata (text, font, color, rotation)
         @param coords reference point
         @param coords reference point
@@ -653,7 +651,7 @@ class BufferedWindow(MapWindow, wx.Window):
         idle time instead of multiple times during resizing.
         idle time instead of multiple times during resizing.
         """
         """
         if self.resize:
         if self.resize:
-            self.UpdateMap(render=True)
+            self.UpdateMap(render = True)
 
 
         event.Skip()
         event.Skip()
 
 
@@ -666,13 +664,13 @@ class BufferedWindow(MapWindow, wx.Window):
         @param width image width
         @param width image width
         @param height image height
         @param height image height
         """
         """
-        busy = wx.BusyInfo(message=_("Please wait, exporting image..."),
-                           parent=self)
+        busy = wx.BusyInfo(message = _("Please wait, exporting image..."),
+                           parent = self)
         wx.Yield()
         wx.Yield()
         
         
         self.Map.ChangeMapSize((width, height))
         self.Map.ChangeMapSize((width, height))
         ibuffer = wx.EmptyBitmap(max(1, width), max(1, height))
         ibuffer = wx.EmptyBitmap(max(1, width), max(1, height))
-        self.Map.Render(force=True, windres = True)
+        self.Map.Render(force = True, windres = True)
         img = self.GetImage()
         img = self.GetImage()
         self.Draw(self.pdc, img, drawid = 99)
         self.Draw(self.pdc, img, drawid = 99)
         dc = wx.BufferedPaintDC(self, ibuffer)
         dc = wx.BufferedPaintDC(self, ibuffer)
@@ -697,7 +695,7 @@ class BufferedWindow(MapWindow, wx.Window):
         @return list of images
         @return list of images
         """
         """
         imgs = []
         imgs = []
-        for overlay in self.Map.GetListOfLayers(l_type="overlay", l_active=True):
+        for overlay in self.Map.GetListOfLayers(l_type = "overlay", l_active = True):
             if os.path.isfile(overlay.mapfile) and os.path.getsize(overlay.mapfile):
             if os.path.isfile(overlay.mapfile) and os.path.getsize(overlay.mapfile):
                 img = wx.Image(overlay.mapfile, wx.BITMAP_TYPE_ANY)
                 img = wx.Image(overlay.mapfile, wx.BITMAP_TYPE_ANY)
                 self.imagedict[img] = { 'id' : overlay.id,
                 self.imagedict[img] = { 'id' : overlay.id,
@@ -724,7 +722,7 @@ class BufferedWindow(MapWindow, wx.Window):
         
         
         return img
         return img
 
 
-    def UpdateMap(self, render=True, renderVector=True):
+    def UpdateMap(self, render = True, renderVector = True):
         """!
         """!
         Updates the canvas anytime there is a change to the
         Updates the canvas anytime there is a change to the
         underlaying images or to the geometry of the canvas.
         underlaying images or to the geometry of the canvas.
@@ -794,14 +792,14 @@ class BufferedWindow(MapWindow, wx.Window):
         # draw background map image to PseudoDC
         # draw background map image to PseudoDC
         #
         #
         if not self.img:
         if not self.img:
-            self.Draw(self.pdc, pdctype='clear')
+            self.Draw(self.pdc, pdctype = 'clear')
         else:
         else:
             try:
             try:
                 id = self.imagedict[self.img]['id']
                 id = self.imagedict[self.img]['id']
             except:
             except:
                 return False
                 return False
 
 
-            self.Draw(self.pdc, self.img, drawid=id)
+            self.Draw(self.pdc, self.img, drawid = id)
         
         
         #
         #
         # render vector map layer
         # render vector map layer
@@ -843,12 +841,12 @@ class BufferedWindow(MapWindow, wx.Window):
             # draw any active and defined overlays
             # draw any active and defined overlays
             if self.imagedict[img]['layer'].IsActive():
             if self.imagedict[img]['layer'].IsActive():
                 id = self.imagedict[img]['id']
                 id = self.imagedict[img]['id']
-                self.Draw(self.pdc, img=img, drawid=id,
-                          pdctype=self.overlays[id]['pdcType'], coords=self.overlays[id]['coords'])
+                self.Draw(self.pdc, img = img, drawid = id,
+                          pdctype = self.overlays[id]['pdcType'], coords = self.overlays[id]['coords'])
 
 
         for id in self.textdict.keys():
         for id in self.textdict.keys():
-            self.Draw(self.pdc, img=self.textdict[id], drawid=id,
-                      pdctype='text', coords=[10, 10, 10, 10])
+            self.Draw(self.pdc, img = self.textdict[id], drawid = id,
+                      pdctype = 'text', coords = [10, 10, 10, 10])
         
         
         # optionally draw computational extent box
         # optionally draw computational extent box
         self.DrawCompRegionExtent()
         self.DrawCompRegionExtent()
@@ -883,7 +881,7 @@ class BufferedWindow(MapWindow, wx.Window):
         # clear measurement
         # clear measurement
         #
         #
         if self.mouse["use"] == "measure":
         if self.mouse["use"] == "measure":
-            self.ClearLines(pdc=self.pdcTmp)
+            self.ClearLines(pdc = self.pdcTmp)
             self.polycoords = []
             self.polycoords = []
             self.mouse['use'] = 'pointer'
             self.mouse['use'] = 'pointer'
             self.mouse['box'] = 'point'
             self.mouse['box'] = 'point'
@@ -924,11 +922,11 @@ class BufferedWindow(MapWindow, wx.Window):
             dispReg = self.Map.GetCurrentRegion()
             dispReg = self.Map.GetCurrentRegion()
             reg = None
             reg = None
             if self.IsInRegion(dispReg, compReg):
             if self.IsInRegion(dispReg, compReg):
-                self.polypen = wx.Pen(colour=wx.Colour(0, 0, 255, 128), width=3, style=wx.SOLID)
+                self.polypen = wx.Pen(colour = wx.Colour(0, 0, 255, 128), width = 3, style = wx.SOLID)
                 reg = dispReg
                 reg = dispReg
             else:
             else:
-                self.polypen = wx.Pen(colour=wx.Colour(255, 0, 0, 128),
-                                      width=3, style=wx.SOLID)
+                self.polypen = wx.Pen(colour = wx.Colour(255, 0, 0, 128),
+                                      width = 3, style = wx.SOLID)
                 reg = compReg
                 reg = compReg
             
             
             self.regionCoords = []
             self.regionCoords = []
@@ -938,7 +936,7 @@ class BufferedWindow(MapWindow, wx.Window):
             self.regionCoords.append((reg['w'], reg['s']))
             self.regionCoords.append((reg['w'], reg['s']))
             self.regionCoords.append((reg['w'], reg['n']))
             self.regionCoords.append((reg['w'], reg['n']))
             # draw region extent
             # draw region extent
-            self.DrawLines(pdc=self.pdcDec, polycoords=self.regionCoords)
+            self.DrawLines(pdc = self.pdcDec, polycoords = self.regionCoords)
 
 
     def IsInRegion(self, region, refRegion):
     def IsInRegion(self, region, refRegion):
         """!
         """!
@@ -962,13 +960,13 @@ class BufferedWindow(MapWindow, wx.Window):
         """!
         """!
         Erase the canvas
         Erase the canvas
         """
         """
-        self.Draw(self.pdc, pdctype='clear')
+        self.Draw(self.pdc, pdctype = 'clear')
                   
                   
         if self.pdcVector:
         if self.pdcVector:
-            self.Draw(self.pdcVector, pdctype='clear')
+            self.Draw(self.pdcVector, pdctype = 'clear')
         
         
-        self.Draw(self.pdcDec, pdctype='clear')
-        self.Draw(self.pdcTmp, pdctype='clear')
+        self.Draw(self.pdcDec, pdctype = 'clear')
+        self.Draw(self.pdcTmp, pdctype = 'clear')
         
         
     def DragMap(self, moveto):
     def DragMap(self, moveto):
         """!
         """!
@@ -1019,7 +1017,7 @@ class BufferedWindow(MapWindow, wx.Window):
         self.RefreshRect(r, False)
         self.RefreshRect(r, False)
         self.lastpos = (event.GetX(), event.GetY())
         self.lastpos = (event.GetX(), event.GetY())
                 
                 
-    def MouseDraw(self, pdc=None, begin=None, end=None):
+    def MouseDraw(self, pdc = None, begin = None, end = None):
         """!
         """!
         Mouse box or line from 'begin' to 'end'
         Mouse box or line from 'begin' to 'end'
 
 
@@ -1054,15 +1052,15 @@ class BufferedWindow(MapWindow, wx.Window):
                 pass
                 pass
             self.RefreshRect(r, False)
             self.RefreshRect(r, False)
             pdc.SetId(boxid)
             pdc.SetId(boxid)
-            self.Draw(pdc, drawid=boxid, pdctype='box', coords=mousecoords)
+            self.Draw(pdc, drawid = boxid, pdctype = 'box', coords = mousecoords)
         elif self.mouse['box'] == "line" or self.mouse['box'] == 'point':
         elif self.mouse['box'] == "line" or self.mouse['box'] == 'point':
             self.lineid = wx.ID_NEW
             self.lineid = wx.ID_NEW
             mousecoords = [begin[0], begin[1], \
             mousecoords = [begin[0], begin[1], \
                            end[0], end[1]]
                            end[0], end[1]]
-            x1=min(begin[0],end[0])
-            x2=max(begin[0],end[0])
-            y1=min(begin[1],end[1])
-            y2=max(begin[1],end[1])
+            x1 = min(begin[0],end[0])
+            x2 = max(begin[0],end[0])
+            y1 = min(begin[1],end[1])
+            y2 = max(begin[1],end[1])
             r = wx.Rect(x1,y1,x2-x1,y2-y1)
             r = wx.Rect(x1,y1,x2-x1,y2-y1)
             r.Inflate(4,4)
             r.Inflate(4,4)
             try:
             try:
@@ -1071,9 +1069,9 @@ class BufferedWindow(MapWindow, wx.Window):
                 pass
                 pass
             self.RefreshRect(r, False)
             self.RefreshRect(r, False)
             pdc.SetId(self.lineid)
             pdc.SetId(self.lineid)
-            self.Draw(pdc, drawid=self.lineid, pdctype='line', coords=mousecoords)
+            self.Draw(pdc, drawid = self.lineid, pdctype = 'line', coords = mousecoords)
 
 
-    def DrawLines(self, pdc=None, polycoords=None):
+    def DrawLines(self, pdc = None, polycoords = None):
         """!
         """!
         Draw polyline in PseudoDC
         Draw polyline in PseudoDC
 
 
@@ -1096,7 +1094,7 @@ class BufferedWindow(MapWindow, wx.Window):
             for p in polycoords:
             for p in polycoords:
                 coords.append(self.Cell2Pixel(p))
                 coords.append(self.Cell2Pixel(p))
 
 
-            self.Draw(pdc, drawid=self.plineid, pdctype='polyline', coords=coords)
+            self.Draw(pdc, drawid = self.plineid, pdctype = 'polyline', coords = coords)
             
             
             Debug.msg (4, "BufferedWindow.DrawLines(): coords=%s, id=%s" % \
             Debug.msg (4, "BufferedWindow.DrawLines(): coords=%s, id=%s" % \
                            (coords, self.plineid))
                            (coords, self.plineid))
@@ -1105,8 +1103,8 @@ class BufferedWindow(MapWindow, wx.Window):
 
 
         return -1
         return -1
 
 
-    def DrawCross(self, pdc, coords, size, rotation=0,
-                  text=None, textAlign='lr', textOffset=(5, 5)):
+    def DrawCross(self, pdc, coords, size, rotation = 0,
+                  text = None, textAlign = 'lr', textOffset = (5, 5)):
         """!Draw cross in PseudoDC
         """!Draw cross in PseudoDC
 
 
         @todo implement rotation
         @todo implement rotation
@@ -1125,7 +1123,7 @@ class BufferedWindow(MapWindow, wx.Window):
 
 
         self.lineid = wx.NewId()
         self.lineid = wx.NewId()
         for lineCoords in coordsCross:
         for lineCoords in coordsCross:
-            self.Draw(pdc, drawid=self.lineid, pdctype='line', coords=lineCoords)
+            self.Draw(pdc, drawid = self.lineid, pdctype = 'line', coords = lineCoords)
 
 
         if not text:
         if not text:
             return self.lineid
             return self.lineid
@@ -1139,8 +1137,8 @@ class BufferedWindow(MapWindow, wx.Window):
         else:
         else:
             coord = [coords[0] - textOffset[0], coords[1] + textOffset[1], 0, 0]
             coord = [coords[0] - textOffset[0], coords[1] + textOffset[1], 0, 0]
         
         
-        self.Draw(pdc, img=text,
-                  pdctype='text', coords=coord)
+        self.Draw(pdc, img = text,
+                  pdctype = 'text', coords = coord)
 
 
         return self.lineid
         return self.lineid
 
 
@@ -1266,13 +1264,12 @@ class BufferedWindow(MapWindow, wx.Window):
                     digitToolbar.GetAction() in ("moveLine",) and 
                     digitToolbar.GetAction() in ("moveLine",) and 
                     digitClass.driver.GetSelected() > 0)):
                     digitClass.driver.GetSelected() > 0)):
                 # draw box only when left mouse button is pressed
                 # draw box only when left mouse button is pressed
-                self.MouseDraw(pdc=self.pdcTmp)
+                self.MouseDraw(pdc = self.pdcTmp)
         
         
         # event.Skip()
         # event.Skip()
 
 
     def OnLeftDownVDigitAddLine(self, event):
     def OnLeftDownVDigitAddLine(self, event):
-        """!
-        Left mouse button down - vector digitizer add new line
+        """!Left mouse button down - vector digitizer add new line
         action
         action
         """
         """
         digitToolbar = self.parent.toolbars['vdigit']
         digitToolbar = self.parent.toolbars['vdigit']
@@ -1295,23 +1292,23 @@ class BufferedWindow(MapWindow, wx.Window):
             if fid < 0:
             if fid < 0:
                 return
                 return
 
 
-            self.UpdateMap(render=False) # redraw map
+            self.UpdateMap(render = False) # redraw map
             
             
             # add new record into atribute table
             # add new record into atribute table
-            if UserSettings.Get(group='vdigit', key="addRecord", subkey='enabled')  is True:
+            if UserSettings.Get(group = 'vdigit', key = "addRecord", subkey = 'enabled')  is True:
                 # select attributes based on layer and category
                 # select attributes based on layer and category
                 cats = { fid : {
                 cats = { fid : {
-                        UserSettings.Get(group='vdigit', key="layer", subkey='value') :
-                            (UserSettings.Get(group='vdigit', key="category", subkey='value'), )
+                        UserSettings.Get(group = 'vdigit', key = "layer", subkey = 'value') :
+                            (UserSettings.Get(group = 'vdigit', key = "category", subkey = 'value'), )
                         }}
                         }}
                 
                 
                 posWindow = self.ClientToScreen((self.mouse['end'][0] + self.dialogOffset,
                 posWindow = self.ClientToScreen((self.mouse['end'][0] + self.dialogOffset,
                                                  self.mouse['end'][1] + self.dialogOffset))
                                                  self.mouse['end'][1] + self.dialogOffset))
                 
                 
-                addRecordDlg = dbm_dialogs.DisplayAttributesDialog(parent=self, map=mapLayer,
-                                                                   cats=cats,
-                                                                   pos=posWindow,
-                                                                   action="add")
+                addRecordDlg = dbm_dialogs.DisplayAttributesDialog(parent = self, map = mapLayer,
+                                                                   cats = cats,
+                                                                   pos = posWindow,
+                                                                   action = "add")
 
 
                 if not point:
                 if not point:
                     self.__geomAttrb(fid, addRecordDlg, 'area', digitClass,
                     self.__geomAttrb(fid, addRecordDlg, 'area', digitClass,
@@ -1321,7 +1318,7 @@ class BufferedWindow(MapWindow, wx.Window):
 
 
                 if addRecordDlg.mapDBInfo and \
                 if addRecordDlg.mapDBInfo and \
                         addRecordDlg.ShowModal() == wx.ID_OK:
                         addRecordDlg.ShowModal() == wx.ID_OK:
-                    sqlfile = tempfile.NamedTemporaryFile(mode="w")
+                    sqlfile = tempfile.NamedTemporaryFile(mode = "w")
                     for sql in addRecordDlg.GetSQLString():
                     for sql in addRecordDlg.GetSQLString():
                         sqlfile.file.write(sql + ";\n")
                         sqlfile.file.write(sql + ";\n")
                     sqlfile.file.flush()
                     sqlfile.file.flush()
@@ -1337,7 +1334,7 @@ class BufferedWindow(MapWindow, wx.Window):
         elif digitToolbar.GetAction('type') in ["line", "boundary"]:
         elif digitToolbar.GetAction('type') in ["line", "boundary"]:
             # add new point to the line
             # add new point to the line
             self.polycoords.append(self.Pixel2Cell(event.GetPositionTuple()[:]))
             self.polycoords.append(self.Pixel2Cell(event.GetPositionTuple()[:]))
-            self.DrawLines(pdc=self.pdcTmp)
+            self.DrawLines(pdc = self.pdcTmp)
     
     
     def __geomAttrb(self, fid, dialog, attrb, digit, mapLayer):
     def __geomAttrb(self, fid, dialog, attrb, digit, mapLayer):
         """!Trac geometry attributes?"""
         """!Trac geometry attributes?"""
@@ -1358,7 +1355,7 @@ class BufferedWindow(MapWindow, wx.Window):
                 type = 'length'
                 type = 'length'
             
             
             if val > 0:
             if val > 0:
-                layer = int(UserSettings.Get(group='vdigit', key="layer", subkey='value'))
+                layer = int(UserSettings.Get(group = 'vdigit', key = "layer", subkey = 'value'))
                 column = vdigit['geomAttr'][attrb]['column']
                 column = vdigit['geomAttr'][attrb]['column']
                 val = UnitsConvertValue(val, type, vdigit['geomAttr'][attrb]['units'])
                 val = UnitsConvertValue(val, type, vdigit['geomAttr'][attrb]['units'])
                 dialog.SetColumnValue(layer, column, val)
                 dialog.SetColumnValue(layer, column, val)
@@ -1379,7 +1376,7 @@ class BufferedWindow(MapWindow, wx.Window):
             return
             return
         
         
         dbInfo = gselect.VectorDBInfo(vectorName)
         dbInfo = gselect.VectorDBInfo(vectorName)
-        sqlfile = tempfile.NamedTemporaryFile(mode="w")
+        sqlfile = tempfile.NamedTemporaryFile(mode = "w")
         for fid in fids:
         for fid in fids:
             for layer, cats in digit.GetLineCats(fid).iteritems():
             for layer, cats in digit.GetLineCats(fid).iteritems():
                 table = dbInfo.GetTable(layer)
                 table = dbInfo.GetTable(layer)
@@ -1421,7 +1418,7 @@ class BufferedWindow(MapWindow, wx.Window):
         for atm in self.lmgr.dialogs['atm']:
         for atm in self.lmgr.dialogs['atm']:
             atmVector = atm.GetVectorName()
             atmVector = atm.GetVectorName()
             if atmVector == digitVector:
             if atmVector == digitVector:
-                layer = UserSettings.Get(group='vdigit', key="layer", subkey='value')
+                layer = UserSettings.Get(group = 'vdigit', key = "layer", subkey = 'value')
                 # TODO: use AddDataRow instead
                 # TODO: use AddDataRow instead
                 atm.LoadData(layer)
                 atm.LoadData(layer)
         
         
@@ -1435,7 +1432,7 @@ class BufferedWindow(MapWindow, wx.Window):
         
         
         self.polycoords.append(self.Pixel2Cell(self.mouse['begin']))
         self.polycoords.append(self.Pixel2Cell(self.mouse['begin']))
         self.vdigitMove['id'].append(wx.NewId())
         self.vdigitMove['id'].append(wx.NewId())
-        self.DrawLines(pdc=self.pdcTmp)
+        self.DrawLines(pdc = self.pdcTmp)
 
 
     def OnLeftDownVDigitMoveLine(self, event):
     def OnLeftDownVDigitMoveLine(self, event):
         """!
         """!
@@ -1455,10 +1452,10 @@ class BufferedWindow(MapWindow, wx.Window):
                 
                 
         if digitToolbar.GetAction() in ["moveVertex", "editLine"]:
         if digitToolbar.GetAction() in ["moveVertex", "editLine"]:
             # set pen
             # set pen
-            pcolor = UserSettings.Get(group='vdigit', key="symbol",
-                                      subkey=["highlight", "color"])
-            self.pen = self.polypen = wx.Pen(colour=pcolor,
-                                             width=2, style=wx.SHORT_DASH)
+            pcolor = UserSettings.Get(group = 'vdigit', key = "symbol",
+                                      subkey = ["highlight", "color"])
+            self.pen = self.polypen = wx.Pen(colour = pcolor,
+                                             width = 2, style = wx.SHORT_DASH)
             self.pdcTmp.SetPen(self.polypen)
             self.pdcTmp.SetPen(self.polypen)
 
 
     def OnLeftDownVDigitDisplayCA(self, event):
     def OnLeftDownVDigitDisplayCA(self, event):
@@ -1485,8 +1482,8 @@ class BufferedWindow(MapWindow, wx.Window):
                                                digitClass.GetSelectType()) is None:
                                                digitClass.GetSelectType()) is None:
             return
             return
 
 
-        if UserSettings.Get(group='vdigit', key='checkForDupl',
-                            subkey='enabled'):
+        if UserSettings.Get(group = 'vdigit', key = 'checkForDupl',
+                            subkey = 'enabled'):
             lines = digitClass.driver.GetSelected()
             lines = digitClass.driver.GetSelected()
         else:
         else:
             lines = (digitClass.driver.GetSelected()[0],) # only first found
             lines = (digitClass.driver.GetSelected()[0],) # only first found
@@ -1501,12 +1498,12 @@ class BufferedWindow(MapWindow, wx.Window):
             # select attributes based on coordinates (all layers)
             # select attributes based on coordinates (all layers)
             if self.parent.dialogs['attributes'] is None:
             if self.parent.dialogs['attributes'] is None:
                 self.parent.dialogs['attributes'] = \
                 self.parent.dialogs['attributes'] = \
-                    dbm_dialogs.DisplayAttributesDialog(parent=self, map=mapLayer,
-                                                        cats=cats,
-                                                        action="update")
+                    dbm_dialogs.DisplayAttributesDialog(parent = self, map = mapLayer,
+                                                        cats = cats,
+                                                        action = "update")
             else:
             else:
                 # upgrade dialog
                 # upgrade dialog
-                self.parent.dialogs['attributes'].UpdateDialog(cats=cats)
+                self.parent.dialogs['attributes'].UpdateDialog(cats = cats)
 
 
             if self.parent.dialogs['attributes']:
             if self.parent.dialogs['attributes']:
                 if len(cats.keys()) > 0:
                 if len(cats.keys()) > 0:
@@ -1521,15 +1518,15 @@ class BufferedWindow(MapWindow, wx.Window):
         else: # displayCats
         else: # displayCats
             if self.parent.dialogs['category'] is None:
             if self.parent.dialogs['category'] is None:
                 # open new dialog
                 # open new dialog
-                dlg = VDigitCategoryDialog(parent=self,
-                                           map=mapLayer,
-                                           cats=cats,
-                                           pos=posWindow,
-                                           title=_("Update categories"))
+                dlg = VDigitCategoryDialog(parent = self,
+                                           map = mapLayer,
+                                           cats = cats,
+                                           pos = posWindow,
+                                           title = _("Update categories"))
                 self.parent.dialogs['category'] = dlg
                 self.parent.dialogs['category'] = dlg
             else:
             else:
                 # update currently open dialog
                 # update currently open dialog
-                self.parent.dialogs['category'].UpdateDialog(cats=cats)
+                self.parent.dialogs['category'].UpdateDialog(cats = cats)
                             
                             
             if self.parent.dialogs['category']:
             if self.parent.dialogs['category']:
                 if len(cats.keys()) > 0:
                 if len(cats.keys()) > 0:
@@ -1540,7 +1537,7 @@ class BufferedWindow(MapWindow, wx.Window):
                     if self.parent.dialogs['category'].IsShown():
                     if self.parent.dialogs['category'].IsShown():
                         self.parent.dialogs['category'].Hide()
                         self.parent.dialogs['category'].Hide()
                 
                 
-        self.UpdateMap(render=False)
+        self.UpdateMap(render = False)
  
  
     def OnLeftDownVDigitCopyCA(self, event):
     def OnLeftDownVDigitCopyCA(self, event):
         """!
         """!
@@ -1568,8 +1565,7 @@ class BufferedWindow(MapWindow, wx.Window):
             self.layerTmp = None
             self.layerTmp = None
         
         
     def OnLeftDownVDigitBulkLine(self, event):
     def OnLeftDownVDigitBulkLine(self, event):
-        """!
-        Left mouse button down - vector digitizer label 3d vector
+        """!Left mouse button down - vector digitizer label 3d vector
         lines
         lines
         """
         """
         digitToolbar = self.parent.toolbars['vdigit']
         digitToolbar = self.parent.toolbars['vdigit']
@@ -1577,7 +1573,7 @@ class BufferedWindow(MapWindow, wx.Window):
         
         
         if len(self.polycoords) > 1: # start new line
         if len(self.polycoords) > 1: # start new line
             self.polycoords = []
             self.polycoords = []
-            self.ClearLines(pdc=self.pdcTmp)
+            self.ClearLines(pdc = self.pdcTmp)
         self.polycoords.append(self.Pixel2Cell(event.GetPositionTuple()[:]))
         self.polycoords.append(self.Pixel2Cell(event.GetPositionTuple()[:]))
         if len(self.polycoords) == 1:
         if len(self.polycoords) == 1:
             begin = self.Pixel2Cell(self.polycoords[-1])
             begin = self.Pixel2Cell(self.polycoords[-1])
@@ -1619,10 +1615,10 @@ class BufferedWindow(MapWindow, wx.Window):
             try:
             try:
                 mapLayer = digitToolbar.GetLayer().GetName()
                 mapLayer = digitToolbar.GetLayer().GetName()
             except:
             except:
-                wx.MessageBox(parent=self,
-                              message=_("No vector map selected for editing."),
-                              caption=_("Vector digitizer"),
-                              style=wx.OK | wx.ICON_INFORMATION | wx.CENTRE)
+                wx.MessageBox(parent = self,
+                              message = _("No vector map selected for editing."),
+                              caption = _("Vector digitizer"),
+                              style = wx.OK | wx.ICON_INFORMATION | wx.CENTRE)
                 event.Skip()
                 event.Skip()
                 return
                 return
             
             
@@ -1631,8 +1627,8 @@ class BufferedWindow(MapWindow, wx.Window):
                                                 "removeVertex",
                                                 "removeVertex",
                                                 "editLine"):
                                                 "editLine"):
                 # set pen
                 # set pen
-                self.pen = wx.Pen(colour='Red', width=2, style=wx.SHORT_DASH)
-                self.polypen = wx.Pen(colour='dark green', width=2, style=wx.SOLID)
+                self.pen = wx.Pen(colour = 'Red', width = 2, style = wx.SHORT_DASH)
+                self.polypen = wx.Pen(colour = 'dark green', width = 2, style = wx.SOLID)
 
 
             if digitToolbar.GetAction() in ("addVertex",
             if digitToolbar.GetAction() in ("addVertex",
                                             "removeVertex",
                                             "removeVertex",
@@ -1698,7 +1694,7 @@ class BufferedWindow(MapWindow, wx.Window):
         if digitToolbar.GetAction() in ("moveVertex",
         if digitToolbar.GetAction() in ("moveVertex",
                                         "editLine"):
                                         "editLine"):
             if len(digitClass.driver.GetSelected()) == 0:
             if len(digitClass.driver.GetSelected()) == 0:
-                nselected = digitClass.driver.SelectLineByPoint(pos1, type=VDigit_Lines_Type)
+                nselected = digitClass.driver.SelectLineByPoint(pos1, type = VDigit_Lines_Type)
                 
                 
                 if digitToolbar.GetAction() == "editLine":
                 if digitToolbar.GetAction() == "editLine":
                     try:
                     try:
@@ -1708,7 +1704,7 @@ class BufferedWindow(MapWindow, wx.Window):
                         
                         
                     if selVertex:
                     if selVertex:
                         # self.UpdateMap(render=False)
                         # self.UpdateMap(render=False)
-                        ids = digitClass.driver.GetSelected(grassId=False)
+                        ids = digitClass.driver.GetSelected(grassId = False)
                         # move this line to tmp layer
                         # move this line to tmp layer
                         self.polycoords = []
                         self.polycoords = []
                         for id in ids:
                         for id in ids:
@@ -1726,7 +1722,7 @@ class BufferedWindow(MapWindow, wx.Window):
                         digitClass.driver.SetSelected([])
                         digitClass.driver.SetSelected([])
                         del self.vdigitMove
                         del self.vdigitMove
                 
                 
-                    self.UpdateMap(render=False)
+                    self.UpdateMap(render = False)
             
             
         elif digitToolbar.GetAction() in ("copyCats",
         elif digitToolbar.GetAction() in ("copyCats",
                                           "copyAttrs"):
                                           "copyAttrs"):
@@ -1781,7 +1777,7 @@ class BufferedWindow(MapWindow, wx.Window):
                 # get pseudoDC id of objects which should be redrawn
                 # get pseudoDC id of objects which should be redrawn
                 if digitToolbar.GetAction() == "moveLine":
                 if digitToolbar.GetAction() == "moveLine":
                     # -> move line
                     # -> move line
-                    self.vdigitMove['id'] = digitClass.driver.GetSelected(grassId=False)
+                    self.vdigitMove['id'] = digitClass.driver.GetSelected(grassId = False)
                     self.vdigitMove['coord'] = digitClass.driver.GetSelectedCoord()
                     self.vdigitMove['coord'] = digitClass.driver.GetSelectedCoord()
                 else: # moveVertex
                 else: # moveVertex
                     self.vdigitMove['id'] = digitClass.driver.GetSelectedVertex(pos1)
                     self.vdigitMove['id'] = digitClass.driver.GetSelectedVertex(pos1)
@@ -1791,31 +1787,31 @@ class BufferedWindow(MapWindow, wx.Window):
             #
             #
             # check for duplicates
             # check for duplicates
             #
             #
-            if UserSettings.Get(group='vdigit', key='checkForDupl', subkey='enabled') is True:
+            if UserSettings.Get(group = 'vdigit', key = 'checkForDupl', subkey = 'enabled') is True:
                 dupl = digitClass.driver.GetDuplicates()
                 dupl = digitClass.driver.GetDuplicates()
-                self.UpdateMap(render=False)
+                self.UpdateMap(render = False)
                     
                     
                 if dupl:
                 if dupl:
                     posWindow = self.ClientToScreen((self.mouse['end'][0] + self.dialogOffset,
                     posWindow = self.ClientToScreen((self.mouse['end'][0] + self.dialogOffset,
                                                      self.mouse['end'][1] + self.dialogOffset))
                                                      self.mouse['end'][1] + self.dialogOffset))
                     
                     
-                    dlg = VDigitDuplicatesDialog(parent=self, data=dupl, pos=posWindow)
+                    dlg = VDigitDuplicatesDialog(parent = self, data = dupl, pos = posWindow)
                     
                     
                     if dlg.ShowModal() == wx.ID_OK:
                     if dlg.ShowModal() == wx.ID_OK:
                         digitClass.driver.UnSelect(dlg.GetUnSelected())
                         digitClass.driver.UnSelect(dlg.GetUnSelected())
                         # update selected
                         # update selected
-                        self.UpdateMap(render=False)
+                        self.UpdateMap(render = False)
                 
                 
             if digitToolbar.GetAction() != "editLine":
             if digitToolbar.GetAction() != "editLine":
                 # -> move line || move vertex
                 # -> move line || move vertex
-                self.UpdateMap(render=False)
+                self.UpdateMap(render = False)
         
         
         else: # no vector object found
         else: # no vector object found
             if not (digitToolbar.GetAction() in ("moveLine",
             if not (digitToolbar.GetAction() in ("moveLine",
                                                  "moveVertex") and \
                                                  "moveVertex") and \
                         len(self.vdigitMove['id']) > 0):
                         len(self.vdigitMove['id']) > 0):
                 # avoid left-click when features are already selected
                 # avoid left-click when features are already selected
-                self.UpdateMap(render=False, renderVector=False)
+                self.UpdateMap(render = False, renderVector = False)
         
         
     def OnLeftUpVDigitModifyLine(self, event):
     def OnLeftUpVDigitModifyLine(self, event):
         """!
         """!
@@ -1828,15 +1824,15 @@ class BufferedWindow(MapWindow, wx.Window):
         pos1 = self.Pixel2Cell(self.mouse['begin'])
         pos1 = self.Pixel2Cell(self.mouse['begin'])
         
         
         pointOnLine = digitClass.driver.SelectLineByPoint(pos1,
         pointOnLine = digitClass.driver.SelectLineByPoint(pos1,
-                                                          type=VDigit_Lines_Type)
+                                                          type = VDigit_Lines_Type)
 
 
         if not pointOnLine:
         if not pointOnLine:
             return
             return
 
 
         if digitToolbar.GetAction() in ["splitLine", "addVertex"]:
         if digitToolbar.GetAction() in ["splitLine", "addVertex"]:
-            self.UpdateMap(render=False) # highlight object
-            self.DrawCross(pdc=self.pdcTmp, coords=self.Cell2Pixel(pointOnLine),
-                           size=5)
+            self.UpdateMap(render = False) # highlight object
+            self.DrawCross(pdc = self.pdcTmp, coords = self.Cell2Pixel(pointOnLine),
+                           size = 5)
         else: # removeVertex
         else: # removeVertex
             # get only id of vertex
             # get only id of vertex
             try:
             try:
@@ -1847,13 +1843,13 @@ class BufferedWindow(MapWindow, wx.Window):
             if id:
             if id:
                 x, y = self.pdcVector.GetIdBounds(id)[0:2]
                 x, y = self.pdcVector.GetIdBounds(id)[0:2]
                 self.pdcVector.RemoveId(id)
                 self.pdcVector.RemoveId(id)
-                self.UpdateMap(render=False) # highlight object
-                self.DrawCross(pdc=self.pdcTmp, coords=(x, y),
-                               size=5)
+                self.UpdateMap(render = False) # highlight object
+                self.DrawCross(pdc = self.pdcTmp, coords = (x, y),
+                               size = 5)
             else:
             else:
                 # unselect
                 # unselect
                 digitClass.driver.SetSelected([])
                 digitClass.driver.SetSelected([])
-                self.UpdateMap(render=False)
+                self.UpdateMap(render = False)
 
 
     def OnLeftUpVDigitCopyLine(self, event):
     def OnLeftUpVDigitCopyLine(self, event):
         """!
         """!
@@ -1865,29 +1861,29 @@ class BufferedWindow(MapWindow, wx.Window):
         pos1 = self.Pixel2Cell(self.mouse['begin'])
         pos1 = self.Pixel2Cell(self.mouse['begin'])
         pos2 = self.Pixel2Cell(self.mouse['end'])
         pos2 = self.Pixel2Cell(self.mouse['end'])
         
         
-        if UserSettings.Get(group='vdigit', key='bgmap',
-                            subkey='value', internal=True) == '':
+        if UserSettings.Get(group = 'vdigit', key = 'bgmap',
+                            subkey = 'value', internal = True) == '':
             # no background map -> copy from current vector map layer
             # no background map -> copy from current vector map layer
             nselected = digitClass.driver.SelectLinesByBox(pos1, pos2,
             nselected = digitClass.driver.SelectLinesByBox(pos1, pos2,
                                                            digitClass.GetSelectType())
                                                            digitClass.GetSelectType())
 
 
             if nselected > 0:
             if nselected > 0:
                 # highlight selected features
                 # highlight selected features
-                self.UpdateMap(render=False)
+                self.UpdateMap(render = False)
             else:
             else:
-                self.UpdateMap(render=False, renderVector=False)
+                self.UpdateMap(render = False, renderVector = False)
         else:
         else:
             # copy features from background map
             # copy features from background map
             self.copyIds += digitClass.SelectLinesFromBackgroundMap(pos1, pos2)
             self.copyIds += digitClass.SelectLinesFromBackgroundMap(pos1, pos2)
             if len(self.copyIds) > 0:
             if len(self.copyIds) > 0:
-                color = UserSettings.Get(group='vdigit', key='symbol',
-                                         subkey=['highlight', 'color'])
+                color = UserSettings.Get(group = 'vdigit', key = 'symbol',
+                                         subkey = ['highlight', 'color'])
                 colorStr = str(color[0]) + ":" + \
                 colorStr = str(color[0]) + ":" + \
                     str(color[1]) + ":" + \
                     str(color[1]) + ":" + \
                     str(color[2])
                     str(color[2])
                 dVectTmp = ['d.vect',
                 dVectTmp = ['d.vect',
-                            'map=%s' % UserSettings.Get(group='vdigit', key='bgmap',
-                                                        subkey='value', internal=True),
+                            'map=%s' % UserSettings.Get(group = 'vdigit', key = 'bgmap',
+                                                        subkey = 'value', internal = True),
                             'cats=%s' % utils.ListOfCatsToRange(self.copyIds),
                             'cats=%s' % utils.ListOfCatsToRange(self.copyIds),
                             '-i',
                             '-i',
                             'color=%s' % colorStr,
                             'color=%s' % colorStr,
@@ -1896,15 +1892,15 @@ class BufferedWindow(MapWindow, wx.Window):
                             'width=2']
                             'width=2']
                         
                         
                 if not self.layerTmp:
                 if not self.layerTmp:
-                    self.layerTmp = self.Map.AddLayer(type='vector',
-                                                      name=globalvar.QUERYLAYER,
-                                                      command=dVectTmp)
+                    self.layerTmp = self.Map.AddLayer(type = 'vector',
+                                                      name = globalvar.QUERYLAYER,
+                                                      command = dVectTmp)
                 else:
                 else:
                     self.layerTmp.SetCmd(dVectTmp)
                     self.layerTmp.SetCmd(dVectTmp)
                 
                 
-                self.UpdateMap(render=True, renderVector=False)
+                self.UpdateMap(render = True, renderVector = False)
             else:
             else:
-                self.UpdateMap(render=False, renderVector=False)
+                self.UpdateMap(render = False, renderVector = False)
             
             
             self.redrawAll = None
             self.redrawAll = None
             
             
@@ -1923,10 +1919,10 @@ class BufferedWindow(MapWindow, wx.Window):
 
 
         if nselected > 0:
         if nselected > 0:
             # highlight selected features
             # highlight selected features
-            self.UpdateMap(render=False)
-            self.DrawLines(pdc=self.pdcTmp) # redraw temp line
+            self.UpdateMap(render = False)
+            self.DrawLines(pdc = self.pdcTmp) # redraw temp line
         else:
         else:
-            self.UpdateMap(render=False, renderVector=False)
+            self.UpdateMap(render = False, renderVector = False)
 
 
     def OnLeftUpVDigitConnectLine(self, event):
     def OnLeftUpVDigitConnectLine(self, event):
         """!
         """!
@@ -1936,7 +1932,7 @@ class BufferedWindow(MapWindow, wx.Window):
         digitClass   = self.parent.digit
         digitClass   = self.parent.digit
         
         
         if len(digitClass.driver.GetSelected()) > 0:
         if len(digitClass.driver.GetSelected()) > 0:
-            self.UpdateMap(render=False)
+            self.UpdateMap(render = False)
         
         
     def OnLeftUp(self, event):
     def OnLeftUp(self, event):
         """!Left mouse button released
         """!Left mouse button released
@@ -1964,7 +1960,7 @@ class BufferedWindow(MapWindow, wx.Window):
             self.Zoom(begin, end, self.zoomtype)
             self.Zoom(begin, end, self.zoomtype)
 
 
             # redraw map
             # redraw map
-            self.UpdateMap(render=True)
+            self.UpdateMap(render = True)
 
 
             # update statusbar
             # update statusbar
             self.parent.StatusbarUpdate()
             self.parent.StatusbarUpdate()
@@ -1978,7 +1974,7 @@ class BufferedWindow(MapWindow, wx.Window):
             self.parent.QueryVector(self.mouse['begin'][0], self.mouse['begin'][1])
             self.parent.QueryVector(self.mouse['begin'][0], self.mouse['begin'][1])
 
 
             # clear temp canvas
             # clear temp canvas
-            self.UpdateMap(render=False, renderVector=False)
+            self.UpdateMap(render = False, renderVector = False)
             
             
         elif self.mouse["use"] in ["measure", "profile"]:
         elif self.mouse["use"] in ["measure", "profile"]:
             # measure or profile
             # measure or profile
@@ -1986,8 +1982,8 @@ class BufferedWindow(MapWindow, wx.Window):
                 self.parent.MeasureDist(self.mouse['begin'], self.mouse['end'])
                 self.parent.MeasureDist(self.mouse['begin'], self.mouse['end'])
 
 
             self.polycoords.append(self.Pixel2Cell(self.mouse['end']))
             self.polycoords.append(self.Pixel2Cell(self.mouse['end']))
-            self.ClearLines(pdc=self.pdcTmp)
-            self.DrawLines(pdc=self.pdcTmp)
+            self.ClearLines(pdc = self.pdcTmp)
+            self.DrawLines(pdc = self.pdcTmp)
         
         
         elif self.mouse["use"] == "pointer" and \
         elif self.mouse["use"] == "pointer" and \
                 self.parent.GetLayerManager().gcpmanagement:
                 self.parent.GetLayerManager().gcpmanagement:
@@ -1999,8 +1995,8 @@ class BufferedWindow(MapWindow, wx.Window):
                 else:
                 else:
                     coordtype = 'target'
                     coordtype = 'target'
 
 
-                self.parent.GetLayerManager().gcpmanagement.SetGCPData(coordtype, coord, self, confirm=True)
-                self.UpdateMap(render=False, renderVector=False)
+                self.parent.GetLayerManager().gcpmanagement.SetGCPData(coordtype, coord, self, confirm = True)
+                self.UpdateMap(render = False, renderVector = False)
 
 
         elif self.mouse["use"] == "pointer" and \
         elif self.mouse["use"] == "pointer" and \
                 self.parent.GetLayerManager().georectifying:
                 self.parent.GetLayerManager().georectifying:
@@ -2012,7 +2008,7 @@ class BufferedWindow(MapWindow, wx.Window):
                 coordtype = 'mapcoord'
                 coordtype = 'mapcoord'
 
 
             self.parent.GetLayerManager().georectifying.SetGCPData(coordtype, coord, self)
             self.parent.GetLayerManager().georectifying.SetGCPData(coordtype, coord, self)
-            self.UpdateMap(render=False, renderVector=False)
+            self.UpdateMap(render = False, renderVector = False)
 
 
         elif self.mouse["use"] == "pointer" and self.parent.toolbars['vdigit']:
         elif self.mouse["use"] == "pointer" and self.parent.toolbars['vdigit']:
             # digitization tool active
             # digitization tool active
@@ -2169,9 +2165,9 @@ class BufferedWindow(MapWindow, wx.Window):
                     map = digitToolbar.GetLayer().GetName()
                     map = digitToolbar.GetLayer().GetName()
                 except:
                 except:
                     map = None
                     map = None
-                    wx.MessageBox(parent=self,
-                                  message=_("No vector map selected for editing."),
-                                  caption=_("Error"), style=wx.OK | wx.ICON_ERROR | wx.CENTRE)
+                    wx.MessageBox(parent = self,
+                                  message = _("No vector map selected for editing."),
+                                  caption = _("Error"), style = wx.OK | wx.ICON_ERROR | wx.CENTRE)
                     
                     
                 if map:
                 if map:
                     # mapcoords = []
                     # mapcoords = []
@@ -2192,12 +2188,12 @@ class BufferedWindow(MapWindow, wx.Window):
                     
                     
                     position = self.Cell2Pixel(self.polycoords[-1])
                     position = self.Cell2Pixel(self.polycoords[-1])
                     self.polycoords = []
                     self.polycoords = []
-                    self.UpdateMap(render=False)
+                    self.UpdateMap(render = False)
                     self.redrawAll = True
                     self.redrawAll = True
                     self.Refresh()
                     self.Refresh()
                     
                     
                     # add new record into atribute table
                     # add new record into atribute table
-                    if UserSettings.Get(group='vdigit', key="addRecord", subkey='enabled') and \
+                    if UserSettings.Get(group = 'vdigit', key = "addRecord", subkey = 'enabled') and \
                             (line is True or \
                             (line is True or \
                                  (not line and fid > 0)):
                                  (not line and fid > 0)):
                         posWindow = self.ClientToScreen((position[0] + self.dialogOffset,
                         posWindow = self.ClientToScreen((position[0] + self.dialogOffset,
@@ -2205,14 +2201,14 @@ class BufferedWindow(MapWindow, wx.Window):
 
 
                         # select attributes based on layer and category
                         # select attributes based on layer and category
                         cats = { fid : {
                         cats = { fid : {
-                                UserSettings.Get(group='vdigit', key="layer", subkey='value') :
-                                    (UserSettings.Get(group='vdigit', key="category", subkey='value'), )
+                                UserSettings.Get(group = 'vdigit', key = "layer", subkey = 'value') :
+                                    (UserSettings.Get(group = 'vdigit', key = "category", subkey = 'value'), )
                                 }}
                                 }}
                         
                         
-                        addRecordDlg = dbm_dialogs.DisplayAttributesDialog(parent=self, map=map,
-                                                                           cats=cats,
-                                                                           pos=posWindow,
-                                                                           action="add")
+                        addRecordDlg = dbm_dialogs.DisplayAttributesDialog(parent = self, map = map,
+                                                                           cats = cats,
+                                                                           pos = posWindow,
+                                                                           action = "add")
 
 
                         self.__geomAttrb(fid, addRecordDlg, 'length', digitClass,
                         self.__geomAttrb(fid, addRecordDlg, 'length', digitClass,
                                          digitToolbar.GetLayer())
                                          digitToolbar.GetLayer())
@@ -2224,7 +2220,7 @@ class BufferedWindow(MapWindow, wx.Window):
 
 
                         if addRecordDlg.mapDBInfo and \
                         if addRecordDlg.mapDBInfo and \
                                addRecordDlg.ShowModal() == wx.ID_OK:
                                addRecordDlg.ShowModal() == wx.ID_OK:
-                            sqlfile = tempfile.NamedTemporaryFile(mode="w")
+                            sqlfile = tempfile.NamedTemporaryFile(mode = "w")
                             for sql in addRecordDlg.GetSQLString():
                             for sql in addRecordDlg.GetSQLString():
                                 sqlfile.file.write(sql + ";\n")
                                 sqlfile.file.write(sql + ";\n")
                             sqlfile.file.flush()
                             sqlfile.file.flush()
@@ -2260,11 +2256,11 @@ class BufferedWindow(MapWindow, wx.Window):
                 try:
                 try:
                     if digitToolbar.GetAction() == 'copyCats':
                     if digitToolbar.GetAction() == 'copyCats':
                         if digitClass.CopyCats(self.copyCatsList,
                         if digitClass.CopyCats(self.copyCatsList,
-                                               self.copyCatsIds, copyAttrb=False) < 0:
+                                               self.copyCatsIds, copyAttrb = False) < 0:
                             return
                             return
                     else:
                     else:
                         if digitClass.CopyCats(self.copyCatsList,
                         if digitClass.CopyCats(self.copyCatsList,
-                                               self.copyCatsIds, copyAttrb=True) < 0:
+                                               self.copyCatsIds, copyAttrb = True) < 0:
                             return
                             return
                     
                     
                     del self.copyCatsList
                     del self.copyCatsList
@@ -2304,7 +2300,7 @@ class BufferedWindow(MapWindow, wx.Window):
                 del self.copyIds
                 del self.copyIds
                 if self.layerTmp:
                 if self.layerTmp:
                     self.Map.DeleteLayer(self.layerTmp)
                     self.Map.DeleteLayer(self.layerTmp)
-                    self.UpdateMap(render=True, renderVector=False)
+                    self.UpdateMap(render = True, renderVector = False)
                 del self.layerTmp
                 del self.layerTmp
 
 
             elif digitToolbar.GetAction() == "zbulkLine" and len(self.polycoords) == 2:
             elif digitToolbar.GetAction() == "zbulkLine" and len(self.polycoords) == 2:
@@ -2312,13 +2308,13 @@ class BufferedWindow(MapWindow, wx.Window):
                 pos2 = self.polycoords[1]
                 pos2 = self.polycoords[1]
 
 
                 selected = digitClass.driver.GetSelected()
                 selected = digitClass.driver.GetSelected()
-                dlg = VDigitZBulkDialog(parent=self, title=_("Z bulk-labeling dialog"),
-                                        nselected=len(selected))
+                dlg = VDigitZBulkDialog(parent = self, title = _("Z bulk-labeling dialog"),
+                                        nselected = len(selected))
                 if dlg.ShowModal() == wx.ID_OK:
                 if dlg.ShowModal() == wx.ID_OK:
                     if digitClass.ZBulkLines(pos1, pos2, dlg.value.GetValue(),
                     if digitClass.ZBulkLines(pos1, pos2, dlg.value.GetValue(),
                                              dlg.step.GetValue()) < 0:
                                              dlg.step.GetValue()) < 0:
                         return
                         return
-                self.UpdateMap(render=False, renderVector=True)
+                self.UpdateMap(render = False, renderVector = True)
             elif digitToolbar.GetAction() == "typeConv":
             elif digitToolbar.GetAction() == "typeConv":
                 # -> feature type conversion
                 # -> feature type conversion
                 # - point <-> centroid
                 # - point <-> centroid
@@ -2330,7 +2326,7 @@ class BufferedWindow(MapWindow, wx.Window):
                 # unselect and re-render
                 # unselect and re-render
                 digitClass.driver.SetSelected([])
                 digitClass.driver.SetSelected([])
                 self.polycoords = []
                 self.polycoords = []
-                self.UpdateMap(render=False)
+                self.UpdateMap(render = False)
 
 
             self.redrawAll = True
             self.redrawAll = True
             self.Refresh()
             self.Refresh()
@@ -2365,7 +2361,7 @@ class BufferedWindow(MapWindow, wx.Window):
                     if len(self.vdigitMove['id']) > 1:
                     if len(self.vdigitMove['id']) > 1:
                         self.vdigitMove['id'].pop()
                         self.vdigitMove['id'].pop()
 
 
-                self.UpdateMap(render=False, renderVector=False)
+                self.UpdateMap(render = False, renderVector = False)
 
 
             elif digitToolbar.GetAction() in ["deleteLine", "moveLine", "splitLine",
             elif digitToolbar.GetAction() in ["deleteLine", "moveLine", "splitLine",
                                               "addVertex", "removeVertex", "moveVertex",
                                               "addVertex", "removeVertex", "moveVertex",
@@ -2390,17 +2386,17 @@ class BufferedWindow(MapWindow, wx.Window):
                     del self.copyIds
                     del self.copyIds
                     if self.layerTmp:
                     if self.layerTmp:
                         self.Map.DeleteLayer(self.layerTmp)
                         self.Map.DeleteLayer(self.layerTmp)
-                        self.UpdateMap(render=True, renderVector=False)
+                        self.UpdateMap(render = True, renderVector = False)
                     del self.layerTmp
                     del self.layerTmp
 
 
                 self.polycoords = []
                 self.polycoords = []
-                self.UpdateMap(render=False) # render vector
+                self.UpdateMap(render = False) # render vector
 
 
             elif digitToolbar.GetAction() == "zbulkLine":
             elif digitToolbar.GetAction() == "zbulkLine":
                 # reset polyline
                 # reset polyline
                 self.polycoords = []
                 self.polycoords = []
                 digitClass.driver.SetSelected([])
                 digitClass.driver.SetSelected([])
-                self.UpdateMap(render=False)
+                self.UpdateMap(render = False)
             
             
             self.redrawAll = True
             self.redrawAll = True
 
 
@@ -2417,7 +2413,7 @@ class BufferedWindow(MapWindow, wx.Window):
         self.Zoom(begin, end, 0) # no zoom
         self.Zoom(begin, end, 0) # no zoom
         
         
         # redraw map
         # redraw map
-        self.UpdateMap(render=True)
+        self.UpdateMap(render = True)
         
         
         # update statusbar
         # update statusbar
         self.parent.StatusbarUpdate()
         self.parent.StatusbarUpdate()
@@ -2449,7 +2445,7 @@ class BufferedWindow(MapWindow, wx.Window):
                            (self.mouse['end'][0], self.mouse['end'][1]))
                            (self.mouse['end'][0], self.mouse['end'][1]))
             if digitToolbar.GetAction() == "addLine" and digitToolbar.GetAction('type') in ["line", "boundary"]:
             if digitToolbar.GetAction() == "addLine" and digitToolbar.GetAction('type') in ["line", "boundary"]:
                 if len(self.polycoords) > 0:
                 if len(self.polycoords) > 0:
-                    self.MouseDraw(pdc=self.pdcTmp, begin=self.Cell2Pixel(self.polycoords[-1]))
+                    self.MouseDraw(pdc = self.pdcTmp, begin = self.Cell2Pixel(self.polycoords[-1]))
             elif digitToolbar.GetAction() in ["moveLine", "moveVertex", "editLine"] \
             elif digitToolbar.GetAction() in ["moveLine", "moveVertex", "editLine"] \
                     and hasattr(self, "vdigitMove"):
                     and hasattr(self, "vdigitMove"):
                 dx = self.mouse['end'][0] - self.mouse['begin'][0]
                 dx = self.mouse['end'][0] - self.mouse['begin'][0]
@@ -2482,14 +2478,14 @@ class BufferedWindow(MapWindow, wx.Window):
                                 self.pdcTmp.RemoveId(self.vdigitMove['id'][2]-1)
                                 self.pdcTmp.RemoveId(self.vdigitMove['id'][2]-1)
                                 self.polycoords.append((x, y))
                                 self.polycoords.append((x, y))
                             
                             
-                            self.ClearLines(pdc=self.pdcTmp)
-                            self.DrawLines(pdc=self.pdcTmp)
+                            self.ClearLines(pdc = self.pdcTmp)
+                            self.DrawLines(pdc = self.pdcTmp)
 
 
                         else: # edit line
                         else: # edit line
                             try:
                             try:
                                 if self.vdigitMove['id'][-1] > 0: # previous vertex
                                 if self.vdigitMove['id'][-1] > 0: # previous vertex
-                                    self.MouseDraw(pdc=self.pdcTmp,
-                                                   begin=self.Cell2Pixel(self.polycoords[-1]))
+                                    self.MouseDraw(pdc = self.pdcTmp,
+                                                   begin = self.Cell2Pixel(self.polycoords[-1]))
                             except: # no line
                             except: # no line
                                 self.vdigitMove['id'] = []
                                 self.vdigitMove['id'] = []
                                 self.polycoords = []
                                 self.polycoords = []
@@ -2504,12 +2500,11 @@ class BufferedWindow(MapWindow, wx.Window):
 
 
         event.Skip()
         event.Skip()
 
 
-    def ClearLines(self, pdc=None):
-        """!
-        Clears temporary drawn lines from PseudoDC
+    def ClearLines(self, pdc = None):
+        """!Clears temporary drawn lines from PseudoDC
         """
         """
         if not pdc:
         if not pdc:
-            pdc=self.pdcTmp
+            pdc = self.pdcTmp
         try:
         try:
             pdc.ClearId(self.lineid)
             pdc.ClearId(self.lineid)
             pdc.RemoveId(self.lineid)
             pdc.RemoveId(self.lineid)
@@ -2757,8 +2752,8 @@ class BufferedWindow(MapWindow, wx.Window):
                 digitToolbar = self.parent.toolbars['vdigit']
                 digitToolbar = self.parent.toolbars['vdigit']
                 if digitToolbar and digitToolbar.GetLayer() == l:
                 if digitToolbar and digitToolbar.GetLayer() == l:
                     w, s, b, e, n, t = self.parent.digit.driver.GetMapBoundingBox()
                     w, s, b, e, n, t = self.parent.digit.driver.GetMapBoundingBox()
-                    self.Map.GetRegion(n=n, s=s, w=w, e=e,
-                                       update=True)
+                    self.Map.GetRegion(n = n, s = s, w = w, e = e,
+                                       update = True)
                     updated = True
                     updated = True
                 else:
                 else:
                     vect.append(l.name)
                     vect.append(l.name)
@@ -2796,7 +2791,7 @@ class BufferedWindow(MapWindow, wx.Window):
     def ZoomToDefault(self):
     def ZoomToDefault(self):
         """!Set display geometry to match default region settings
         """!Set display geometry to match default region settings
         """
         """
-        self.Map.region = self.Map.GetRegion(default=True)
+        self.Map.region = self.Map.GetRegion(default = True)
         self.Map.AdjustRegion() # aling region extent to the display
         self.Map.AdjustRegion() # aling region extent to the display
 
 
         self.ZoomHistory(self.Map.region['n'], self.Map.region['s'],
         self.ZoomHistory(self.Map.region['n'], self.Map.region['s'],

+ 78 - 80
gui/wxpython/gui_modules/toolbars.py

@@ -76,7 +76,7 @@ class AbstractToolbar(wx.ToolBar):
         
         
         @return id of tool
         @return id of tool
         """
         """
-        bmpDisabled=wx.NullBitmap
+        bmpDisabled = wx.NullBitmap
         
         
         if label:
         if label:
             Debug.msg(3, "CreateTool(): tool=%d, label=%s bitmap=%s" % \
             Debug.msg(3, "CreateTool(): tool=%d, label=%s bitmap=%s" % \
@@ -90,7 +90,7 @@ class AbstractToolbar(wx.ToolBar):
         
         
         return tool
         return tool
     
     
-    def EnableLongHelp(self, enable=True):
+    def EnableLongHelp(self, enable = True):
         """!Enable/disable long help
         """!Enable/disable long help
         
         
         @param enable True for enable otherwise disable
         @param enable True for enable otherwise disable
@@ -111,7 +111,7 @@ class AbstractToolbar(wx.ToolBar):
         
         
         if self.parent.toolbars['vdigit']:
         if self.parent.toolbars['vdigit']:
             # update vdigit toolbar (unselect currently selected tool)
             # update vdigit toolbar (unselect currently selected tool)
-            id = self.parent.toolbars['vdigit'].GetAction(type='id')
+            id = self.parent.toolbars['vdigit'].GetAction(type = 'id')
             self.parent.toolbars['vdigit'].ToggleTool(id, False)
             self.parent.toolbars['vdigit'].ToggleTool(id, False)
         
         
         if event:
         if event:
@@ -129,7 +129,7 @@ class AbstractToolbar(wx.ToolBar):
             # initialize toolbar
             # initialize toolbar
             self.ToggleTool(self.action['id'], True)
             self.ToggleTool(self.action['id'], True)
         
         
-    def GetAction(self, type='desc'):
+    def GetAction(self, type = 'desc'):
         """!Get current action info"""
         """!Get current action info"""
         return self.action.get(type, '')
         return self.action.get(type, '')
     
     
@@ -347,8 +347,7 @@ class MapToolbar(AbstractToolbar):
             self.EnableTool(tool, enabled)
             self.EnableTool(tool, enabled)
         
         
 class GCPManToolbar(AbstractToolbar):
 class GCPManToolbar(AbstractToolbar):
-    """!
-    Toolbar for managing ground control points
+    """!Toolbar for managing ground control points
 
 
     @param parent reference to GCP widget
     @param parent reference to GCP widget
     """
     """
@@ -407,9 +406,9 @@ class GCPDisplayToolbar(AbstractToolbar):
         
         
         # add tool to toggle active map window
         # add tool to toggle active map window
         self.togglemapid = wx.NewId()
         self.togglemapid = wx.NewId()
-        self.togglemap = wx.Choice(parent=self, id=self.togglemapid,
+        self.togglemap = wx.Choice(parent = self, id = self.togglemapid,
 						    choices = [_('source'), _('target')],
 						    choices = [_('source'), _('target')],
-						    style=wx.CB_READONLY)
+						    style = wx.CB_READONLY)
 
 
         self.InsertControl(10, self.togglemap)
         self.InsertControl(10, self.togglemap)
 
 
@@ -628,7 +627,7 @@ class VDigitToolbar(AbstractToolbar):
     """
     """
     Toolbar for digitization
     Toolbar for digitization
     """
     """
-    def __init__(self, parent, mapcontent, layerTree=None, log=None):
+    def __init__(self, parent, mapcontent, layerTree = None, log = None):
         self.mapcontent    = mapcontent # Map class instance
         self.mapcontent    = mapcontent # Map class instance
         self.layerTree     = layerTree  # reference to layer tree associated to map display
         self.layerTree     = layerTree  # reference to layer tree associated to map display
         self.log           = log        # log area
         self.log           = log        # log area
@@ -654,7 +653,7 @@ class VDigitToolbar(AbstractToolbar):
                         'id'   : self.addPoint }
                         'id'   : self.addPoint }
         
         
         # list of available vector maps
         # list of available vector maps
-        self.UpdateListOfLayers(updateTool=True)
+        self.UpdateListOfLayers(updateTool = True)
         
         
         # realize toolbar
         # realize toolbar
         self.Realize()
         self.Realize()
@@ -760,7 +759,7 @@ class VDigitToolbar(AbstractToolbar):
     
     
     def OnTool(self, event):
     def OnTool(self, event):
         """!Tool selected -> disable selected tool in map toolbar"""
         """!Tool selected -> disable selected tool in map toolbar"""
-        id = self.parent.toolbars['map'].GetAction(type='id')
+        id = self.parent.toolbars['map'].GetAction(type = 'id')
         self.parent.toolbars['map'].ToggleTool(id, False)
         self.parent.toolbars['map'].ToggleTool(id, False)
         
         
         # set cursor
         # set cursor
@@ -786,7 +785,7 @@ class VDigitToolbar(AbstractToolbar):
         
         
         # clear tmp canvas
         # clear tmp canvas
         if self.action['id'] != id:
         if self.action['id'] != id:
-            self.parent.MapWindow.ClearLines(pdc=self.parent.MapWindow.pdcTmp)
+            self.parent.MapWindow.ClearLines(pdc = self.parent.MapWindow.pdcTmp)
             if self.parent.digit and \
             if self.parent.digit and \
                     len(self.parent.digit.driver.GetSelected()) > 0:
                     len(self.parent.digit.driver.GetSelected()) > 0:
                 # cancel action
                 # cancel action
@@ -917,17 +916,17 @@ class VDigitToolbar(AbstractToolbar):
         point = wx.GetMousePosition()
         point = wx.GetMousePosition()
         toolMenu = wx.Menu()
         toolMenu = wx.Menu()
         # Add items to the menu
         # Add items to the menu
-        cats = wx.MenuItem(parentMenu=toolMenu, id=wx.ID_ANY,
-                           text=_('Copy categories'),
-                           kind=wx.ITEM_CHECK)
+        cats = wx.MenuItem(parentMenu = toolMenu, id = wx.ID_ANY,
+                           text = _('Copy categories'),
+                           kind = wx.ITEM_CHECK)
         toolMenu.AppendItem(cats)
         toolMenu.AppendItem(cats)
         self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnCopyCats, cats)
         self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnCopyCats, cats)
         if self.action['desc'] == "copyCats":
         if self.action['desc'] == "copyCats":
             cats.Check(True)
             cats.Check(True)
         
         
-        attrb = wx.MenuItem(parentMenu=toolMenu, id=wx.ID_ANY,
-                            text=_('Duplicate attributes'),
-                            kind=wx.ITEM_CHECK)
+        attrb = wx.MenuItem(parentMenu = toolMenu, id = wx.ID_ANY,
+                            text = _('Duplicate attributes'),
+                            kind = wx.ITEM_CHECK)
         toolMenu.AppendItem(attrb)
         toolMenu.AppendItem(attrb)
         self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnCopyAttrb, attrb)
         self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnCopyAttrb, attrb)
         if self.action['desc'] == "copyAttrs":
         if self.action['desc'] == "copyAttrs":
@@ -995,8 +994,8 @@ class VDigitToolbar(AbstractToolbar):
                 self.parent.digit = None
                 self.parent.digit = None
         
         
         if not self.settingsDialog:
         if not self.settingsDialog:
-            self.settingsDialog = VDigitSettingsDialog(parent=self.parent, title=_("Digitization settings"),
-                                                       style=wx.DEFAULT_DIALOG_STYLE)
+            self.settingsDialog = VDigitSettingsDialog(parent = self.parent, title = _("Digitization settings"),
+                                                       style = wx.DEFAULT_DIALOG_STYLE)
             self.settingsDialog.Show()
             self.settingsDialog.Show()
 
 
     def OnAdditionalToolMenu(self, event):
     def OnAdditionalToolMenu(self, event):
@@ -1004,73 +1003,73 @@ class VDigitToolbar(AbstractToolbar):
         point = wx.GetMousePosition()
         point = wx.GetMousePosition()
         toolMenu = wx.Menu()
         toolMenu = wx.Menu()
         # Add items to the menu
         # Add items to the menu
-        copy = wx.MenuItem(parentMenu=toolMenu, id=wx.ID_ANY,
-                           text=_('Copy features from (background) vector map'),
-                           kind=wx.ITEM_CHECK)
+        copy = wx.MenuItem(parentMenu = toolMenu, id = wx.ID_ANY,
+                           text = _('Copy features from (background) vector map'),
+                           kind = wx.ITEM_CHECK)
         toolMenu.AppendItem(copy)
         toolMenu.AppendItem(copy)
         self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnCopy, copy)
         self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnCopy, copy)
         if self.action['desc'] == "copyLine":
         if self.action['desc'] == "copyLine":
             copy.Check(True)
             copy.Check(True)
         
         
-        flip = wx.MenuItem(parentMenu=toolMenu, id=wx.ID_ANY,
-                           text=_('Flip selected lines/boundaries'),
-                           kind=wx.ITEM_CHECK)
+        flip = wx.MenuItem(parentMenu = toolMenu, id = wx.ID_ANY,
+                           text = _('Flip selected lines/boundaries'),
+                           kind = wx.ITEM_CHECK)
         toolMenu.AppendItem(flip)
         toolMenu.AppendItem(flip)
         self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnFlip, flip)
         self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnFlip, flip)
         if self.action['desc'] == "flipLine":
         if self.action['desc'] == "flipLine":
             flip.Check(True)
             flip.Check(True)
         
         
-        merge = wx.MenuItem(parentMenu=toolMenu, id=wx.ID_ANY,
-                            text=_('Merge selected lines/boundaries'),
-                            kind=wx.ITEM_CHECK)
+        merge = wx.MenuItem(parentMenu = toolMenu, id = wx.ID_ANY,
+                            text = _('Merge selected lines/boundaries'),
+                            kind = wx.ITEM_CHECK)
         toolMenu.AppendItem(merge)
         toolMenu.AppendItem(merge)
         self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnMerge, merge)
         self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnMerge, merge)
         if self.action['desc'] == "mergeLine":
         if self.action['desc'] == "mergeLine":
             merge.Check(True)
             merge.Check(True)
         
         
-        breakL = wx.MenuItem(parentMenu=toolMenu, id=wx.ID_ANY,
-                             text=_('Break selected lines/boundaries at intersection'),
-                             kind=wx.ITEM_CHECK)
+        breakL = wx.MenuItem(parentMenu = toolMenu, id = wx.ID_ANY,
+                             text = _('Break selected lines/boundaries at intersection'),
+                             kind = wx.ITEM_CHECK)
         toolMenu.AppendItem(breakL)
         toolMenu.AppendItem(breakL)
         self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnBreak, breakL)
         self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnBreak, breakL)
         if self.action['desc'] == "breakLine":
         if self.action['desc'] == "breakLine":
             breakL.Check(True)
             breakL.Check(True)
         
         
-        snap = wx.MenuItem(parentMenu=toolMenu, id=wx.ID_ANY,
-                           text=_('Snap selected lines/boundaries (only to nodes)'),
-                           kind=wx.ITEM_CHECK)
+        snap = wx.MenuItem(parentMenu = toolMenu, id = wx.ID_ANY,
+                           text = _('Snap selected lines/boundaries (only to nodes)'),
+                           kind = wx.ITEM_CHECK)
         toolMenu.AppendItem(snap)
         toolMenu.AppendItem(snap)
         self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnSnap, snap)
         self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnSnap, snap)
         if self.action['desc'] == "snapLine":
         if self.action['desc'] == "snapLine":
             snap.Check(True)
             snap.Check(True)
         
         
-        connect = wx.MenuItem(parentMenu=toolMenu, id=wx.ID_ANY,
-                              text=_('Connect selected lines/boundaries'),
-                              kind=wx.ITEM_CHECK)
+        connect = wx.MenuItem(parentMenu = toolMenu, id = wx.ID_ANY,
+                              text = _('Connect selected lines/boundaries'),
+                              kind = wx.ITEM_CHECK)
         toolMenu.AppendItem(connect)
         toolMenu.AppendItem(connect)
         self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnConnect, connect)
         self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnConnect, connect)
         if self.action['desc'] == "connectLine":
         if self.action['desc'] == "connectLine":
             connect.Check(True)
             connect.Check(True)
         
         
-        query = wx.MenuItem(parentMenu=toolMenu, id=wx.ID_ANY,
-                            text=_('Query features'),
-                            kind=wx.ITEM_CHECK)
+        query = wx.MenuItem(parentMenu = toolMenu, id = wx.ID_ANY,
+                            text = _('Query features'),
+                            kind = wx.ITEM_CHECK)
         toolMenu.AppendItem(query)
         toolMenu.AppendItem(query)
         self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnQuery, query)
         self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnQuery, query)
         if self.action['desc'] == "queryLine":
         if self.action['desc'] == "queryLine":
             query.Check(True)
             query.Check(True)
         
         
-        zbulk = wx.MenuItem(parentMenu=toolMenu, id=wx.ID_ANY,
-                            text=_('Z bulk-labeling of 3D lines'),
-                            kind=wx.ITEM_CHECK)
+        zbulk = wx.MenuItem(parentMenu = toolMenu, id = wx.ID_ANY,
+                            text = _('Z bulk-labeling of 3D lines'),
+                            kind = wx.ITEM_CHECK)
         toolMenu.AppendItem(zbulk)
         toolMenu.AppendItem(zbulk)
         self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnZBulk, zbulk)
         self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnZBulk, zbulk)
         if self.action['desc'] == "zbulkLine":
         if self.action['desc'] == "zbulkLine":
             zbulk.Check(True)
             zbulk.Check(True)
         
         
-        typeconv = wx.MenuItem(parentMenu=toolMenu, id=wx.ID_ANY,
-                               text=_('Feature type conversion'),
-                               kind=wx.ITEM_CHECK)
+        typeconv = wx.MenuItem(parentMenu = toolMenu, id = wx.ID_ANY,
+                               text = _('Feature type conversion'),
+                               kind = wx.ITEM_CHECK)
         toolMenu.AppendItem(typeconv)
         toolMenu.AppendItem(typeconv)
         self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnTypeConversion, typeconv)
         self.parent.MapWindow.Bind(wx.EVT_MENU, self.OnTypeConversion, typeconv)
         if self.action['desc'] == "typeConv":
         if self.action['desc'] == "typeConv":
@@ -1171,7 +1170,7 @@ class VDigitToolbar(AbstractToolbar):
             return
             return
         
         
         Debug.msg(2, "Digittoolbar.OnQuery(): %s" % \
         Debug.msg(2, "Digittoolbar.OnQuery(): %s" % \
-                      UserSettings.Get(group='vdigit', key='query', subkey='selection'))
+                      UserSettings.Get(group = 'vdigit', key = 'query', subkey = 'selection'))
         self.action = { 'desc' : "queryLine",
         self.action = { 'desc' : "queryLine",
                         'id'   : self.additionalTools }
                         'id'   : self.additionalTools }
         self.parent.MapWindow.mouse['box'] = 'box'
         self.parent.MapWindow.mouse['box'] = 'box'
@@ -1179,9 +1178,9 @@ class VDigitToolbar(AbstractToolbar):
     def OnZBulk(self, event):
     def OnZBulk(self, event):
         """!Z bulk-labeling selected lines/boundaries"""
         """!Z bulk-labeling selected lines/boundaries"""
         if not self.parent.digit.driver.Is3D():
         if not self.parent.digit.driver.Is3D():
-            wx.MessageBox(parent=self.parent,
-                          message=_("Vector map is not 3D. Operation canceled."),
-                          caption=_("Error"), style=wx.OK | wx.ICON_ERROR | wx.CENTRE)
+            wx.MessageBox(parent = self.parent,
+                          message = _("Vector map is not 3D. Operation canceled."),
+                          caption = _("Error"), style = wx.OK | wx.ICON_ERROR | wx.CENTRE)
             return
             return
         
         
         if self.action['desc'] == 'zbulkLine': # select previous action
         if self.action['desc'] == 'zbulkLine': # select previous action
@@ -1223,7 +1222,7 @@ class VDigitToolbar(AbstractToolbar):
         """
         """
         if event.GetSelection() == 0: # create new vector map layer
         if event.GetSelection() == 0: # create new vector map layer
             if self.mapLayer:
             if self.mapLayer:
-                openVectorMap = self.mapLayer.GetName(fullyQualified=False)['name']
+                openVectorMap = self.mapLayer.GetName(fullyQualified = False)['name']
             else:
             else:
                 openVectorMap = None
                 openVectorMap = None
             mapName = gdialogs.CreateNewVector(self.parent,
             mapName = gdialogs.CreateNewVector(self.parent,
@@ -1231,17 +1230,17 @@ class VDigitToolbar(AbstractToolbar):
                                                cmd = (('v.edit',
                                                cmd = (('v.edit',
                                                        { 'tool' : 'create' },
                                                        { 'tool' : 'create' },
                                                        'map')),
                                                        'map')),
-                                               disableAdd=True)[0]
+                                               disableAdd = True)[0]
             if mapName:
             if mapName:
                 # add layer to map layer tree
                 # add layer to map layer tree
                 if self.layerTree:
                 if self.layerTree:
-                    self.layerTree.AddLayer(ltype='vector',
-                                            lname=mapName,
-                                            lchecked=True,
-                                            lopacity=1.0,
-                                            lcmd=['d.vect', 'map=%s' % mapName])
+                    self.layerTree.AddLayer(ltype = 'vector',
+                                            lname = mapName,
+                                            lchecked = True,
+                                            lopacity = 1.0,
+                                            lcmd = ['d.vect', 'map=%s' % mapName])
                     
                     
-                    vectLayers = self.UpdateListOfLayers(updateTool=True)
+                    vectLayers = self.UpdateListOfLayers(updateTool = True)
                     selection = vectLayers.index(mapName)
                     selection = vectLayers.index(mapName)
                 else:
                 else:
                     pass # TODO (no Layer Manager)
                     pass # TODO (no Layer Manager)
@@ -1267,8 +1266,7 @@ class VDigitToolbar(AbstractToolbar):
         return True
         return True
     
     
     def StartEditing (self, mapLayer):
     def StartEditing (self, mapLayer):
-        """
-        Start editing selected vector map layer.
+        """!Start editing selected vector map layer.
 
 
         @param mapLayer reference to MapLayer instance
         @param mapLayer reference to MapLayer instance
         """
         """
@@ -1280,10 +1278,10 @@ class VDigitToolbar(AbstractToolbar):
         
         
         # unset background map if needed
         # unset background map if needed
         if mapLayer:
         if mapLayer:
-            if UserSettings.Get(group='vdigit', key='bgmap',
-                                subkey='value', internal=True) == mapLayer.GetName():
-                UserSettings.Set(group='vdigit', key='bgmap',
-                                 subkey='value', value='', internal=True)
+            if UserSettings.Get(group = 'vdigit', key = 'bgmap',
+                                subkey = 'value', internal = True) == mapLayer.GetName():
+                UserSettings.Set(group = 'vdigit', key = 'bgmap',
+                                 subkey = 'value', value = '', internal = True)
             
             
             self.parent.statusbar.SetStatusText(_("Please wait, "
             self.parent.statusbar.SetStatusText(_("Please wait, "
                                                   "opening vector map <%s> for editing...") % \
                                                   "opening vector map <%s> for editing...") % \
@@ -1295,7 +1293,7 @@ class VDigitToolbar(AbstractToolbar):
         from vdigit import VDigit as VDigit
         from vdigit import VDigit as VDigit
         # use vdigit's PseudoDC
         # use vdigit's PseudoDC
         self.parent.MapWindow.DefinePseudoDC(vdigit = True)
         self.parent.MapWindow.DefinePseudoDC(vdigit = True)
-        self.parent.digit = VDigit(mapwindow=self.parent.MapWindow)
+        self.parent.digit = VDigit(mapwindow = self.parent.MapWindow)
         
         
         self.mapLayer = mapLayer
         self.mapLayer = mapLayer
         
         
@@ -1327,9 +1325,9 @@ class VDigitToolbar(AbstractToolbar):
         self.parent.digit.driver.SetDevice(self.parent.MapWindow.pdcVector)
         self.parent.digit.driver.SetDevice(self.parent.MapWindow.pdcVector)
 
 
         if not self.parent.MapWindow.resize:
         if not self.parent.MapWindow.resize:
-            self.parent.MapWindow.UpdateMap(render=True)
+            self.parent.MapWindow.UpdateMap(render = True)
         
         
-        opacity = mapLayer.GetOpacity(float=True)
+        opacity = mapLayer.GetOpacity(float = True)
         if opacity < 1.0:
         if opacity < 1.0:
             alpha = int(opacity * 255)
             alpha = int(opacity * 255)
             self.parent.digit.driver.UpdateSettings(alpha)
             self.parent.digit.driver.UpdateSettings(alpha)
@@ -1350,13 +1348,13 @@ class VDigitToolbar(AbstractToolbar):
         # save changes
         # save changes
         if self.mapLayer:
         if self.mapLayer:
             Debug.msg (4, "VDigitToolbar.StopEditing(): layer=%s" % self.mapLayer.GetName())
             Debug.msg (4, "VDigitToolbar.StopEditing(): layer=%s" % self.mapLayer.GetName())
-            if UserSettings.Get(group='vdigit', key='saveOnExit', subkey='enabled') is False:
+            if UserSettings.Get(group = 'vdigit', key = 'saveOnExit', subkey = 'enabled') is False:
                 if self.parent.digit.GetUndoLevel() > -1:
                 if self.parent.digit.GetUndoLevel() > -1:
-                    dlg = wx.MessageDialog(parent=self.parent,
-                                           message=_("Do you want to save changes "
+                    dlg = wx.MessageDialog(parent = self.parent,
+                                           message = _("Do you want to save changes "
                                                      "in vector map <%s>?") % self.mapLayer.GetName(),
                                                      "in vector map <%s>?") % self.mapLayer.GetName(),
-                                           caption=_("Save changes?"),
-                                           style=wx.YES_NO | wx.YES_DEFAULT | wx.ICON_QUESTION)
+                                           caption = _("Save changes?"),
+                                           style = wx.YES_NO | wx.YES_DEFAULT | wx.ICON_QUESTION)
                     if dlg.ShowModal() == wx.ID_NO:
                     if dlg.ShowModal() == wx.ID_NO:
                         # revert changes
                         # revert changes
                         self.parent.digit.Undo(0)
                         self.parent.digit.Undo(0)
@@ -1396,7 +1394,7 @@ class VDigitToolbar(AbstractToolbar):
         
         
         return True
         return True
     
     
-    def UpdateListOfLayers (self, updateTool=False):
+    def UpdateListOfLayers (self, updateTool = False):
         """!
         """!
         Update list of available vector map layers.
         Update list of available vector map layers.
         This list consists only editable layers (in the current mapset)
         This list consists only editable layers (in the current mapset)
@@ -1413,8 +1411,8 @@ class VDigitToolbar(AbstractToolbar):
         
         
         # select vector map layer in the current mapset
         # select vector map layer in the current mapset
         layerNameList = []
         layerNameList = []
-        self.layers = self.mapcontent.GetListOfLayers(l_type="vector",
-                                                      l_mapset=grass.gisenv()['MAPSET'])
+        self.layers = self.mapcontent.GetListOfLayers(l_type = "vector",
+                                                      l_mapset = grass.gisenv()['MAPSET'])
         for layer in self.layers:
         for layer in self.layers:
             if not layer.name in layerNameList: # do not duplicate layer
             if not layer.name in layerNameList: # do not duplicate layer
                 layerNameList.append (layer.GetName())
                 layerNameList.append (layer.GetName())
@@ -1426,9 +1424,9 @@ class VDigitToolbar(AbstractToolbar):
                 value = layerNameSelected
                 value = layerNameSelected
 
 
             if not self.comboid:
             if not self.comboid:
-                self.combo = wx.ComboBox(self, id=wx.ID_ANY, value=value,
-                                         choices=[_('New vector map'), ] + layerNameList, size=(115, -1),
-                                         style=wx.CB_READONLY)
+                self.combo = wx.ComboBox(self, id = wx.ID_ANY, value = value,
+                                         choices = [_('New vector map'), ] + layerNameList, size = (115, -1),
+                                         style = wx.CB_READONLY)
                 self.comboid = self.InsertControl(0, self.combo)
                 self.comboid = self.InsertControl(0, self.combo)
                 self.parent.Bind(wx.EVT_COMBOBOX, self.OnSelectMap, self.comboid)
                 self.parent.Bind(wx.EVT_COMBOBOX, self.OnSelectMap, self.comboid)
             else:
             else:
@@ -1616,7 +1614,7 @@ class NvizToolbar(AbstractToolbar):
             self.settingsDialog = NvizPreferencesDialog(parent = self.parent)
             self.settingsDialog = NvizPreferencesDialog(parent = self.parent)
         self.settingsDialog.Show()
         self.settingsDialog.Show()
             
             
-    def OnExit (self, event=None):
+    def OnExit (self, event = None):
         """!Quit nviz tool (swith to 2D mode)"""
         """!Quit nviz tool (swith to 2D mode)"""
         # set default mouse settings
         # set default mouse settings
         self.parent.MapWindow.mouse['use'] = "pointer"
         self.parent.MapWindow.mouse['use'] = "pointer"