[GRASS-SVN] r46489 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Jun 1 16:12:39 EDT 2011


Author: martinl
Date: 2011-06-01 13:12:39 -0700 (Wed, 01 Jun 2011)
New Revision: 46489

Modified:
   grass/trunk/gui/wxpython/gui_modules/psmap.py
   grass/trunk/gui/wxpython/gui_modules/psmap_dialogs.py
Log:
wxGUI/psmap: indent code properly


Modified: grass/trunk/gui/wxpython/gui_modules/psmap.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/psmap.py	2011-06-01 19:47:43 UTC (rev 46488)
+++ grass/trunk/gui/wxpython/gui_modules/psmap.py	2011-06-01 20:12:39 UTC (rev 46489)
@@ -1,5 +1,5 @@
 """!
- at package psmap
+ at package psmap.py
 
 @brief GUI for ps.map
 
@@ -116,7 +116,7 @@
             'select':wx.TRANSPARENT_BRUSH,
             'resize': wx.BLACK_BRUSH
             } 
-          
+        
 
         # list of objects to draw
         self.objectId = []
@@ -131,22 +131,22 @@
         self.currentPage = 0
         #canvas for draft mode
         self.canvas = PsMapBufferedWindow(parent = self, mouse = self.mouse, pen = self.pen,
-                                            brush = self.brush, cursors = self.cursors, 
-                                            instruction = self.instruction, openDialogs = self.openDialogs,
-                                            pageId = self.pageId, objectId = self.objectId,
-                                            preview = False)
-                                        
+                                          brush = self.brush, cursors = self.cursors, 
+                                          instruction = self.instruction, openDialogs = self.openDialogs,
+                                          pageId = self.pageId, objectId = self.objectId,
+                                          preview = False)
+        
         self.canvas.SetCursor(self.cursors["default"])
         self.getInitMap()
         
         
         # image path
         env = grass.gisenv()
-        self.imgName = os.path.join( env['GISDBASE'], env['LOCATION_NAME'], env['MAPSET'], '.tmp', 'tmpImage.png')
+        self.imgName = os.path.join(env['GISDBASE'], env['LOCATION_NAME'], env['MAPSET'], '.tmp', 'tmpImage.png')
         
         #canvas for preview
         self.previewCanvas = PsMapBufferedWindow(parent = self, mouse = self.mouse, cursors = self.cursors,
-                                                    pen = self.pen, brush = self.brush, preview = True)
+                                                 pen = self.pen, brush = self.brush, preview = True)
         
         # set WIND_OVERRIDE
         grass.use_temp_region()
@@ -182,12 +182,12 @@
         mainSizer = wx.BoxSizer(wx.VERTICAL)
         if globalvar.hasAgw:
             self.book = fnb.FlatNotebook(parent = self, id = wx.ID_ANY,
-                                            agwStyle = fnb.FNB_FANCY_TABS | fnb.FNB_BOTTOM |
-                                            fnb.FNB_NO_NAV_BUTTONS | fnb.FNB_NO_X_BUTTON)
+                                         agwStyle = fnb.FNB_FANCY_TABS | fnb.FNB_BOTTOM |
+                                         fnb.FNB_NO_NAV_BUTTONS | fnb.FNB_NO_X_BUTTON)
         else:
             self.book = fnb.FlatNotebook(parent = self, id = wx.ID_ANY,
-                                            style = fnb.FNB_FANCY_TABS | fnb.FNB_BOTTOM |
-                                            fnb.FNB_NO_NAV_BUTTONS | fnb.FNB_NO_X_BUTTON)
+                                         style = fnb.FNB_FANCY_TABS | fnb.FNB_BOTTOM |
+                                         fnb.FNB_NO_NAV_BUTTONS | fnb.FNB_NO_X_BUTTON)
         #self.book = fnb.FlatNotebook(self, wx.ID_ANY, style = fnb.FNB_BOTTOM)
         self.book.AddPage(self.canvas, "Draft mode")
         self.book.AddPage(self.previewCanvas, "Preview")
@@ -198,7 +198,7 @@
         self.SetSizer(mainSizer)
         mainSizer.Fit(self)
 
-            
+        
     def InstructionFile(self):
         """!Creates mapping instructions"""
         
@@ -219,13 +219,13 @@
         
         except OSError:
             GMessage(parent = self,
-                    message = _("Program ps2pdf is not available. Please install it first to create PDF."))
+                     message = _("Program ps2pdf is not available. Please install it first to create PDF."))
             return
-            
+        
         filename = self.getFile(wildcard = "PDF (*.pdf)|*.pdf")
         if filename:  
             self.PSFile(filename, pdf = True)   
-               
+            
     def OnPreview(self, event):
         """!Run ps.map and show result"""
         self.PSFile()
@@ -253,7 +253,7 @@
                 if self.instruction.FindInstructionByType('map'):
                     mapId = self.instruction.FindInstructionByType('map').id
                     SetResolution(dpi = 100, width = self.instruction[mapId]['rect'][2],
-                                    height = self.instruction[mapId]['rect'][3])
+                                  height = self.instruction[mapId]['rect'][3])
         
         cmd = ['ps.map', '--overwrite']
         if os.path.splitext(filename)[1] == '.eps':
@@ -268,17 +268,17 @@
             self.SetStatusText(_('Generating PostScript...'), 0)
         else:
             self.SetStatusText(_('Generating preview...'), 0)
-         
+            
         self.cmdThread.RunCmd(cmd, userData = {'instrFile' : instrFile, 'filename' : filename,
-                                            'pdfname' : pdfname, 'temp' : temp, 'regionOld' : regOld})
+                                               'pdfname' : pdfname, 'temp' : temp, 'regionOld' : regOld})
         
     def OnCmdDone(self, event):
         """!ps.map process finished"""
         
         if event.returncode != 0:
             GMessage(parent = self,
-                   message = _("Ps.map exited with return code %s") % event.returncode)
-                
+                     message = _("Ps.map exited with return code %s") % event.returncode)
+            
             grass.try_remove(event.userData['instrFile'])
             if event.userData['temp']:
                 grass.try_remove(event.userData['filename']) 
@@ -292,12 +292,12 @@
                 ret = proc.wait()                        
                 if ret > 0:
                     GMessage(parent = self,
-                    message = _("ps2pdf exited with return code %s") % ret)
+                             message = _("ps2pdf exited with return code %s") % ret)
 
             except OSError, e:
                 GError(parent = self,
                        message = _("Program ps2pdf is not available. Please install it to create PDF.\n\n %s") % e)
-          
+                
         # show preview only when user doesn't want to create ps or pdf 
         if haveImage and event.userData['temp'] and not event.userData['pdfname']:
             RunCommand('g.region', cols = event.userData['regionOld']['cols'], rows = event.userData['regionOld']['rows'])
@@ -350,9 +350,9 @@
             mapName = ''
             
         filename = ''
-        dlg = wx.FileDialog(self, message = "Save file as", defaultDir = "", 
+        dlg = wx.FileDialog(self, message = _("Save file as"), defaultDir = "", 
                             defaultFile = mapName, wildcard = wildcard,
-                            style = wx.CHANGE_DIR|wx.SAVE|wx.OVERWRITE_PROMPT)
+                            style = wx.CHANGE_DIR | wx.SAVE | wx.OVERWRITE_PROMPT)
         if dlg.ShowModal() == wx.ID_OK:
             filename = dlg.GetPath()
             suffix = suffix[dlg.GetFilterIndex()]
@@ -363,14 +363,14 @@
             
         dlg.Destroy()
         return filename
-                        
+    
     def OnInstructionFile(self, event):
         filename = self.getFile(wildcard = "*.psmap|*.psmap|Text file(*.txt)|*.txt|All files(*.*)|*.*")        
         if filename:    
             instrFile = open(filename, "w")
             instrFile.write(self.InstructionFile())
             instrFile.close()   
-                     
+            
     def OnLoadFile(self, event):
         """!Load file and read instructions"""
         #find file
@@ -400,7 +400,7 @@
             #self.canvas.ZoomAll()
             
             self.DialogDataChanged(self.objectId)
-                        
+            
     def OnPageSetup(self, event = None):
         """!Specify paper size, margins and orientation"""
         id = self.instruction.FindInstructionByType('page').id
@@ -423,7 +423,7 @@
         self.mouse["use"] = "pan"
         self.canvas.SetCursor(self.cursors["hand"])
         self.previewCanvas.SetCursor(self.cursors["hand"])
-            
+        
     def OnZoomIn(self, event):
         self.toolbar.OnTool(event)
         self.mouse["use"] = "zoomin"
@@ -480,7 +480,7 @@
         
         
         if mapId: # map exists
-             
+            
             self.toolbar.ToggleTool(self.actionOld, True)
             self.toolbar.ToggleTool(self.toolbar.action['id'], False)
             self.toolbar.action['id'] = self.actionOld
@@ -488,7 +488,7 @@
                 self.canvas.SetCursor(self.cursorOld) 
             except AttributeError:
                 pass
-   
+            
 ##            dlg = MapDialog(parent = self, id  = id, settings = self.instruction,
 ##                            notebook = notebook)
 ##            dlg.ShowModal()  
@@ -500,10 +500,10 @@
                     self.openDialogs['raster'].OnOK(event = None)
                 if 'vector' in self.openDialogs:
                     self.openDialogs['vector'].OnOK(event = None)
-                        
+                    
                 if 'mapNotebook' not in self.openDialogs:
                     dlg = MapDialog(parent = self, id  = id, settings = self.instruction,
-                                notebook = notebook)
+                                    notebook = notebook)
                     self.openDialogs['mapNotebook'] = dlg
                 self.openDialogs['mapNotebook'].Show()
             else:
@@ -512,10 +512,10 @@
                 else:
                     if 'map' not in self.openDialogs:
                         dlg = MapDialog(parent = self, id  = id, settings = self.instruction,
-                                    notebook = notebook)
+                                        notebook = notebook)
                         self.openDialogs['map'] = dlg
                     self.openDialogs['map'].Show()
- 
+                    
 
         else:    # sofar no map
             self.mouse["use"] = "addMap"
@@ -547,7 +547,7 @@
                 dlg = RasterDialog(self, id = id, settings = self.instruction)
                 self.openDialogs['raster'] = dlg
             self.openDialogs['raster'].Show()
-                
+            
     def OnAddVect(self, event):
         """!Add vector map"""
         if self.instruction.FindInstructionByType('vector'):
@@ -668,7 +668,7 @@
             return wx.Rect(x,y, *textExtent)
         else:
             return wx.Rect(X, Y, abs(W), abs(H)).Inflate(h,h) 
-       
+        
     def getTextExtent(self, textDict):
         fontsize = str(textDict['fontsize'] * self.canvas.currScale)
         #fontsize = str(fontsize if fontsize >= 4 else 4)
@@ -727,7 +727,7 @@
         # delete from instructions
         del self.instruction[id]
 
-            
+        
 
         
 
@@ -741,10 +741,9 @@
             itype = self.instruction[id].type
             
             if itype in ('scalebar', 'mapinfo'):
-                drawRectangle = self.canvas.CanvasPaperCoordinates(
-                                    rect = self.instruction[id]['rect'], canvasToPaper = False)
-                self.canvas.Draw( pen = self.pen[itype], brush = self.brush[itype],
-                                pdc = self.canvas.pdcObj, drawid = id, pdctype = 'rectText', bb = drawRectangle)
+                drawRectangle = self.canvas.CanvasPaperCoordinates(rect = self.instruction[id]['rect'], canvasToPaper = False)
+                self.canvas.Draw(pen = self.pen[itype], brush = self.brush[itype],
+                                 pdc = self.canvas.pdcObj, drawid = id, pdctype = 'rectText', bb = drawRectangle)
                 self.canvas.RedrawSelectBox(id)
                 
                 
@@ -782,7 +781,7 @@
                 self.canvas.RedrawSelectBox(id)
                 
             if itype in ('map', 'vector', 'raster'):
-                    
+                
                 if itype == 'raster':#set resolution
                     resol = RunCommand('r.info', read = True, flags = 's', map = self.instruction[id]['raster'])
                     resol = grass.parse_key_val(resol, val_type = float)
@@ -796,15 +795,15 @@
                 #check resolution
                 if itype == 'raster':
                     SetResolution(dpi = self.instruction[id]['resolution'], 
-                                    width = self.instruction[id]['rect'].width,
-                                    height = self.instruction[id]['rect'].height)   
+                                  width = self.instruction[id]['rect'].width,
+                                  height = self.instruction[id]['rect'].height)   
                 rectCanvas = self.canvas.CanvasPaperCoordinates(rect = self.instruction[id]['rect'],
-                                                                    canvasToPaper = False)
+                                                                canvasToPaper = False)
                 self.canvas.RecalculateEN()
                 self.canvas.UpdateMapLabel()
                 
-                self.canvas.Draw( pen = self.pen['map'], brush = self.brush['map'],
-                                pdc = self.canvas.pdcObj, drawid = id, pdctype = 'rectText', bb = rectCanvas)
+                self.canvas.Draw(pen = self.pen['map'], brush = self.brush['map'],
+                                 pdc = self.canvas.pdcObj, drawid = id, pdctype = 'rectText', bb = rectCanvas)
                 # redraw select box  
                 self.canvas.RedrawSelectBox(id)
                 self.canvas.pdcTmp.RemoveId(self.canvas.idZoomBoxTmp)
@@ -814,8 +813,8 @@
             if itype == 'rasterLegend':
                 if self.instruction[id]['rLegend']:
                     drawRectangle = self.canvas.CanvasPaperCoordinates(rect = self.instruction[id]['rect'], canvasToPaper = False)
-                    self.canvas.Draw( pen = self.pen[itype], brush = self.brush[itype],
-                                        pdc = self.canvas.pdcObj, drawid = id, pdctype = 'rectText', bb = drawRectangle)
+                    self.canvas.Draw(pen = self.pen[itype], brush = self.brush[itype],
+                                     pdc = self.canvas.pdcObj, drawid = id, pdctype = 'rectText', bb = drawRectangle)
                     self.canvas.RedrawSelectBox(id)
                 else:
                     self.deleteObject(id)
@@ -825,8 +824,8 @@
                     self.deleteObject(id)
                 elif self.instruction[id]['vLegend']:
                     drawRectangle = self.canvas.CanvasPaperCoordinates(rect = self.instruction[id]['rect'], canvasToPaper = False)
-                    self.canvas.Draw( pen = self.pen[itype], brush = self.brush[itype],
-                                        pdc = self.canvas.pdcObj, drawid = id, pdctype = 'rectText', bb = drawRectangle)
+                    self.canvas.Draw(pen = self.pen[itype], brush = self.brush[itype],
+                                     pdc = self.canvas.pdcObj, drawid = id, pdctype = 'rectText', bb = drawRectangle)
                     self.canvas.RedrawSelectBox(id)
 
                 else:
@@ -836,7 +835,7 @@
         """!Flatnotebook page has changed"""
         self.currentPage = self.book.GetPageIndex(self.book.GetCurrentPage())
         
-                
+        
     def OnPageChanging(self, event):
         """!Flatnotebook page is changing"""
         if self.currentPage == 0 and self.mouse['use'] == 'addMap':
@@ -945,9 +944,9 @@
             self.imgName = self.parent.imgName
             
             
- 
+            
         self.currScale = None
-  
+        
         self.Clear()
         
         self.Bind(wx.EVT_ERASE_BACKGROUND, lambda x: None)
@@ -999,8 +998,8 @@
 
         return wx.Rect2D(X, Y, Width, Height)
 
-        
-        
+    
+    
     def SetPage(self):
         """!Sets and changes page, redraws paper"""
         
@@ -1032,7 +1031,7 @@
         r.SetWidth(abs(r.GetWidth()))
         r.SetHeight(abs(r.GetHeight()))
         return r 
-          
+    
     def RecalculateEN(self):
         """!Recalculate east and north for texts (eps, points) after their or map's movement"""
         try:
@@ -1043,7 +1042,7 @@
         texts = self.instruction.FindInstructionByType('text', list = True)
         for text in texts:
             e, n = PaperMapCoordinates(map = self.instruction[mapId], x = self.instruction[text.id]['where'][0],
-                                                y = self.instruction[text.id]['where'][1], paperToMap = True)
+                                       y = self.instruction[text.id]['where'][1], paperToMap = True)
             self.instruction[text.id]['east'], self.instruction[text.id]['north'] = e, n
             
     def OnPaint(self, event):
@@ -1102,7 +1101,7 @@
             self.begin = self.mouse['begin']
             if self.mouse['use'] in ('pan', 'zoomin', 'zoomout', 'addMap'):
                 pass
-                
+            
             #select
             if self.mouse['use'] == 'pointer':
                 found = self.pdcObj.FindObjects(self.mouse['begin'][0], self.mouse['begin'][1])
@@ -1131,8 +1130,8 @@
                     self.pdcTmp.RemoveId(self.idBoxTmp)
                     self.pdcTmp.RemoveId(self.idResizeBoxTmp)
                     self.Refresh()           
-          
-                   
+                    
+                    
         elif event.Dragging() and event.LeftIsDown():
             #draw box when zooming, creating map 
             if self.mouse['use'] in ('zoomin', 'zoomout', 'addMap'):
@@ -1141,8 +1140,8 @@
                             self.mouse['end'][0]-self.mouse['begin'][0], self.mouse['end'][1]-self.mouse['begin'][1])
                 r = self.modifyRectangle(r)
                 self.Draw(pen = self.pen['box'], brush = self.brush['box'], pdc = self.pdcTmp, drawid = self.idZoomBoxTmp,
-                            pdctype = 'rect', bb = r)
-                            
+                          pdctype = 'rect', bb = r)
+                
             # panning                
             if self.mouse["use"] == 'pan':
                 self.mouse['end'] = event.GetPosition()
@@ -1161,7 +1160,7 @@
                 self.pdcTmp.TranslateId(self.idResizeBoxTmp, dx, dy)
                 if self.instruction[self.dragId].type == 'text': 
                     self.instruction[self.dragId]['coords'] = self.instruction[self.dragId]['coords'][0] + dx,\
-                                                            self.instruction[self.dragId]['coords'][1] + dy
+                        self.instruction[self.dragId]['coords'][1] + dy
                 self.begin = event.GetPosition()
                 self.Refresh()
                 
@@ -1190,7 +1189,7 @@
                 
                 bounds = wx.Rect(x, y, newWidth, newHeight)    
                 self.Draw(pen = self.pen[type], brush = self.brush[type], pdc = self.pdcObj, drawid = self.dragId,
-                            pdctype = 'rectText', bb = bounds)
+                          pdctype = 'rectText', bb = bounds)
                 self.RedrawSelectBox(self.dragId)
                 
         elif event.LeftUp():
@@ -1214,7 +1213,7 @@
                 rectPaper = self.CanvasPaperCoordinates(rect = rectTmp, canvasToPaper = True)                
                 
                 dlg = MapDialog(parent = self.parent, id = [None, None, None], settings = self.instruction, 
-                                         rect = rectPaper)
+                                rect = rectPaper)
                 self.openDialogs['map'] = dlg
                 self.openDialogs['map'].Show()
                 
@@ -1225,7 +1224,7 @@
                 self.parent.toolbar.ToggleTool(self.parent.actionOld, True)
                 self.parent.toolbar.ToggleTool(self.parent.toolbar.action['id'], False)
                 self.parent.toolbar.action['id'] = self.parent.actionOld
-                    
+                
 
 
             # resize resizable objects (only map sofar)
@@ -1242,31 +1241,31 @@
                         if self.instruction[mapId]['scaleType'] == 0:
                             
                             scale, foo, rect = AutoAdjust(self, scaleType = 0,
-                                                        map = self.instruction[mapId]['map'],
-                                                        mapType = self.instruction[mapId]['mapType'], 
-                                                        rect = self.instruction[mapId]['rect'])
+                                                          map = self.instruction[mapId]['map'],
+                                                          mapType = self.instruction[mapId]['mapType'], 
+                                                          rect = self.instruction[mapId]['rect'])
                             
                         elif self.instruction[mapId]['scaleType'] == 1:
                             scale, foo, rect = AutoAdjust(self, scaleType = 1,
-                                                        region = self.instruction[mapId]['region'],
-                                                        rect = self.instruction[mapId]['rect'])
+                                                          region = self.instruction[mapId]['region'],
+                                                          rect = self.instruction[mapId]['rect'])
                         else:
                             scale, foo, rect = AutoAdjust(self, scaleType = 2,
-                                                        rect = self.instruction[mapId]['rect'])
+                                                          rect = self.instruction[mapId]['rect'])
                         self.instruction[mapId]['rect'] = rect
                         self.instruction[mapId]['scale'] = scale
                         
                         rectCanvas = self.CanvasPaperCoordinates(rect = rect, canvasToPaper = False)
                         self.Draw(pen = self.pen['map'], brush = self.brush['map'],
-                                    pdc = self.pdcObj, drawid = mapId, pdctype = 'rectText', bb = rectCanvas)
-                                    
+                                  pdc = self.pdcObj, drawid = mapId, pdctype = 'rectText', bb = rectCanvas)
+                        
                     elif self.instruction[mapId]['scaleType'] == 3:
                         ComputeSetRegion(self, mapDict = self.instruction[mapId].GetInstruction())
                     #check resolution
                     SetResolution(dpi = self.instruction[mapId]['resolution'],
-                                    width = self.instruction[mapId]['rect'].width,
-                                    height = self.instruction[mapId]['rect'].height)
-                        
+                                  width = self.instruction[mapId]['rect'].width,
+                                  height = self.instruction[mapId]['rect'].height)
+                    
                     self.RedrawSelectBox(mapId)
                     self.Zoom(zoomFactor = 1, view = (0, 0))
                 self.mouse['use'] = 'pointer'
@@ -1293,32 +1292,32 @@
                 type = self.instruction[self.dragId].type
                 itemCall[type](**itemArg[type])
 
-                    
-                    
                 
+                
+                
     def RecalculatePosition(self, ids):
         for id in ids:
             itype = self.instruction[id].type
             if itype == 'map':
-                        self.instruction[id]['rect'] = self.CanvasPaperCoordinates(rect = self.pdcObj.GetIdBounds(id),
-                                                                    canvasToPaper = True)
-                        self.RecalculateEN()
-                        
+                self.instruction[id]['rect'] = self.CanvasPaperCoordinates(rect = self.pdcObj.GetIdBounds(id),
+                                                                           canvasToPaper = True)
+                self.RecalculateEN()
+                
             elif itype in ('mapinfo' ,'rasterLegend', 'vectorLegend'):
                 self.instruction[id]['rect'] = self.CanvasPaperCoordinates(rect = self.pdcObj.GetIdBounds(id),
-                                                            canvasToPaper = True)
+                                                                           canvasToPaper = True)
                 self.instruction[id]['where'] = self.CanvasPaperCoordinates(rect = self.pdcObj.GetIdBounds(id),
-                                                            canvasToPaper = True)[:2]            
+                                                                            canvasToPaper = True)[:2]            
             elif  itype == 'scalebar':
                 self.instruction[id]['rect'] = self.CanvasPaperCoordinates(rect = self.pdcObj.GetIdBounds(id),
-                                                            canvasToPaper = True)
+                                                                           canvasToPaper = True)
 
                 
                 self.instruction[id]['where'] = self.instruction[id]['rect'].GetCentre()
-                                                             
+                
             elif  itype == 'text':
                 x, y = self.instruction[id]['coords'][0] - self.instruction[id]['xoffset'],\
-                        self.instruction[id]['coords'][1] + self.instruction[id]['yoffset']
+                    self.instruction[id]['coords'][1] + self.instruction[id]['yoffset']
                 extent = self.parent.getTextExtent(textDict = self.instruction[id])
                 if self.instruction[id]['rotate'] is not None:
                     rot = float(self.instruction[id]['rotate'])/180*pi 
@@ -1337,7 +1336,7 @@
                     y -= extent[0]/2 * sin(rot)
                 
                 self.instruction[id]['where'] = self.CanvasPaperCoordinates(rect = wx.Rect2D(x, y, 0, 0),
-                                                            canvasToPaper = True)[:2]
+                                                                            canvasToPaper = True)[:2]
                 self.RecalculateEN()
         
     def ComputeZoom(self, rect):
@@ -1379,8 +1378,8 @@
                     x,y = rect.GetX(), rect.GetY() + (rH-(cH/cW)*rW)/2
                     xView, yView = -x, -y
         return zoomFactor, (int(xView), int(yView))
-               
-                
+    
+    
     def Zoom(self, zoomFactor, view):
         """! Zoom to specified region, scroll view, redraw"""
         if not self.currScale:
@@ -1400,15 +1399,15 @@
             #redraw objects
             for id in self.objectId:
                 oRect = self.CanvasPaperCoordinates(
-                                    rect = self.instruction[id]['rect'], canvasToPaper = False)
-                    
+                    rect = self.instruction[id]['rect'], canvasToPaper = False)
+                
                 type = self.instruction[id].type
                 if type == 'text':
                     coords = self.instruction[id]['coords']# recalculate coordinates, they are not equal to BB
                     self.instruction[id]['coords'] = coords = [(int(coord) - view[i]) * zoomFactor
-                                                                        for i, coord in enumerate(coords)]
+                                                               for i, coord in enumerate(coords)]
                     self.DrawRotText(pdc = self.pdcObj, drawId = id, textDict = self.instruction[id],
-                     coords = coords, bounds = oRect )
+                                     coords = coords, bounds = oRect )
                     extent = self.parent.getTextExtent(textDict = self.instruction[id])
                     if self.instruction[id]['rotate']:
                         rot = float(self.instruction[id]['rotate']) 
@@ -1419,7 +1418,7 @@
                     self.pdcObj.SetIdBounds(id, bounds)
                 else:
                     self.Draw(pen = self.pen[type], brush = self.brush[type], pdc = self.pdcObj,
-                            drawid = id, pdctype = 'rectText', bb = oRect)
+                              drawid = id, pdctype = 'rectText', bb = oRect)
             #redraw tmp objects
             if self.dragId != -1:
                 self.RedrawSelectBox(self.dragId)
@@ -1442,7 +1441,7 @@
         zoomP = bounds.Inflate(bounds.width/20, bounds.height/20)
         zoomFactor, view = self.ComputeZoom(zoomP)
         self.Zoom(zoomFactor, view)
-                    
+        
     def Draw(self, pen, brush, pdc, drawid = None, pdctype = 'rect', bb = wx.Rect(0,0,0,0)): 
         """! Draw object"""    
         if drawid is None:
@@ -1587,7 +1586,7 @@
                 ids.append(self.idResizeBoxTmp)
             for id, type, rect in zip(ids, type, rect):
                 self.Draw(pen = self.pen[type], brush = self.brush[type], pdc = self.pdcTmp,
-                            drawid = id, pdctype = 'rect', bb = rect)
+                          drawid = id, pdctype = 'rect', bb = rect)
         
     def UpdateMapLabel(self):
         """!Updates map frame label"""
@@ -1607,7 +1606,7 @@
         rasterName = 'None'
         if rasterId:
             rasterName = self.instruction[rasterId]['raster'].split('@')[0]
-                            
+            
         self.itemLabels['map'] = self.itemLabels['map'][0:1]
         self.itemLabels['map'].append("raster: " + rasterName)
         if vectorId: 
@@ -1636,12 +1635,12 @@
         # re-render image on idle
         self.resize = True
 
-            
+        
     def ScaleRect(self, rect, scale):
         """! Scale rectangle"""
         return wx.Rect(rect.GetLeft()*scale, rect.GetTop()*scale,
-                    rect.GetSize()[0]*scale, rect.GetSize()[1]*scale)   
-                     
+                       rect.GetSize()[0]*scale, rect.GetSize()[1]*scale)   
+    
 def main():
     app = wx.PySimpleApp()
     wx.InitAllImageHandlers()

Modified: grass/trunk/gui/wxpython/gui_modules/psmap_dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/psmap_dialogs.py	2011-06-01 19:47:43 UTC (rev 46488)
+++ grass/trunk/gui/wxpython/gui_modules/psmap_dialogs.py	2011-06-01 20:12:39 UTC (rev 46489)
@@ -1,7 +1,7 @@
 """!
- at package psmap_dialogs
+ at package psmap_dialogs.py
 
- at brief map feature objects and dialogs for ps.map
+ at brief Map feature objects and dialogs for ps.map
 
 Classes:
  - UnitConversion
@@ -127,7 +127,7 @@
         return TCValidator(self.flag)
 
     def Validate(self, win):
-       
+        
         tc = self.GetWindow()
         val = tc.GetValue()
 
@@ -183,16 +183,16 @@
         dc.SetPen(pen)
 
         # for painting the items in the popup
-        dc.DrawText(self.GetString( item ),
+        dc.DrawText(self.GetString(item ),
                     r.x + 3,
-                    (r.y + 0) + ( (r.height/2) - dc.GetCharHeight() )/2
+                    (r.y + 0) + ((r.height/2) - dc.GetCharHeight() )/2
                     )
-        dc.DrawLine( r.x+5, r.y+((r.height/4)*3)+1, r.x+r.width - 5, r.y+((r.height/4)*3)+1 )
+        dc.DrawLine(r.x+5, r.y+((r.height/4)*3)+1, r.x+r.width - 5, r.y+((r.height/4)*3)+1 )
 
-           
+        
     def OnDrawBackground(self, dc, rect, item, flags):
         """!Overridden from OwnerDrawnComboBox, called for drawing the
-            background area of each item."""
+        background area of each item."""
         # If the item is selected, or its item # iseven, or we are painting the
         # combo control itself, then use the default rendering.
         if (item & 1 == 0 or flags & (wx.combo.ODCB_PAINTING_CONTROL |
@@ -208,12 +208,12 @@
 
     def OnMeasureItem(self, item):
         """!Overridden from OwnerDrawnComboBox, should return the height
-            needed to display an item in the popup, or -1 for default"""
+        needed to display an item in the popup, or -1 for default"""
         return 30
 
     def OnMeasureItemWidth(self, item):
         """!Overridden from OwnerDrawnComboBox.  Callback for item width, or
-            -1 for default/undetermined"""
+        -1 for default/undetermined"""
         return -1; # default - will be measured from text width  
     
     
@@ -221,7 +221,7 @@
     """!List control for managing order and labels of vector maps in legend"""
     def __init__(self, parent):
         wx.ListCtrl.__init__(self, parent, id = wx.ID_ANY, 
-                style = wx.LC_REPORT|wx.LC_SINGLE_SEL|wx.BORDER_SUNKEN|wx.LC_VRULES|wx.LC_HRULES)
+                             style = wx.LC_REPORT|wx.LC_SINGLE_SEL|wx.BORDER_SUNKEN|wx.LC_VRULES|wx.LC_HRULES)
         CheckListCtrlMixin.__init__(self) 
         ListCtrlAutoWidthMixin.__init__(self)
         
@@ -258,7 +258,7 @@
             if each.id == id:
                 return True
         return False
-        
+    
     def __delitem__(self, id):
         """!Delete instruction"""
         for each in self.instruction:
@@ -301,7 +301,7 @@
         if len(inst) == 1 and not list:
             return inst[0]
         return inst
-        
+    
     def Read(self, filename):
         """!Reads instruction file and creates instruction objects"""
         self.filename = filename
@@ -468,17 +468,17 @@
             
             #estimate size
             height = rasterLegend.EstimateHeight(raster = rasterLegend['raster'], discrete = rasterLegend['discrete'], 
-                                        fontsize = rasterLegend['fontsize'],
-                                        cols = rasterLegend['cols'], 
-                                        height = rasterLegend['height'])
+                                                 fontsize = rasterLegend['fontsize'],
+                                                 cols = rasterLegend['cols'], 
+                                                 height = rasterLegend['height'])
             width = rasterLegend.EstimateWidth(raster = rasterLegend['raster'], discrete = rasterLegend['discrete'], 
-                                        fontsize = rasterLegend['fontsize'],
-                                        cols = rasterLegend['cols'] , 
-                                        width = rasterLegend['width'],
-                                        paperInstr = page)
+                                               fontsize = rasterLegend['fontsize'],
+                                               cols = rasterLegend['cols'] , 
+                                               width = rasterLegend['width'],
+                                               paperInstr = page)
             rasterLegend['rect'] = wx.Rect2D(x = float(rasterLegend['where'][0]), y = float(rasterLegend['where'][1]),
-                                                w = width, h = height)
-                
+                                             w = width, h = height)
+            
         # vectors, vlegend        
         
         if vector:
@@ -490,9 +490,9 @@
                         vector['list'][i][3] = vmap['lpos']
             if vectorLegend:
                 size = vectorLegend.EstimateSize(vectorInstr = vector, fontsize = vectorLegend['fontsize'],
-                                            width = vectorLegend['width'], cols = vectorLegend['cols'])                            
+                                                 width = vectorLegend['width'], cols = vectorLegend['cols'])                            
                 vectorLegend['rect'] = wx.Rect2D(x = float(vectorLegend['where'][0]), y = float(vectorLegend['where'][1]),
-                                                    w = size[0], h = size[1])
+                                                 w = size[0], h = size[1])
         
         
         page = self.FindInstructionByType('page')
@@ -503,36 +503,36 @@
 
         #
         return True
-        
+    
     def SendToRead(self, instruction, text, **kwargs):
         #print 'send to read', instruction, text
-        psmapInstrDict = dict(  paper = ['page'],
-                                maploc = ['map'],
-                                scale = ['map'],
-                                border = ['map'],
-                                raster = ['raster'],
-                                mapinfo = ['mapinfo'],
-                                scalebar = ['scalebar'],
-                                text = ['text'],
-                                vpoints = ['vector', 'vProperties'],
-                                vlines = ['vector', 'vProperties'],
-                                vareas = ['vector', 'vProperties'],
-                                colortable = ['rasterLegend'],
-                                vlegend = ['vectorLegend']
-                            )
+        psmapInstrDict = dict(paper = ['page'],
+                              maploc = ['map'],
+                              scale = ['map'],
+                              border = ['map'],
+                              raster = ['raster'],
+                              mapinfo = ['mapinfo'],
+                              scalebar = ['scalebar'],
+                              text = ['text'],
+                              vpoints = ['vector', 'vProperties'],
+                              vlines = ['vector', 'vProperties'],
+                              vareas = ['vector', 'vProperties'],
+                              colortable = ['rasterLegend'],
+                              vlegend = ['vectorLegend']
+                              )
         
-        myInstrDict = dict( page = PageSetup,
-                            map = MapFrame,
-                            raster = Raster,
-                            mapinfo = Mapinfo,
-                            scalebar = Scalebar,
-                            text = Text,
-                            rasterLegend = RasterLegend,
-                            vectorLegend = VectorLegend,
-                            vector = Vector,
-                            vProperties = VProperties
-                        )
-         
+        myInstrDict = dict(page = PageSetup,
+                           map = MapFrame,
+                           raster = Raster,
+                           mapinfo = Mapinfo,
+                           scalebar = Scalebar,
+                           text = Text,
+                           rasterLegend = RasterLegend,
+                           vectorLegend = VectorLegend,
+                           vector = Vector,
+                           vProperties = VProperties
+                           )
+        
         myInstruction = psmapInstrDict[instruction]
         
         for i in myInstruction:
@@ -557,7 +557,7 @@
                 if not ok:
                     return False
         return True
-          
+    
     def SetRegion(self, regionInstruction):
         """!Sets region from file comment or sets current region in case of no comment"""
         map = MapFrame(wx.NewId())
@@ -595,7 +595,7 @@
         except grass.ScriptError, e:
             GError(_("Region cannot be set\n%s") % e)
             return False
-          
+        
 
 class InstructionObject:
     """!Abtract class representing single instruction"""
@@ -612,13 +612,13 @@
     def __str__(self):
         """!Returns particular part of text instruction"""
         return ''
-        
+    
     def __getitem__(self, key):
         for each in self.instruction.keys():
             if each == key:
                 return self.instruction[key]
         return None
-               
+    
     def __setitem__(self, key, value):
         self.instruction[key] = value
     
@@ -633,7 +633,7 @@
     def Read(self, instruction, text, **kwargs):
         """!Read instruction and save them"""
         pass
-        
+    
 class InitMap(InstructionObject):
     """!Class representing virtual map"""
     def __init__(self, id):
@@ -644,7 +644,7 @@
         self.defaultInstruction = dict(rect = None, scale =  None)
         # current values
         self.instruction = dict(self.defaultInstruction)
-            
+        
     
 class MapFrame(InstructionObject):
     """!Class representing map (instructions maploc, scale, border)"""
@@ -652,9 +652,9 @@
         InstructionObject.__init__(self, id = id)
         self.type = 'map'
         # default values
-        self.defaultInstruction = dict( map = None, mapType = None, drawMap = True, region = None,
-                                        rect = wx.Rect2D(), scaleType = 0, scale = None, center = None,
-                                        resolution = 300, border = 'y', width = 1, color = '0:0:0') 
+        self.defaultInstruction = dict(map = None, mapType = None, drawMap = True, region = None,
+                                       rect = wx.Rect2D(), scaleType = 0, scale = None, center = None,
+                                       resolution = 300, border = 'y', width = 1, color = '0:0:0') 
         # current values
         self.instruction = dict(self.defaultInstruction)
         
@@ -702,13 +702,13 @@
         instr += '\n'
 
         return instr  
-     
+    
     def Read(self, instruction, text, **kwargs):
         """!Read instruction and save information"""
         if 'isRegionComment' in kwargs:
             isRegionComment = kwargs['isRegionComment']
         instr = {}
-            
+        
         if instruction == 'border':
             for line in text:
                 if line.startswith('end'):
@@ -726,7 +726,7 @@
                 except IndexError:
                     GError(_("Failed to read instruction %s") % instruction)
                     return False
-                    
+                
         elif instruction == 'scale':
             try:
                 scaleText = text.strip('scale ').split(':')[1]
@@ -747,16 +747,16 @@
             maploc = text.strip('maploc ').split()
             if len(maploc) >= 2:
                 if  abs(self.instruction['rect'].Get()[0] - float(maploc[0])) > 0.5 or \
-                    abs(self.instruction['rect'].Get()[1] - float(maploc[1])) > 0.5:
+                        abs(self.instruction['rect'].Get()[1] - float(maploc[1])) > 0.5:
                     GWarning(_("Map frame position changed, old value: %s %s\nnew value: %s %s") % \
-                        (maploc[0], maploc[1], self.instruction['rect'].Get()[0], self.instruction['rect'].Get()[1]))
+                                 (maploc[0], maploc[1], self.instruction['rect'].Get()[0], self.instruction['rect'].Get()[1]))
                     
                 #instr['rect'] = wx.Rect2D(float(maploc[0]), float(maploc[1]), self.instruction['rect'][2], self.instruction['rect'][3])
             if len(maploc) == 4:
                 if  abs(self.instruction['rect'].Get()[2] - float(maploc[2])) > 0.5 or \
-                    abs(self.instruction['rect'].Get()[3] - float(maploc[3])) > 0.5:
+                        abs(self.instruction['rect'].Get()[3] - float(maploc[3])) > 0.5:
                     GWarning(_("Map frame size changed, old value: %s %s\nnew value: %s %s") %(
-                                            maploc[2], maploc[3], self.instruction['rect'].Get()[2], self.instruction['rect'].Get()[3]))
+                            maploc[2], maploc[3], self.instruction['rect'].Get()[2], self.instruction['rect'].Get()[3]))
                 #instr['rect'] = wx.Rect2D(*map(float, maploc))
         self.instruction.update(instr)   
         return True 
@@ -768,7 +768,7 @@
         self.type = 'page'
         # default values
         self.defaultInstruction = dict(Units = 'inch', Format = 'a4', Orientation = 'Portrait',
-                                        Width = 8.268, Height = 11.693, Left = 0.5, Right = 0.5, Top = 1, Bottom = 1)
+                                       Width = 8.268, Height = 11.693, Left = 0.5, Right = 0.5, Top = 1, Bottom = 1)
         # current values
         self.instruction = dict(self.defaultInstruction)
         
@@ -826,7 +826,7 @@
         for line in paperStr.strip().split('\n'):
             d = dict(zip(self.cats, line.split()[1:]))
             sizeDict[line.split()[0]] = d
-       
+            
         return sizeDict    
     
 class Mapinfo(InstructionObject):
@@ -835,10 +835,10 @@
         InstructionObject.__init__(self, id = id)
         self.type = 'mapinfo'
         # default values
-        self.defaultInstruction = dict( unit = 'inch', where = (0, 0),
-                                            font = 'Helvetica', fontsize = 10, color = 'black', background = 'none', 
-                                            #font = 'Sans', fontsize = 10, color = '0:0:0', background = 'none', 
-                                            border = 'none', rect = None)
+        self.defaultInstruction = dict(unit = 'inch', where = (0, 0),
+                                       font = 'Helvetica', fontsize = 10, color = 'black', background = 'none', 
+                                       #font = 'Sans', fontsize = 10, color = '0:0:0', background = 'none', 
+                                       border = 'none', rect = None)
         # current values
         self.instruction = dict(self.defaultInstruction)
         
@@ -882,7 +882,7 @@
         width = self.unitConv.convert(value = w, fromUnit = 'point', toUnit = 'inch')
         height = self.unitConv.convert(value = h, fromUnit = 'point', toUnit = 'inch')
         return wx.Rect2D(x = float(mapinfoDict['where'][0]), y = float(mapinfoDict['where'][1]), w = width, h = height)
-        
+    
 class Text(InstructionObject):
     """!Class representing text instruction"""
     def __init__(self, id):
@@ -890,9 +890,9 @@
         self.type = 'text'
         # default values
         self.defaultInstruction = dict(text = "", font = "Helvetica", fontsize = 10, color = 'black', background = 'none',
-                                        hcolor = 'none', hwidth = 1, border = 'none', width = '1', XY = True,
-                                        where = (0,0), unit = 'inch', rotate = None, 
-                                        ref = "center center", xoffset = 0, yoffset = 0, east = None, north = None)
+                                       hcolor = 'none', hwidth = 1, border = 'none', width = '1', XY = True,
+                                       where = (0,0), unit = 'inch', rotate = None, 
+                                       ref = "center center", xoffset = 0, yoffset = 0, east = None, north = None)
         # current values
         self.instruction = dict(self.defaultInstruction)
         
@@ -962,7 +962,7 @@
                 elif sub == 'opaque':
                     if line.split(None, 1)[1].lower() in ('n', 'none'):
                         instr['background'] = 'none'
-         
+                        
             except(IndexError, ValueError):
                 GError(_("Failed to read instruction %s") % instruction)
                 return False
@@ -985,11 +985,11 @@
         InstructionObject.__init__(self, id = id)
         self.type = 'scalebar'
         # default values
-        self.defaultInstruction = dict( unit = 'inch', where = (1,1),
-                                            unitsLength = 'auto', unitsHeight = 'inch',
-                                            length = None, height = 0.1, rect = None,
-                                            fontsize = 10, background = 'y',
-                                            scalebar = 'f', segment = 4, numbers = 1)
+        self.defaultInstruction = dict(unit = 'inch', where = (1,1),
+                                       unitsLength = 'auto', unitsHeight = 'inch',
+                                       length = None, height = 0.1, rect = None,
+                                       fontsize = 10, background = 'y',
+                                       scalebar = 'f', segment = 4, numbers = 1)
         # current values
         self.instruction = dict(self.defaultInstruction)
         
@@ -1037,7 +1037,7 @@
             except(IndexError, ValueError):
                 GError(_("Failed to read instruction %s") % instruction)
                 return False
-                
+            
         self.instruction.update(instr)
         w, h = self.EstimateSize(scalebarDict = self.instruction, scale = scale)
         x = self.instruction['where'][0] - w / 2 
@@ -1067,12 +1067,12 @@
         self.type = 'rasterLegend'
         # default values
         self.defaultInstruction = dict(rLegend = False, unit = 'inch', rasterDefault = True, raster = None,
-                                                discrete = None, type = None,
-                                                where = (0, 0),
-                                                width = None, height = None, cols = 1, font = "Helvetica", fontsize = 10,
-                                                #color = '0:0:0', tickbar = False, range = False, min = 0, max = 0,
-                                                color = 'black', tickbar = 'n', range = False, min = 0, max = 0,
-                                                nodata = 'n')
+                                       discrete = None, type = None,
+                                       where = (0, 0),
+                                       width = None, height = None, cols = 1, font = "Helvetica", fontsize = 10,
+                                       #color = '0:0:0', tickbar = False, range = False, min = 0, max = 0,
+                                       color = 'black', tickbar = 'n', range = False, min = 0, max = 0,
+                                       nodata = 'n')
         # current values
         self.instruction = dict(self.defaultInstruction)
         
@@ -1093,7 +1093,7 @@
             instr += string.Template("    cols $cols\n").substitute(self.instruction)
             instr += string.Template("    nodata $nodata\n").substitute(self.instruction)
         instr += string.Template("    font $font\n    fontsize $fontsize\n    color $color\n")\
-                                .substitute(self.instruction)
+            .substitute(self.instruction)
         instr += "    end"
         return instr    
     
@@ -1179,11 +1179,11 @@
             rinfo = grass.raster_info(raster)
             if rinfo['datatype'] in ('DCELL', 'FCELL'):
                 minim, maxim = rinfo['min'], rinfo['max']
-                rows = ceil( maxim / cols )
+                rows = ceil(maxim / cols )
             else:
                 cat = grass.read_command('r.category', map = raster,
                                     fs = ':').strip().split('\n')
-                rows = ceil( float(len(cat)) / cols )
+                rows = ceil(float(len(cat)) / cols )
                             
                 
             height = self.unitConv.convert(value =  1.5 * rows * fontsize, fromUnit = 'point', toUnit = 'inch')
@@ -2421,8 +2421,8 @@
                 RunCommand('g.region', n = region['north'], s = region['south'],
                             e = region['east'], w = region['west'], rast = self.instruction[rasterId]['raster'])
             else:
-                RunCommand('g.region',  n = region['north'], s = region['south'],
-                                        e = region['east'], w = region['west'])
+                RunCommand('g.region', n = region['north'], s = region['south'],
+                           e = region['east'], w = region['west'])
             
         elif scaleType == 3:
             mapFrameDict['drawMap'] = False
@@ -3806,7 +3806,7 @@
 
         self.rasterCurrent = wx.StaticText(panel, id = wx.ID_ANY,
                                 label = _("%s: type %s" % (self.currRaster, rasterType)))
-        self.rasterSelect = Select( panel, id = wx.ID_ANY, size = globalvar.DIALOG_GSELECT_SIZE,
+        self.rasterSelect = Select(panel, id = wx.ID_ANY, size = globalvar.DIALOG_GSELECT_SIZE,
                                     type = 'raster', multiple = False,
                                     updateOnPopup = True, onPopup = None)
         if not self.rLegendDict['rasterDefault']:
@@ -4437,11 +4437,11 @@
 ##                self.vLegendDict['fontsize'] = font.GetPointSize()
                 dc = wx.PaintDC(self)
                 font = dc.GetFont()
-                dc.SetFont(wx.Font(   pointSize = self.vLegendDict['fontsize'], family = font.GetFamily(),
-                                                style = font.GetStyle(), weight = wx.FONTWEIGHT_NORMAL))
+                dc.SetFont(wx.Font(pointSize = self.vLegendDict['fontsize'], family = font.GetFamily(),
+                                   style = font.GetStyle(), weight = wx.FONTWEIGHT_NORMAL))
                 #size
                 width = self.unitConv.convert(value = float(self.panelVector.widthCtrl.GetValue()),
-                                                        fromUnit = currUnit, toUnit = 'inch')
+                                              fromUnit = currUnit, toUnit = 'inch')
                 self.vLegendDict['width'] = width
                 self.vLegendDict['cols'] = self.panelVector.colsCtrl.GetValue()
                 if self.panelVector.spanRadio.GetValue() and self.panelVector.spanTextCtrl.GetValue():
@@ -4513,7 +4513,7 @@
             currRaster = None
 
         rasterType = getRasterType(map = currRaster)
-        self.rasterCurrent.SetLabel( _("%s: type %s") % (currRaster, str(rasterType)))
+        self.rasterCurrent.SetLabel(_("%s: type %s") % (currRaster, str(rasterType)))
         
         # vector legend
         
@@ -4998,7 +4998,7 @@
             map = self.instruction.FindInstructionByType('initMap')
         mapId = map.id
          
-        rectSize = self.scalebar.EstimateSize( scalebarDict = self.scalebarDict,
+        rectSize = self.scalebar.EstimateSize(scalebarDict = self.scalebarDict,
                                                                 scale = self.instruction[mapId]['scale'])
         self.scalebarDict['rect'] = wx.Rect2D(x = x, y = y, w = rectSize[0], h = rectSize[1])
         self.scalebarDict['where'] = self.scalebarDict['rect'].GetCentre() 
@@ -5420,7 +5420,7 @@
             x = self.unitConv.convert(value = float(x), fromUnit = currUnit, toUnit = 'inch')
             y = self.unitConv.convert(value = float(y), fromUnit = currUnit, toUnit = 'inch')
             self.textDict['where'] = x, y
-            self.textDict['east'], self.textDict['north'] = PaperMapCoordinates( self.instruction[self.mapId], x, y, paperToMap = True)
+            self.textDict['east'], self.textDict['north'] = PaperMapCoordinates(self.instruction[self.mapId], x, y, paperToMap = True)
         else:
             self.textDict['XY'] = False
             if self.eastingCtrl.GetValue():
@@ -5579,7 +5579,7 @@
             currRegionDict = grass.region()
         regionDict = grass.parse_key_val(windFile, sep = ':', val_type = float)
         region = grass.read_command("g.region", flags = 'gu', n = regionDict['north'], s = regionDict['south'],
-                                                                e = regionDict['east'], w = regionDict['west'])
+                                    e = regionDict['east'], w = regionDict['west'])
         currRegionDict = grass.parse_key_val(region, val_type = float)
                                                                 
     else:
@@ -5644,9 +5644,9 @@
         fromM = 1
         if projInfo()['proj'] != 'xy':
             fromM = float(projInfo()['meters'])
-        rectHalfInch = ( mapDict['rect'].width/2, mapDict['rect'].height/2)
-        rectHalfMeter = ( self.unitConv.convert(value = rectHalfInch[0], fromUnit = 'inch', toUnit = 'meter')/ fromM /scale,
-                                self.unitConv.convert(value = rectHalfInch[1], fromUnit = 'inch', toUnit = 'meter')/ fromM /scale) 
+        rectHalfInch = (mapDict['rect'].width/2, mapDict['rect'].height/2)
+        rectHalfMeter = (self.unitConv.convert(value = rectHalfInch[0], fromUnit = 'inch', toUnit = 'meter')/ fromM /scale,
+                         self.unitConv.convert(value = rectHalfInch[1], fromUnit = 'inch', toUnit = 'meter')/ fromM /scale) 
         
         centerE = mapDict['center'][0]
         centerN = mapDict['center'][1]
@@ -5660,15 +5660,15 @@
 
         if rasterId:
             RunCommand('g.region', n = ceil(centerN + rectHalfMeter[1]),
-                           s = floor(centerN - rectHalfMeter[1]),
-                           e = ceil(centerE + rectHalfMeter[0]),
-                           w = floor(centerE - rectHalfMeter[0]),
-                           rast = self.instruction[rasterId]['raster'])
+                       s = floor(centerN - rectHalfMeter[1]),
+                       e = ceil(centerE + rectHalfMeter[0]),
+                       w = floor(centerE - rectHalfMeter[0]),
+                       rast = self.instruction[rasterId]['raster'])
         else:
             RunCommand('g.region', n = ceil(centerN + rectHalfMeter[1]),
-                           s = floor(centerN - rectHalfMeter[1]),
-                           e = ceil(centerE + rectHalfMeter[0]),
-                           w = floor(centerE - rectHalfMeter[0]))
+                       s = floor(centerN - rectHalfMeter[1]),
+                       e = ceil(centerE + rectHalfMeter[0]),
+                       w = floor(centerE - rectHalfMeter[0]))
                     
 def projInfo():
     """!Return region projection and map units information,



More information about the grass-commit mailing list