瀏覽代碼

wxgui: fix warning in sphinx documentation; some pep8 cleanup

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@61886 15284696-431f-4ddb-bdfa-cd5b030d7da7
Luca Delucchi 10 年之前
父節點
當前提交
ada3ec0944

+ 6 - 6
gui/wxpython/animation/provider.py

@@ -82,9 +82,9 @@ class BitmapProvider:
         Applies to 2D mode.
 
         :param cmdsForComposition: list of lists of command lists
-                [[['d.rast', 'map=elev_2001'], ['d.vect', 'map=points']], # g.pnmcomp
-                 [['d.rast', 'map=elev_2002'], ['d.vect', 'map=points']],
-                 ...]
+                                   [[['d.rast', 'map=elev_2001'], ['d.vect', 'map=points']], # g.pnmcomp
+                                   [['d.rast', 'map=elev_2002'], ['d.vect', 'map=points']],
+                                   ...]
         :param opacities: list of opacity values
         :param regions: list of regions
         """
@@ -479,7 +479,7 @@ def RenderProcess2D(imageWidth, imageHeight, tempDir, cmd, region, bgcolor, file
     :param region: region as a dict or None
     :param bgcolor: background color as a tuple of 3 values 0 to 255
     :param fileQueue: the inter process communication queue
-    storing the file name of the image
+                      storing the file name of the image
     """
 
     filename = GetFileFromCmd(tempDir, cmd, region)
@@ -516,7 +516,7 @@ def RenderProcess3D(imageWidth, imageHeight, tempDir, cmd, region, bgcolor, file
     :param region: region as a dict
     :param bgcolor: background color as a tuple of 3 values 0 to 255
     :param fileQueue: the inter process communication queue
-    storing the file name of the image
+                      storing the file name of the image
     """
 
     filename = GetFileFromCmd(tempDir, cmd, None)
@@ -553,7 +553,7 @@ def CompositeProcess(imageWidth, imageHeight, tempDir, cmdList, region, opacitie
     :param opacites: list of opacities
     :param bgcolor: background color as a tuple of 3 values 0 to 255
     :param fileQueue: the inter process communication queue
-    storing the file name of the image
+                      storing the file name of the image
     """
 
     maps = []

+ 1 - 1
gui/wxpython/core/debug.py

@@ -46,7 +46,7 @@ class DebugMsg:
 
         :param level: debug level (0-5)
         :param message: message to be printed
-        :param *args: formatting params
+        :param args: formatting params
         """
         # self.SetLevel()
         if self.debuglevel > 0 and level > 0 and level <= self.debuglevel:

+ 6 - 0
gui/wxpython/core/giface.py

@@ -113,6 +113,7 @@ class GrassInterface:
     to every GUI component.
 
     .. note::
+
         The GrassInterface process is not finished.
     """
     def RunCmd(self, *args, **kwargs):
@@ -147,6 +148,7 @@ class GrassInterface:
     def GetLayerTree(self):
         """Returns LayerManager's tree GUI object.
         .. note::
+
             Will be removed from the interface.
         """
         raise NotImplementedError()
@@ -160,6 +162,7 @@ class GrassInterface:
         """Returns current map display.
 
         .. note::
+
             For layer related tasks use GetLayerList().
 
         :return: MapFrame instance
@@ -171,6 +174,7 @@ class GrassInterface:
         """Get list of all map displays.
 
         .. note::
+
             Might be removed from the interface.
 
         :return: list of MapFrame instances
@@ -181,6 +185,7 @@ class GrassInterface:
         """Returns current map window.
 
         .. note::
+
             For layer related tasks use GetLayerList().
         """
         raise NotImplementedError()
@@ -189,6 +194,7 @@ class GrassInterface:
         """Returns object which shows the progress.
 
         .. note::
+
             Some implementations may not implement this method.
         """
         raise NotImplementedError()

文件差異過大導致無法顯示
+ 204 - 202
gui/wxpython/core/render.py


+ 23 - 22
gui/wxpython/gui_core/dialogs.py

@@ -4,23 +4,23 @@
 @brief Various dialogs used in wxGUI.
 
 List of classes:
- - dialogs::SimpleDialog
- - dialogs::LocationDialog
- - dialogs::MapsetDialog
- - dialogs::VectorDialog
- - dialogs::NewVectorDialog
- - dialogs::SavedRegion
- - dialogs::GroupDialog
- - dialogs::MapLayersDialog
- - dialogs::ImportDialog
- - dialogs::GdalImportDialog
- - dialogs::GdalOutputDialog
- - dialogs::DxfImportDialog
- - dialogs::LayersList (used by MultiImport) 
- - dialogs::SetOpacityDialog
- - dialogs::ImageSizeDialog
- - dialogs::SqlQueryFrame
- - dialogs::SymbolDialog
+ - :class:`SimpleDialog`
+ - :class:`LocationDialog`
+ - :class:`MapsetDialog`
+ - :class:`VectorDialog`
+ - :class:`NewVectorDialog`
+ - :class:`SavedRegion`
+ - :class:`GroupDialog`
+ - :class:`MapLayersDialog`
+ - :class:`ImportDialog`
+ - :class:`GdalImportDialog`
+ - :class:`GdalOutputDialog`
+ - :class:`DxfImportDialog`
+ - :class:`LayersList` (used by MultiImport)
+ - :class:`SetOpacityDialog`
+ - :class:`ImageSizeDialog`
+ - :class:`SqlQueryFrame`
+ - :class:`SymbolDialog`
 
 (C) 2008-2011 by the GRASS Development Team
 
@@ -347,25 +347,26 @@ class NewVectorDialog(VectorDialog):
         """
         if self.ftype:
             return self.ftype.GetType()
-        
+
         return None
 
+
 def CreateNewVector(parent, cmd, title = _('Create new vector map'),
                     exceptMap=None, giface=None,
                     disableAdd = False, disableTable = False):
     """Create new vector map layer
-    
-    :param cmd: (prog, **kwargs)
+
+    :param cmd: (prog, \*\*kwargs)
     :param title: window title
     :param exceptMap: list of maps to be excepted
     :param log:
     :param disableAdd: disable 'add layer' checkbox
     :param disableTable: disable 'create table' checkbox
-    
+
     :return: dialog instance
     :return: None on error
     """
-    vExternalOut = grass.parse_command('v.external.out', flags = 'g')
+    vExternalOut = grass.parse_command('v.external.out', flags='g')
     isNative = vExternalOut['format'] == 'native'
     if cmd[0] == 'v.edit' and not isNative:
         showType = True

文件差異過大導致無法顯示
+ 232 - 227
gui/wxpython/gui_core/gselect.py


+ 169 - 152
gui/wxpython/gui_core/widgets.py

@@ -83,7 +83,7 @@ class NotebookController:
     and other methods can be delegated by @c __getattr__.
     """
     def __init__(self, classObject, widget):
-        """       
+        """
         :param classObject: notebook class name (object, i.e. FlatNotebook)
         :param widget: notebook instance
         """
@@ -148,7 +148,7 @@ class NotebookController:
         """Set active notebook page.
 
         :param page: name, eg. 'layers', 'output', 'search', 'pyshell', 'nviz'
-        (depends on concrete notebook instance)
+                     (depends on concrete notebook instance)
         """
         idx = self.GetPageIndexByName(page)
         if self.classObject.GetSelection(self.widget) != idx:
@@ -174,7 +174,7 @@ class NotebookController:
 
     def GetPageIndexByName(self, page):
         """Get notebook page index
-        
+
         :param page: name
         """
         if page not in self.notebookPages:
@@ -187,7 +187,7 @@ class NotebookController:
     def HighlightPageByName(self, page):
         pageIndex = self.GetPageIndexByName(page)
         self.HighlightPage(pageIndex)
-        
+
     def HighlightPage(self, index):
         if self.classObject.GetSelection(self.widget) != index:
             text = self.classObject.GetPageText(self.widget, index)
@@ -215,12 +215,12 @@ class FlatNotebookController(NotebookController):
 
     def GetPageIndexByName(self, page):
         """Get notebook page index
-        
+
         :param page: name
         """
         if page not in self.notebookPages:
             return -1
-        
+
         return self.classObject.GetPageIndex(self.widget, self.notebookPages[page])
 
 
@@ -232,11 +232,14 @@ class GNotebook(FN.FlatNotebook):
     """
     def __init__(self, parent, style, **kwargs):
         if globalvar.hasAgw:
-            FN.FlatNotebook.__init__(self, parent, id = wx.ID_ANY, agwStyle = style, **kwargs)
+            FN.FlatNotebook.__init__(self, parent, id=wx.ID_ANY,
+                                     agwStyle=style, **kwargs)
         else:
-            FN.FlatNotebook.__init__(self, parent, id = wx.ID_ANY, style = style, **kwargs)
-        
-        self.controller = FlatNotebookController(classObject = FN.FlatNotebook, widget = self)
+            FN.FlatNotebook.__init__(self, parent, id=wx.ID_ANY,
+                                     style=style, **kwargs)
+
+        self.controller = FlatNotebookController(classObject=FN.FlatNotebook,
+                                                 widget=self)
 
     def AddPage(self, **kwargs):
         """@copydoc NotebookController::AddPage()"""
@@ -261,14 +264,16 @@ class GNotebook(FN.FlatNotebook):
     def __getattr__(self, name):
         return getattr(self.controller, name)
 
+
 class FormNotebook(wx.Notebook):
     """Notebook widget.
 
     Respects native look.
     """
     def __init__(self, parent, style):
-        wx.Notebook.__init__(self, parent, id = wx.ID_ANY, style = style)
-        self.controller = NotebookController(classObject = wx.Notebook, widget = self)
+        wx.Notebook.__init__(self, parent, id=wx.ID_ANY, style=style)
+        self.controller = NotebookController(classObject=wx.Notebook,
+                                             widget=self)
 
     def AddPage(self, **kwargs):
         """@copydoc NotebookController::AddPage()"""
@@ -300,9 +305,10 @@ class FormListbook(wx.Listbook):
     Respects native look.
     """
     def __init__(self, parent, style):
-        wx.Listbook.__init__(self, parent, id = wx.ID_ANY, style = style)
-        self.controller = NotebookController(classObject = wx.Listbook, widget = self)
-            
+        wx.Listbook.__init__(self, parent, id=wx.ID_ANY, style=style)
+        self.controller = NotebookController(classObject=wx.Listbook,
+                                             widget=self)
+
     def AddPage(self, **kwargs):
         """@copydoc NotebookController::AddPage()"""
         self.controller.AddPage(**kwargs)
@@ -329,23 +335,25 @@ class FormListbook(wx.Listbook):
 
 class ScrolledPanel(SP.ScrolledPanel):
     """Custom ScrolledPanel to avoid strange behaviour concerning focus"""
-    def __init__(self, parent, style = wx.TAB_TRAVERSAL):
-        SP.ScrolledPanel.__init__(self, parent = parent, id = wx.ID_ANY, style = style)
+    def __init__(self, parent, style=wx.TAB_TRAVERSAL):
+        SP.ScrolledPanel.__init__(self, parent=parent, id=wx.ID_ANY,
+                                  style=style)
 
     def OnChildFocus(self, event):
         pass
-        
+
+
 class NumTextCtrl(wx.TextCtrl):
     """Class derived from wx.TextCtrl for numerical values only"""
     def __init__(self, parent,  **kwargs):
 ##        self.precision = kwargs.pop('prec')
-        wx.TextCtrl.__init__(self, parent = parent,
-            validator = NTCValidator(flag = 'DIGIT_ONLY'), **kwargs)
-        
-            
+        wx.TextCtrl.__init__(self, parent=parent,
+                             validator=NTCValidator(flag='DIGIT_ONLY'),
+                             **kwargs)
+
     def SetValue(self, value):
-        super(NumTextCtrl, self).SetValue( str(value))
-        
+        super(NumTextCtrl, self).SetValue(str(value))
+
     def GetValue(self):
         val = super(NumTextCtrl, self).GetValue()
         if val == '':
@@ -355,10 +363,11 @@ class NumTextCtrl(wx.TextCtrl):
         except ValueError:
             val = ''.join(''.join(val.split('-')).split('.'))
             return float(val)
-        
+
     def SetRange(self, min, max):
         pass
-   
+
+
 class FloatSlider(wx.Slider):
     """Class derived from wx.Slider for floats"""
     def __init__(self, **kwargs):
@@ -368,18 +377,19 @@ class FloatSlider(wx.Slider):
         #init range
         self.minValueOrig = 0
         self.maxValueOrig = 1
-        
+
     def SetValue(self, value):
-        value *= self.coef 
+        value *= self.coef
         if abs(value) < 1 and value != 0:
             while abs(value) < 1:
                 value *= 100
                 self.coef *= 100
-            super(FloatSlider, self).SetRange(self.minValueOrig * self.coef, self.maxValueOrig * self.coef)
+            super(FloatSlider, self).SetRange(self.minValueOrig * self.coef,
+                                              self.maxValueOrig * self.coef)
         super(FloatSlider, self).SetValue(value)
-        
+
         Debug.msg(4, "FloatSlider.SetValue(): value = %f" % value)
-        
+
     def SetRange(self, minValue, maxValue):
         self.coef = 1.
         self.minValueOrig = minValue
@@ -392,32 +402,33 @@ class FloatSlider(wx.Slider):
             super(FloatSlider, self).SetValue(super(FloatSlider, self).GetValue() * self.coef)
         super(FloatSlider, self).SetRange(minValue, maxValue)
         Debug.msg(4, "FloatSlider.SetRange(): minValue = %f, maxValue = %f" % (minValue, maxValue))
-            
+
     def GetValue(self):
         val = super(FloatSlider, self).GetValue()
         Debug.msg(4, "FloatSlider.GetValue(): value = %f" % (val/self.coef))
         return val/self.coef
-        
-        
+
+
 class SymbolButton(BitmapTextButton):
     """Button with symbol and label."""
     def __init__(self, parent, usage, label, **kwargs):
         """Constructor
-        
+
         :param parent: parent (usually wx.Panel)
         :param usage: determines usage and picture
         :param label: displayed label
         """
         size = (15, 15)
         buffer = wx.EmptyBitmap(*size)
-        BitmapTextButton.__init__(self, parent = parent, label = " " + label, bitmap = buffer, **kwargs)
-        
+        BitmapTextButton.__init__(self, parent=parent, label=" " + label,
+                                  bitmap=buffer, **kwargs)
+
         dc = wx.MemoryDC()
         dc.SelectObject(buffer)
         maskColor = wx.Colour(255, 255, 255)
         dc.SetBrush(wx.Brush(maskColor))
         dc.Clear()
-        
+
         if usage == 'record':
             self.DrawRecord(dc, size)
         elif usage == 'stop':
@@ -431,23 +442,24 @@ class SymbolButton(BitmapTextButton):
             buffer.SetMaskColour(maskColor)
         self.SetBitmapLabel(buffer)
         dc.SelectObject(wx.NullBitmap)
-        
+
     def DrawRecord(self, dc, size):
         """Draw record symbol"""
         dc.SetBrush(wx.Brush(wx.Colour(255, 0, 0)))
         dc.DrawCircle(size[0]/2, size[1] / 2, size[0] / 2)
-        
+
     def DrawStop(self, dc, size):
         """Draw stop symbol"""
         dc.SetBrush(wx.Brush(wx.Colour(50, 50, 50)))
         dc.DrawRectangle(0, 0, size[0], size[1])
-        
+
     def DrawPlay(self, dc, size):
         """Draw play symbol"""
         dc.SetBrush(wx.Brush(wx.Colour(0, 255, 0)))
-        points = (wx.Point(0, 0), wx.Point(0, size[1]), wx.Point(size[0], size[1] / 2))
+        points = (wx.Point(0, 0), wx.Point(0, size[1]), wx.Point(size[0],
+                  size[1] / 2))
         dc.DrawPolygon(points)
-        
+
     def DrawPause(self, dc, size):
         """Draw pause symbol"""
         dc.SetBrush(wx.Brush(wx.Colour(50, 50, 50)))
@@ -486,7 +498,8 @@ class StaticWrapText(GenStaticText):
         """Calculates size of wrapped label"""
         parent = self.GetParent()
         newLabel = wordwrap(text=self._initialLabel, width=parent.GetSize()[0],
-                            dc=wx.ClientDC(parent), breakLongWords=True, margin=self._margin)
+                            dc=wx.ClientDC(parent), breakLongWords=True,
+                            margin=self._margin)
         GenStaticText.SetLabel(self, newLabel)
 
     def SetLabel(self, label):
@@ -497,15 +510,15 @@ class StaticWrapText(GenStaticText):
 class BaseValidator(wx.PyValidator):
     def __init__(self):
         wx.PyValidator.__init__(self)
-        
-        self.Bind(wx.EVT_TEXT, self.OnText) 
+
+        self.Bind(wx.EVT_TEXT, self.OnText)
 
     def OnText(self, event):
         """Do validation"""
         self.Validate()
-        
+
         event.Skip()
-        
+
     def Validate(self):
         """Validate input"""
         textCtrl = self.GetWindow()
@@ -517,7 +530,7 @@ class BaseValidator(wx.PyValidator):
             except ValueError:
                 self._notvalid()
                 return False
-        
+
         self._valid()
         return True
 
@@ -533,16 +546,17 @@ class BaseValidator(wx.PyValidator):
 
         sysColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)
         textCtrl.SetBackgroundColour(sysColor)
-        
+
         textCtrl.Refresh()
         return True
 
     def TransferToWindow(self):
         return True # Prevent wxDialog from complaining.
-    
+
     def TransferFromWindow(self):
         return True # Prevent wxDialog from complaining.
 
+
 class CoordinatesValidator(BaseValidator):
     """Validator for coordinates input (list of floats separated by comma)"""
 
@@ -557,17 +571,17 @@ class CoordinatesValidator(BaseValidator):
         if text:
             try:
                 text = text.split(',')
-                
+
                 for t in text:
                     float(t)
 
-                if len(text)%2 != 0:
+                if len(text) % 2 != 0:
                     return False
 
             except ValueError:
                 self._notvalid()
                 return False
-        
+
         self._valid()
         return True
 
@@ -575,31 +589,34 @@ class CoordinatesValidator(BaseValidator):
         """Clone validator"""
         return CoordinatesValidator()
 
+
 class IntegerValidator(BaseValidator):
     """Validator for floating-point input"""
     def __init__(self):
         BaseValidator.__init__(self)
         self.type = int
-        
+
     def Clone(self):
         """Clone validator"""
         return IntegerValidator()
 
+
 class FloatValidator(BaseValidator):
     """Validator for floating-point input"""
     def __init__(self):
         BaseValidator.__init__(self)
         self.type = float
-        
+
     def Clone(self):
         """Clone validator"""
         return FloatValidator()
 
+
 class EmailValidator(BaseValidator):
     """Validator for email input"""
     def __init__(self):
         BaseValidator.__init__(self)
- 
+
     def Validate(self):
         """Validate input"""
         textCtrl = self.GetWindow()
@@ -608,19 +625,20 @@ class EmailValidator(BaseValidator):
             if re.match(r'\b[\w.-]+@[\w.-]+.\w{2,4}\b', text) is None:
                 self._notvalid()
                 return False
-        
+
         self._valid()
         return True
- 
+
     def Clone(self):
         """Clone validator"""
         return EmailValidator()
- 
+
+
 class TimeISOValidator(BaseValidator):
     """Validator for time ISO format (YYYY-MM-DD) input"""
     def __init__(self):
         BaseValidator.__init__(self)
-    
+
     def Validate(self):
         """Validate input"""
         textCtrl = self.GetWindow()
@@ -631,17 +649,18 @@ class TimeISOValidator(BaseValidator):
             except:
                 self._notvalid()
                 return False
-        
+
         self._valid()
         return True
-        
+
     def Clone(self):
         """Clone validator"""
         return TimeISOValidator()
 
+
 class NTCValidator(wx.PyValidator):
     """validates input in textctrls, taken from wxpython demo"""
-    def __init__(self, flag = None):
+    def __init__(self, flag=None):
         wx.PyValidator.__init__(self)
         self.flag = flag
         self.Bind(wx.EVT_CHAR, self.OnChar)
@@ -661,7 +680,8 @@ class NTCValidator(wx.PyValidator):
             wx.Bell()
         # Returning without calling even.Skip eats the event before it
         # gets to the text control
-        return  
+        return
+
 
 class SimpleValidator(wx.PyValidator):
     """This validator is used to ensure that the user has entered something
@@ -700,7 +720,6 @@ class SimpleValidator(wx.PyValidator):
         """
         return True # Prevent wxDialog from complaining.
 
-
     def TransferFromWindow(self):
         """Transfer data from window to validator.
 
@@ -748,7 +767,6 @@ class GenericValidator(wx.PyValidator):
         """
         return True # Prevent wxDialog from complaining.
 
-
     def TransferFromWindow(self):
         """Transfer data from window to validator.
         """
@@ -757,13 +775,13 @@ class GenericValidator(wx.PyValidator):
 
 class SingleSymbolPanel(wx.Panel):
     """Panel for displaying one symbol.
-    
+
     Changes background when selected. Assumes that parent will catch
     events emitted on mouse click. Used in gui_core::dialog::SymbolDialog.
     """
     def __init__(self, parent, symbolPath):
         """Panel constructor
-        
+
         Signal symbolSelectionChanged - symbol selected
                                       - attribute 'name' (symbol name)
                                       - attribute 'doubleClick' (underlying cause)
@@ -773,63 +791,64 @@ class SingleSymbolPanel(wx.Panel):
         """
         self.symbolSelectionChanged = Signal('SingleSymbolPanel.symbolSelectionChanged')
 
-        wx.Panel.__init__(self, parent, id = wx.ID_ANY, style = wx.BORDER_RAISED)
+        wx.Panel.__init__(self, parent, id=wx.ID_ANY, style=wx.BORDER_RAISED)
         self.SetName(os.path.splitext(os.path.basename(symbolPath))[0])
         self.sBmp = wx.StaticBitmap(self, wx.ID_ANY, wx.Bitmap(symbolPath))
 
         self.selected = False
         self.selectColor = wx.SystemSettings.GetColour(wx.SYS_COLOUR_HIGHLIGHT)
         self.deselectColor = wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW)
-        
+
         sizer = wx.BoxSizer()
-        sizer.Add(item = self.sBmp, proportion = 0, flag = wx.ALL | wx.ALIGN_CENTER, border = 5)
+        sizer.Add(item = self.sBmp, proportion=0, flag=wx.ALL | wx.ALIGN_CENTER, border = 5)
         self.SetBackgroundColour(self.deselectColor)
         self.SetMinSize(self.GetBestSize())
         self.SetSizerAndFit(sizer)
-        
+
         # binding to both (staticBitmap, Panel) necessary
         self.sBmp.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
         self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
         self.Bind(wx.EVT_LEFT_DCLICK, self.OnDoubleClick)
         self.sBmp.Bind(wx.EVT_LEFT_DCLICK, self.OnDoubleClick)
-        
+
     def OnLeftDown(self, event):
         """Panel selected, background changes"""
         self.selected = True
         self.SetBackgroundColour(self.selectColor)
         self.Refresh()
         event.Skip()
-        
+
         self.symbolSelectionChanged.emit(name=self.GetName(), doubleClick=False)
-        
+
     def OnDoubleClick(self, event):
         self.symbolSelectionChanged.emit(name=self.GetName(), doubleClick=True)
-        
+
     def Deselect(self):
         """Panel deselected, background changes back to default"""
         self.selected = False
         self.SetBackgroundColour(self.deselectColor)
         self.Refresh()
-        
+
     def Select(self):
         """Select panel, no event emitted"""
         self.selected = True
         self.SetBackgroundColour(self.selectColor)
         self.Refresh()
-        
+
+
 class GListCtrl(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.CheckListCtrlMixin):
     """Generic ListCtrl with popup menu to select/deselect all
     items"""
     def __init__(self, parent):
         self.parent = parent
-        
-        wx.ListCtrl.__init__(self, parent, id = wx.ID_ANY,
-                             style = wx.LC_REPORT)
+
+        wx.ListCtrl.__init__(self, parent, id=wx.ID_ANY,
+                             style=wx.LC_REPORT)
         listmix.CheckListCtrlMixin.__init__(self)
-        
+
         # setup mixins
         listmix.ListCtrlAutoWidthMixin.__init__(self)
-        
+
         self.Bind(wx.EVT_COMMAND_RIGHT_CLICK, self.OnPopupMenu) #wxMSW
         self.Bind(wx.EVT_RIGHT_UP,            self.OnPopupMenu) #wxGTK
 
@@ -841,57 +860,57 @@ class GListCtrl(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.CheckListCt
         """Show popup menu"""
         if self.GetItemCount() < 1:
             return
-        
+
         if not hasattr(self, "popupDataID1"):
             self.popupDataID1 = wx.NewId()
             self.popupDataID2 = wx.NewId()
-            
-            self.Bind(wx.EVT_MENU, self.OnSelectAll,  id = self.popupDataID1)
-            self.Bind(wx.EVT_MENU, self.OnSelectNone, id = self.popupDataID2)
-        
+
+            self.Bind(wx.EVT_MENU, self.OnSelectAll,  id=self.popupDataID1)
+            self.Bind(wx.EVT_MENU, self.OnSelectNone, id=self.popupDataID2)
+
         # generate popup-menu
         menu = wx.Menu()
         menu.Append(self.popupDataID1, _("Select all"))
         menu.Append(self.popupDataID2, _("Deselect all"))
-        
+
         self.PopupMenu(menu)
         menu.Destroy()
 
     def OnSelectAll(self, event):
         """Select all items"""
         item = -1
-        
+
         while True:
             item = self.GetNextItem(item)
             if item == -1:
                 break
             self.CheckItem(item, True)
-        
+
         event.Skip()
-        
+
     def OnSelectNone(self, event):
         """Deselect items"""
         item = -1
-        
+
         while True:
             item = self.GetNextItem(item, wx.LIST_STATE_SELECTED)
             if item == -1:
                 break
             self.CheckItem(item, False)
-        
+
         event.Skip()
 
 
 class SearchModuleWidget(wx.Panel):
     """Search module widget (used e.g. in SearchModuleWindow)
-        
+
     Signals:
         moduleSelected - attribute 'name' is module name
         showSearchResult - attribute 'result' is a node (representing module)
         showNotification - attribute 'message'
     """
     def __init__(self, parent, model,
-                 showChoice = True, showTip = False, **kwargs):
+                 showChoice=True, showTip=False, **kwargs):
         self._showTip = showTip
         self._showChoice = showChoice
         self._model = model
@@ -899,12 +918,12 @@ class SearchModuleWidget(wx.Panel):
         self._resultIndex = -1
         self._searchKeys = ['description', 'keywords', 'command']
         self._oldValue = ''
-        
+
         self.moduleSelected = Signal('SearchModuleWidget.moduleSelected')
         self.showSearchResult = Signal('SearchModuleWidget.showSearchResult')
         self.showNotification = Signal('SearchModuleWidget.showNotification')
 
-        wx.Panel.__init__(self, parent = parent, id = wx.ID_ANY, **kwargs)
+        wx.Panel.__init__(self, parent=parent, id=wx.ID_ANY, **kwargs)
 
 #        self._box = wx.StaticBox(parent = self, id = wx.ID_ANY,
 #                                label = " %s " % _("Find module - (press Enter for next match)"))
@@ -926,7 +945,7 @@ class SearchModuleWidget(wx.Panel):
                                              size = (-1, 35))
 
         if self._showChoice:
-            self._searchChoice = wx.Choice(parent = self, id = wx.ID_ANY)
+            self._searchChoice = wx.Choice(parent=self, id=wx.ID_ANY)
             self._searchChoice.SetItems(self._searchModule(keys=['command'], value=''))
             self._searchChoice.Bind(wx.EVT_CHOICE, self.OnSelectModule)
 
@@ -951,7 +970,7 @@ class SearchModuleWidget(wx.Panel):
             boxSizer.Add(item=self._searchTip,
                           flag=wx.ALIGN_CENTER_VERTICAL | wx.EXPAND)
 
-        sizer.Add(item = boxSizer, proportion = 1)
+        sizer.Add(item=boxSizer, proportion=1)
 
         self.SetSizer(sizer)
         sizer.Fit(self)
@@ -1004,20 +1023,20 @@ class SearchModuleWidget(wx.Panel):
         nodes = set()
         for key in keys:
             nodes.update(self._model.SearchNodes(key=key, value=value))
-        
+
         nodes = list(nodes)
         nodes.sort(key=lambda node: self._model.GetIndexOfNode(node))
         self._results = nodes
         self._resultIndex = -1
         commands = [node.data['command'] for node in nodes if node.data['command']]
         commands.sort() # return sorted list of commands (TODO: sort in better way)
-        
+
         return commands
-        
+
     def OnSelectModule(self, event):
         """Module selected from choice, update command prompt"""
         cmd  = self._searchChoice.GetStringSelection()
-        self.moduleSelected.emit(name = cmd)
+        self.moduleSelected.emit(name=cmd)
 
         if self._showTip:
             for module in self._results:
@@ -1031,6 +1050,7 @@ class SearchModuleWidget(wx.Panel):
         if self._showTip:
             self._searchTip.SetLabel('')
 
+
 class ManageSettingsWidget(wx.Panel):
     """Widget which allows loading and saving settings into file."""
     def __init__(self, parent, settingsFile):
@@ -1052,17 +1072,17 @@ class ManageSettingsWidget(wx.Panel):
         self.settingsSaving = Signal('ManageSettingsWidget.settingsSaving')
         self.settingsLoaded = Signal('ManageSettingsWidget.settingsLoaded')
 
-        wx.Panel.__init__(self, parent = parent, id = wx.ID_ANY)
+        wx.Panel.__init__(self, parent=parent, id=wx.ID_ANY)
+
+        self.settingsBox = wx.StaticBox(parent=self, id=wx.ID_ANY,
+                                        label=" %s " % _("Settings"))
 
-        self.settingsBox = wx.StaticBox(parent = self, id = wx.ID_ANY,
-                                        label = " %s " % _("Settings"))
-        
-        self.settingsChoice = wx.Choice(parent = self, id = wx.ID_ANY)
+        self.settingsChoice = wx.Choice(parent=self, id=wx.ID_ANY)
         self.settingsChoice.Bind(wx.EVT_CHOICE, self.OnSettingsChanged)
-        self.btnSettingsSave = wx.Button(parent = self, id = wx.ID_SAVE)
+        self.btnSettingsSave = wx.Button(parent=self, id=wx.ID_SAVE)
         self.btnSettingsSave.Bind(wx.EVT_BUTTON, self.OnSettingsSave)
         self.btnSettingsSave.SetToolTipString(_("Save current settings"))
-        self.btnSettingsDel = wx.Button(parent = self, id = wx.ID_REMOVE)
+        self.btnSettingsDel = wx.Button(parent=self, id=wx.ID_REMOVE)
         self.btnSettingsDel.Bind(wx.EVT_BUTTON, self.OnSettingsDelete)
         self.btnSettingsSave.SetToolTipString(_("Delete currently selected settings"))
 
@@ -1083,20 +1103,16 @@ class ManageSettingsWidget(wx.Panel):
     def _layout(self):
 
         self.settingsSizer = wx.StaticBoxSizer(self.settingsBox, wx.HORIZONTAL)
-        self.settingsSizer.Add(item = wx.StaticText(parent = self,
-                                               id = wx.ID_ANY,
-                                               label = _("Load settings:")),
-                          flag = wx.ALIGN_CENTER_VERTICAL | wx.RIGHT,
-                          border  = 5)
-        self.settingsSizer.Add(item = self.settingsChoice,
-                          proportion = 1,
-                          flag = wx.EXPAND)
-        self.settingsSizer.Add(item = self.btnSettingsSave,
-                          flag = wx.LEFT | wx.RIGHT,
-                          border = 5)
-        self.settingsSizer.Add(item = self.btnSettingsDel,
-                          flag = wx.RIGHT,
-                          border = 5)
+        self.settingsSizer.Add(item=wx.StaticText(parent=self, id=wx.ID_ANY,
+                                                  label=_("Load settings:")),
+                               flag=wx.ALIGN_CENTER_VERTICAL | wx.RIGHT,
+                               border=5)
+        self.settingsSizer.Add(item=self.settingsChoice,
+                               proportion=1, flag=wx.EXPAND)
+        self.settingsSizer.Add(item=self.btnSettingsSave,
+                               flag=wx.LEFT | wx.RIGHT, border=5)
+        self.settingsSizer.Add(item=self.btnSettingsDel,
+                               flag=wx.RIGHT,border=5)
 
     def OnSettingsChanged(self, event):
         """Load named settings"""
@@ -1112,28 +1128,29 @@ class ManageSettingsWidget(wx.Panel):
     def GetSettings(self):
         """Load named settings"""
         return self._settings.copy()
-       
+
     def OnSettingsSave(self, event):
         """Save settings"""
-        dlg = wx.TextEntryDialog(parent = self,
-                                 message = _("Name:"),
-                                 caption = _("Save settings"))
+        dlg = wx.TextEntryDialog(parent=self,
+                                 message=_("Name:"),
+                                 caption=_("Save settings"))
         if dlg.ShowModal() == wx.ID_OK:
             name = dlg.GetValue()
             if not name:
-                GMessage(parent = self,
-                         message = _("Name not given, settings is not saved."))
+                GMessage(parent=self,
+                         message=_("Name not given, settings is not saved."))
             else:
                 self.settingsSaving.emit(name=name)
-                
+
             dlg.Destroy()
-  
+
     def SaveSettings(self, name):
         # check if settings item already exists
         if name in self._settings:
-            dlgOwt = wx.MessageDialog(self, message = _("Settings <%s> already exists. "
-                                                        "Do you want to overwrite the settings?") % name,
-                                      caption = _("Save settings"), style = wx.YES_NO | wx.YES_DEFAULT | wx.ICON_QUESTION)
+            dlgOwt = wx.MessageDialog(self, message=_("Settings <%s> already exists. "
+                                                      "Do you want to overwrite the settings?") % name,
+                                      caption=_("Save settings"),
+                                      style=wx.YES_NO | wx.YES_DEFAULT | wx.ICON_QUESTION)
             if dlgOwt.ShowModal() != wx.ID_YES:
                 dlgOwt.Destroy()
                 return
@@ -1145,7 +1162,7 @@ class ManageSettingsWidget(wx.Panel):
         self.settingsChoice.SetStringSelection(name)
 
         self.data_to_save = []
- 
+
     def _saveSettings(self):
         """Save settings and reload if successful"""
         if self._writeSettings() == 0:
@@ -1182,11 +1199,11 @@ class ManageSettingsWidget(wx.Panel):
             GMessage(parent = self,
                      message = _("No settings is defined. Operation canceled."))
             return
-        
+
         self._settings.pop(name)
         if self._writeSettings() == 0:
             self._settings = self._loadSettings()
-        
+
     def _writeSettings(self):
         """Save settings into the file
 
@@ -1217,14 +1234,14 @@ class ManageSettingsWidget(wx.Panel):
                    message = _("Unable to save settings"))
             return -1
         fd.close()
-        
+
         return 0
 
     def _loadSettings(self):
         """Load settings from the file
 
         The file is defined by self.SettingsFile.
-        
+
         :return: parsed dict
         :return: empty dict on error
         """
@@ -1260,12 +1277,12 @@ class ManageSettingsWidget(wx.Panel):
         """Load settings from the file in format version 2.0
 
         The file is defined by self.SettingsFile.
-        
+
         :return: parsed dict
         :return: empty dict on error
         """
         data = dict()
-        
+
         for line in fd_lines[1:]:
             try:
                 lineData = []
@@ -1285,7 +1302,7 @@ class ManageSettingsWidget(wx.Panel):
                         while True:
                             if line[idx - (i_esc_chars + 1)] == self.esc_chars[self.e_char_i]:
                                 i_esc_chars += 1
-                            else: 
+                            else:
                                 break
                         if i_esc_chars%2 != 0:
                             i_last = idx + 1
@@ -1311,12 +1328,12 @@ class ManageSettingsWidget(wx.Panel):
         """Load settings from the file in format version 1.0 (backward compatibility)
 
         The file is defined by self.SettingsFile.
-        
+
         :return: parsed dict
         :return: empty dict on error
         """
         data = dict()
-      
+
         for line in fd_lines:
             try:
                 lineData = line.rstrip('\n').split(';')
@@ -1327,17 +1344,17 @@ class ManageSettingsWidget(wx.Panel):
                     data[lineData[0]] = (lineData[1], lineData[2], lineData[3], '')
             except ValueError:
                 pass
-        
+
         return data
 
 class PictureComboBox(wx.combo.OwnerDrawnComboBox):
     """Abstract class of ComboBox with pictures.
-    
+
         Derived class has to specify has to specify _getPath method.
     """
     def OnDrawItem(self, dc, rect, item, flags):
         """Overridden from OwnerDrawnComboBox.
-        
+
         Called to draw each item in the list.
         """
         if item == wx.NOT_FOUND:
@@ -1367,8 +1384,8 @@ class PictureComboBox(wx.combo.OwnerDrawnComboBox):
 
     def GetPictureBitmap(self, name):
         """Returns bitmap for given picture name.
-        
-        :param str colorTable: name of color table        
+
+        :param str colorTable: name of color table
         """
         if not hasattr(self, 'bitmaps'):
             self.bitmaps = {}

+ 13 - 7
gui/wxpython/lmgr/giface.py

@@ -24,8 +24,10 @@ from core.giface import Notification
 class Layer(object):
     """@implements core::giface::Layer
 
-    .. note:: Currently implemented without specifying the interface.
-    It only provides all attributes of existing layer as used in lmgr.
+    .. note::
+
+        Currently implemented without specifying the interface.
+        It only provides all attributes of existing layer as used in lmgr.
     """
     def __init__(self, pydata):
         self._pydata = pydata
@@ -150,15 +152,18 @@ class LayerManagerGrassInterface(object):
         cmdlist = ['g.manual', 'entry=%s' % entry]
         if online:
             cmdlist.append('-o')
-        self.RunCmd(cmdlist, compReg = False, notification=Notification.NO_NOTIFICATION)
+        self.RunCmd(cmdlist, compReg=False,
+                    notification=Notification.NO_NOTIFICATION)
 
-    def WriteLog(self, text, wrap = None,
+    def WriteLog(self, text, wrap=None,
                  notification=Notification.HIGHLIGHT):
-        self.lmgr._gconsole.WriteLog(text=text, wrap=wrap, 
+        self.lmgr._gconsole.WriteLog(text=text, wrap=wrap,
                                      notification=notification)
 
-    def WriteCmdLog(self, text, pid=None, notification=Notification.MAKE_VISIBLE):
-        self.lmgr._gconsole.WriteCmdLog(text=text, pid=pid, notification=notification)
+    def WriteCmdLog(self, text, pid=None,
+                    notification=Notification.MAKE_VISIBLE):
+        self.lmgr._gconsole.WriteCmdLog(text=text, pid=pid,
+                                        notification=notification)
 
     def WriteWarning(self, text):
         self.lmgr._gconsole.WriteWarning(text=text)
@@ -190,6 +195,7 @@ class LayerManagerGrassInterface(object):
     def UpdateCmdHistory(self, cmd):
         self.lmgr.goutput.GetPrompt().UpdateCmdHistory(cmd)
 
+
 class LayerManagerGrassInterfaceForMapDisplay(object):
     """Provides reference only to the given layer list (according to tree),
         not to the current.

+ 5 - 6
gui/wxpython/mapdisp/frame.py

@@ -30,7 +30,6 @@ from core import globalvar
 import wx
 import wx.aui
 
-from core               import globalvar
 from core.render        import Map
 from vdigit.toolbars    import VDigitToolbar
 from mapdisp.toolbars   import MapToolbar, NvizIcons
@@ -1307,7 +1306,7 @@ class MapFrame(SingleMapFrame):
     def IsStandalone(self):
         """Check if Map display is standalone
 
-        .. deprecated::
+        .. deprecated:: 7.0
         """
         # TODO: once it is removed from 2 places in vdigit it can be deleted
         # here and also in base class and other classes in the tree (hopefully)
@@ -1317,22 +1316,22 @@ class MapFrame(SingleMapFrame):
                   " Signals or giface")
         if self._layerManager:
             return False
-        
+
         return True
-    
+
     def GetLayerManager(self):
         """Get reference to Layer Manager
 
         :return: window reference
         :return: None (if standalone)
 
-        .. deprecated::
+        .. deprecated:: 7.0
         """
         Debug.msg(1, "MapFrame.GetLayerManager(): Method GetLayerManager is"
                   "depreciated, use some general approach instead such as"
                   " Signals or giface")
         return self._layerManager
-    
+
     def GetMapToolbar(self):
         """Returns toolbar with zooming tools"""
         return self.toolbars['map']

+ 38 - 36
gui/wxpython/mapwin/base.py

@@ -52,6 +52,7 @@ class MapWindowProperties(object):
         self._alignExtent = UserSettings.Get(group='display',
                                              key='alignExtent',
                                              subkey='enabled')
+
     @property
     def resolution(self):
         return self._resolution
@@ -95,10 +96,10 @@ class MapWindowProperties(object):
 
 class MapWindowBase(object):
     """Abstract map display window class
-    
+
     Superclass for BufferedWindow class (2D display mode), and GLWindow
     (3D display mode).
-    
+
     Subclasses have to define
      - _bindMouseEvents method which binds MouseEvent handlers
      - Pixel2Cell
@@ -127,8 +128,8 @@ class MapWindowBase(object):
             'box'  : "point"
             }
         # last east, north coordinates, changes on mouse motion
-        self.lastEN = None 
-        
+        self.lastEN = None
+
         # stores overridden cursor
         self._overriddenCursor = None
 
@@ -177,10 +178,10 @@ class MapWindowBase(object):
         """
         for ev, handlers in self.handlersContainer.iteritems():
             self.Bind(ev, self.EventTypeHandler(handlers))
-    
+
     def EventTypeHandler(self, evHandlers):
-        return lambda event:self.HandlersCaller(event, evHandlers)  
-    
+        return lambda event : self.HandlersCaller(event, evHandlers)
+
     def HandlersCaller(self, event, handlers):
         """Hepler function which calls all handlers registered for
         event
@@ -190,53 +191,54 @@ class MapWindowBase(object):
                 handler(event)
             except:
                 handlers.remove(handler)
-                GError(parent = self,
+                GError(parent=self,
                        message=_("Error occured during calling of handler: %s \n"
                                  "Handler was unregistered.") % handler.__name__)
-        
+
         event.Skip() 
 
-    def RegisterMouseEventHandler(self, event, handler, cursor = None):
+    def RegisterMouseEventHandler(self, event, handler, cursor=None):
         """Binds event handler
 
-        @depreciated This method is depreciated. Use Signals or drawing API instead.
-        Signals do not cover all events but new Signals can be added when needed
-        consider also adding generic signal. However, more interesing and useful
-        is higher level API to create objects, graphics etc.
+        @depreciated This method is depreciated. Use Signals or drawing API
+        instead. Signals do not cover all events but new Signals can be added
+        when needed consider also adding generic signal. However, more
+        interesing and useful is higher level API to create objects, graphics etc.
 
         Call event.Skip() in handler to allow default processing in MapWindow.
 
         If any error occures inside of handler, the handler is removed.
 
-        Before handler is unregistered it is called with 
+        Before handler is unregistered it is called with
         string value "unregistered" of event parameter.
 
-        @code
-        # your class methods
-        def OnButton(self, event):
-            # current map display's map window
-            # expects LayerManager to be the parent
-            self.mapwin = self.parent.GetLayerTree().GetMapDisplay().GetWindow()
-            if self.mapwin.RegisterEventHandler(wx.EVT_LEFT_DOWN, self.OnMouseAction,
-                                                'cross'):
-                self.parent.GetLayerTree().GetMapDisplay().Raise()
-            else:
-                # handle that you cannot get coordinates
-        
-        def OnMouseAction(self, event):
-            # get real world coordinates of mouse click
-            coor = self.mapwin.Pixel2Cell(event.GetPositionTuple()[:])
-            self.text.SetLabel('Coor: ' + str(coor))
-            self.mapwin.UnregisterMouseEventHandler(wx.EVT_LEFT_DOWN, self.OnMouseAction)
-            event.Skip()
-        @endcode
+        ::
 
-        Emits mouseHandlerRegistered signal before handler is registered.        
+            # your class methods
+            def OnButton(self, event):
+                # current map display's map window
+                # expects LayerManager to be the parent
+                self.mapwin = self.parent.GetLayerTree().GetMapDisplay().GetWindow()
+                if self.mapwin.RegisterEventHandler(wx.EVT_LEFT_DOWN, self.OnMouseAction,
+                                                    'cross'):
+                    self.parent.GetLayerTree().GetMapDisplay().Raise()
+                else:
+                    # handle that you cannot get coordinates
+
+            def OnMouseAction(self, event):
+                # get real world coordinates of mouse click
+                coor = self.mapwin.Pixel2Cell(event.GetPositionTuple()[:])
+                self.text.SetLabel('Coor: ' + str(coor))
+                self.mapwin.UnregisterMouseEventHandler(wx.EVT_LEFT_DOWN, self.OnMouseAction)
+                event.Skip()
+
+
+        Emits mouseHandlerRegistered signal before handler is registered.
 
         :param event: one of mouse events
         :param handler: function to handle event
         :param cursor: cursor which temporary overrides current cursor
-        
+
         :return: True if successful
         :return: False if event cannot be bind
         """

文件差異過大導致無法顯示
+ 268 - 268
gui/wxpython/mapwin/buffered.py


+ 19 - 12
gui/wxpython/mapwin/graphics.py

@@ -102,10 +102,12 @@ class GraphicsSet:
                 if label is None:
                     self.properties["text"] = None
                 else:
-                    self.properties["text"]['coords'] = [coords[0] + size, coords[1] + size, size, size]
+                    self.properties["text"]['coords'] = [coords[0] + size,
+                                                         coords[1] + size,
+                                                         size, size]
                     self.properties["text"]['color'] = self.parentMapWin.pen.GetColour()
                     self.properties["text"]['text'] = label
-                    
+
                 self.drawFunc(pdc=pdc, drawid=item.GetId(),
                               coords=coords,
                               text=self.properties["text"],
@@ -124,7 +126,7 @@ class GraphicsSet:
 
                 self.drawFunc(pdc=pdc, pen=pen,
                               coords=coords, drawid=item.GetId())
-             
+
             elif self.graphicsType == "rectangle":
                 if item.GetPropertyVal("penName"):
                     pen = self.pens[item.GetPropertyVal("penName")]
@@ -149,7 +151,7 @@ class GraphicsSet:
                 else:
                     coords = item.GetCoords()
 
-                self.drawFunc(pdc=pdc, pen=pen, 
+                self.drawFunc(pdc=pdc, pen=pen,
                               coords=coords, drawid=item.GetId())
             itemOrderNum += 1
 
@@ -159,10 +161,12 @@ class GraphicsSet:
         Added item is put to the last place in drawing order.
         Could be 'point' or 'line' according to graphicsType.
 
-        :param coords: - list of east, north coordinates (double) of item
-                        Example: point: [1023, 122]
-                                 line: [[10, 12],[20,40],[23, 2334]]
-                                 rectangle: [[10, 12], [33, 45]]
+        :param coords: list of east, north coordinates (double) of item.
+                       Example:
+
+                           * point: [1023, 122]
+                           * line: [[10, 12],[20,40],[23, 2334]]
+                           * rectangle: [[10, 12], [33, 45]]
         :param penName: the 'default' pen is used if is not defined
         :type penName: str
         :param label: label, which will be drawn with point. It is
@@ -174,7 +178,8 @@ class GraphicsSet:
         :type hide: bool
         :return: (GraphicsSetItem) - added item reference
         """
-        item = GraphicsSetItem(coords=coords, penName=penName, label=label, hide=hide)
+        item = GraphicsSetItem(coords=coords, penName=penName, label=label,
+                               hide=hide)
         self.itemsList.append(item)
 
         return item
@@ -385,9 +390,11 @@ class GraphicsSetItem:
         """Set coordinates of item
 
         :param coords: list of east, north coordinates (double) of item
-                       Example: point: [1023, 122]
-                                line: [[10, 12],[20,40],[23, 2334]]
-                                rectangle: [[10, 12], [33, 45]]
+                       Example:
+
+                           * point: [1023, 122]
+                           * line: [[10, 12],[20,40],[23, 2334]]
+                           * rectangle: [[10, 12], [33, 45]]
         """
         self.coords = coords
 

+ 62 - 52
gui/wxpython/nviz/workspace.py

@@ -20,14 +20,15 @@ from core.settings import UserSettings
 from core.utils import _
 
 try:
-    from nviz      import wxnviz
+    from nviz import wxnviz
 except ImportError:
     wxnviz = None
 
+
 class NvizSettings(object):
     def __init__(self):
         pass
-        
+
     def SetConstantDefaultProp(self):
         """Set default constant data properties"""
         data = dict()
@@ -37,14 +38,14 @@ class NvizSettings(object):
         data['color'] = color
 
         return data
-    
-    def SetSurfaceDefaultProp(self, data = None):
+
+    def SetSurfaceDefaultProp(self, data=None):
         """Set default surface data properties"""
         if not data:
             data = dict()
         for sec in ('attribute', 'draw', 'mask', 'position'):
             data[sec] = {}
-        
+
         #
         # attributes
         #
@@ -54,12 +55,13 @@ class NvizSettings(object):
                                                subkey=attrb).iteritems():
                 data['attribute'][attrb][key] = value
             data['attribute'][attrb]['update'] = None
-        
+
         #
         # draw
         #
         data['draw']['all'] = False # apply only for current surface
-        for control, value in UserSettings.Get(group='nviz', key='surface', subkey='draw').iteritems():
+        for control, value in UserSettings.Get(group='nviz', key='surface',
+                                               subkey='draw').iteritems():
             if control[:3] == 'res':
                 if 'resolution' not in data['draw']:
                     data['draw']['resolution'] = {}
@@ -67,7 +69,7 @@ class NvizSettings(object):
                     data['draw']['resolution']['update'] = None
                 data['draw']['resolution'][control[4:]] = value
                 continue
-            
+
             if control == 'wire-color':
                 value = str(value[0]) + ':' + str(value[1]) + ':' + str(value[2])
             elif control in ('mode', 'style', 'shading'):
@@ -77,21 +79,21 @@ class NvizSettings(object):
 
             data['draw'][control] = { 'value' : value }
             data['draw'][control]['update'] = None
-        
+
         value, desc = self.GetDrawMode(UserSettings.Get(group='nviz', key='surface', subkey=['draw', 'mode']),
                                        UserSettings.Get(group='nviz', key='surface', subkey=['draw', 'style']),
                                        UserSettings.Get(group='nviz', key='surface', subkey=['draw', 'shading']))
-    
+
         data['draw']['mode'] = { 'value' : value,
-                                 'desc' : desc, 
+                                 'desc' : desc,
                                  'update': None }
         # position
         for coord in ('x', 'y', 'z'):
             data['position'][coord] = UserSettings.Get(group='nviz', key='surface', subkey=['position', coord])
         data['position']['update'] = None
-            
+
         return data
-    
+
     def SetVolumeDefaultProp(self):
         """Set default volume data properties"""
         data = dict()
@@ -99,7 +101,7 @@ class NvizSettings(object):
             data[sec] = dict()
             for sec in ('isosurface', 'slice'):
                     data[sec] = list()
-        
+
         #
         # draw
         #
@@ -107,7 +109,7 @@ class NvizSettings(object):
             if control == 'shading':
                 sel = UserSettings.Get(group='nviz', key='volume', subkey=['draw', 'shading'])
                 value, desc = self.GetDrawMode(shade=sel, string=False)
-                
+
                 data['draw']['shading'] = {}
                 data['draw']['shading']['isosurface'] = { 'value' : value,
                                                           'desc' : desc['shading'] }
@@ -132,7 +134,7 @@ class NvizSettings(object):
 
             if 'update' not in data['draw'][control]:
                 data['draw'][control]['update'] = None
-        
+
         #
         # isosurface attributes
         #
@@ -141,9 +143,9 @@ class NvizSettings(object):
             for key, value in UserSettings.Get(group='nviz', key='volume',
                                                subkey=attrb).iteritems():
                 data['attribute'][attrb][key] = value
-        
+
         return data
-    
+
     def SetIsosurfaceDefaultProp(self):
         """Set default isosurface properties"""
         data = dict()
@@ -152,59 +154,59 @@ class NvizSettings(object):
             data[attr]['update'] = None
             if attr == 'inout':
                 data[attr]['value'] = 0
-                continue                
+                continue
             for key, value in UserSettings.Get(group = 'nviz', key = 'volume',
                                                subkey = attr).iteritems():
                 data[attr][key] = value
         return data
-    
+
     def SetSliceDefaultProp(self):
         """Set default slice properties"""
         data = dict()
-        data['position'] = copy.deepcopy(UserSettings.Get(group = 'nviz', key = 'volume',
+        data['position'] = copy.deepcopy(UserSettings.Get(group='nviz', key='volume',
                                                subkey = 'slice_position'))
         data['position']['update'] = None
-        
-        data['transp'] = copy.deepcopy(UserSettings.Get(group = 'nviz', key = 'volume',
-                                               subkey = 'transp'))
+
+        data['transp'] = copy.deepcopy(UserSettings.Get(group='nviz', key='volume',
+                                                        subkey='transp'))
         return data
-    
-    def SetVectorDefaultProp(self, data = None):
+
+    def SetVectorDefaultProp(self, data=None):
         """Set default vector data properties"""
         if not data:
             data = dict()
         for sec in ('lines', 'points'):
             data[sec] = {}
-        
+
         self.SetVectorLinesDefaultProp(data['lines'])
         self.SetVectorPointsDefaultProp(data['points'])
 
         return data
-    
+
     def SetVectorLinesDefaultProp(self, data):
         """Set default vector properties -- lines"""
         # width
-        data['width'] = {'value' : UserSettings.Get(group='nviz', key='vector',
-                                                    subkey=['lines', 'width']) }
-        
+        data['width'] = {'value': UserSettings.Get(group='nviz', key='vector',
+                                                   subkey=['lines', 'width'])}
+
         # color
         value = UserSettings.Get(group='nviz', key='vector',
                                  subkey=['lines', 'color'])
         color = str(value[0]) + ':' + str(value[1]) + ':' + str(value[2])
-        data['color'] = { 'value' : color }
+        data['color'] = {'value': color}
 
         # mode
         if UserSettings.Get(group='nviz', key='vector',
                             subkey=['lines', 'flat']):
             type = 'flat'
-            
+
         else:
             type = 'surface'
-            
+
         data['mode'] = {}
         data['mode']['type'] = type
         data['mode']['update'] = None
-    
+
         # height
         data['height'] = { 'value' : UserSettings.Get(group='nviz', key='vector',
                                                       subkey=['lines', 'height']) }
@@ -219,7 +221,7 @@ class NvizSettings(object):
         if 'object' in data:
             for attrb in ('color', 'width', 'mode', 'height', 'thematic'):
                 data[attrb]['update'] = None
-        
+
     def SetVectorPointsDefaultProp(self, data):
         """Set default vector properties -- points"""
         # size
@@ -243,11 +245,11 @@ class NvizSettings(object):
         # mode
         data['mode'] = { 'type' : 'surface'}
 ##                         'surface' : '', }
-        
+
         # height
         data['height'] = { 'value' : UserSettings.Get(group='nviz', key='vector',
                                                       subkey=['points', 'height']) }
-        
+
         data['thematic'] = {'rgbcolumn' : UserSettings.Get(group='nviz', key='vector',
                                                       subkey=['points', 'rgbcolumn']),
                             'sizecolumn' : UserSettings.Get(group='nviz', key='vector',
@@ -259,7 +261,7 @@ class NvizSettings(object):
             for attrb in ('size', 'width', 'marker',
                           'color', 'height', 'thematic'):
                 data[attrb]['update'] = None
-        
+
     def GetDrawMode(self, mode=None, style=None, shade=None, string=False):
         """Get surface draw mode (value) from description/selection
 
@@ -267,11 +269,11 @@ class NvizSettings(object):
         :param style:
         :param shade:
         :param string: if True input parameters are strings otherwise
-        selections
+                       selections
         """
         if not wxnviz:
             return None
-        
+
         value = 0
         desc = {}
 
@@ -289,7 +291,7 @@ class NvizSettings(object):
                     value |= wxnviz.DM_GRID_WIRE
                 else: # surface
                     value |= wxnviz.DM_GRID_SURF
-                    
+
             if shade is not None:
                 if shade == 'flat':
                     value |= wxnviz.DM_FLAT
@@ -325,27 +327,35 @@ class NvizSettings(object):
             else: # surface
                 value |= wxnviz.DM_GOURAUD
                 desc['shading'] = 'gouraud'
-        
+
         return (value, desc)
-    
+
     def SetDecorDefaultProp(self, type):
         """Set default arrow properties
         """
         data = {}
-        
+
         # arrow
         if type == 'arrow':
-            data['arrow'] = copy.deepcopy(UserSettings.Get(group = 'nviz', key = 'arrow'))
+            data['arrow'] = copy.deepcopy(UserSettings.Get(group='nviz',
+                                                           key='arrow'))
             data['arrow']['color'] = "%d:%d:%d" % (
-                UserSettings.Get(group = 'nviz', key = 'arrow', subkey = 'color')[:3])
-            data['arrow'].update(copy.deepcopy(UserSettings.Get(group = 'nviz', key = 'arrow', internal = True)))
+                UserSettings.Get(group='nviz', key='arrow',
+                                 subkey='color')[:3])
+            data['arrow'].update(copy.deepcopy(UserSettings.Get(group='nviz',
+                                                                key='arrow',
+                                                                internal=True)))
             data['arrow']['show'] = False
-        
+
         # arrow
         if type == 'scalebar':
-            data['scalebar'] = copy.deepcopy(UserSettings.Get(group = 'nviz', key = 'scalebar'))
+            data['scalebar'] = copy.deepcopy(UserSettings.Get(group='nviz',
+                                                              key='scalebar'))
             data['scalebar']['color'] = "%d:%d:%d" % (
-                UserSettings.Get(group = 'nviz', key = 'scalebar', subkey = 'color')[:3])
-            data['scalebar'].update(copy.deepcopy(UserSettings.Get(group = 'nviz', key = 'scalebar', internal = True)))
+                UserSettings.Get(group='nviz', key='scalebar',
+                                 subkey='color')[:3])
+            data['scalebar'].update(copy.deepcopy(UserSettings.Get(group='nviz',
+                                                                   key='scalebar',
+                                                                   internal=True)))
             data['scalebar']['id'] = 0
         return data

+ 5 - 4
gui/wxpython/rlisetup/wizard.py

@@ -530,13 +530,14 @@ class FirstPage(TitledPage):
         """
         next = wx.FindWindowById(wx.ID_FORWARD)
         next.Enable(self.CheckInput())
-        wx.CallAfter(wx.FindWindowById(wx.ID_FORWARD).Enable, self.CheckInput())
+        wx.CallAfter(wx.FindWindowById(wx.ID_FORWARD).Enable,
+                     self.CheckInput())
 
     def CheckInput(self):
         """Check input fields.
 
         :return: True if configuration file is given and raster xor vector map,
-        False otherwise
+                 False otherwise
         """
         #R#return bool(self.conf_name and (bool(self.rast) != bool(self.vect)))
         return bool(self.conf_name and bool(self.rast))
@@ -1392,7 +1393,7 @@ class DrawSampleUnitsPage(TitledPage):
 
         gtype = self.parent.drawunits.drawtype
         self.mapPanel = RLiSetupMapPanel(self,
-                                         samplingType=self.parent.samplingareapage.samplingtype, 
+                                         samplingType=self.parent.samplingareapage.samplingtype,
                                          )
         if gtype == 'circle':
             self.mapPanel.afterCircleDrawn.connect(self.SampleFrameChanged)
@@ -1639,7 +1640,7 @@ class SummaryPage(TitledPage):
                        flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL)
         self.sizer.Add(item=self.unitsmoretxt2, border=5, pos=(11, 1),
                        flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL)
-        
+
 
     def OnEnterPage(self, event):
         """Insert values into text controls for summary of location

+ 84 - 84
gui/wxpython/web_services/widgets.py

@@ -58,7 +58,7 @@ class WSPanel(wx.Panel):
     def __init__(self, parent, web_service, **kwargs):
         """Show data from capabilities file.
 
-        Signal: capParsed - this signal is emitted when capabilities file is downloaded 
+        Signal: capParsed - this signal is emitted when capabilities file is downloaded
                             (after ConnectToServer method was called)
 
         :param parent:  parent widget
@@ -68,7 +68,7 @@ class WSPanel(wx.Panel):
 
         self.parent = parent
         self.ws = web_service
-        
+
         self.capParsed = Signal('WSPanel.capParsed')
 
         # stores widgets, which represents parameters/flags of d.wms
@@ -93,14 +93,14 @@ class WSPanel(wx.Panel):
         self.drv_info = WMSDriversInfo()
         self.drv_props = self.drv_info.GetDrvProperties(self.ws)
 
-        self.ws_drvs = {    
+        self.ws_drvs = {
                         'WMS_1.1.1' : {
-                                        'cmd' : ['wms_version=1.1.1', 
+                                        'cmd' : ['wms_version=1.1.1',
                                                  'driver=WMS_GRASS'],
                                         'cap_parser' : lambda temp_file : WMSCapabilities(temp_file, '1.1.1'),
                                       },
                         'WMS_1.3.0' : {
-                                        'cmd' : ['wms_version=1.3.0', 
+                                        'cmd' : ['wms_version=1.3.0',
                                                  'driver=WMS_GRASS'],
                                         'cap_parser' : lambda temp_file : WMSCapabilities(temp_file, '1.3.0'),
                                       },
@@ -144,41 +144,41 @@ class WSPanel(wx.Panel):
     def _requestPage(self):
         """Create request page"""
         self.req_page_panel = wx.Panel(parent = self, id = wx.ID_ANY)
-        self.notebook.AddPage(page = self.req_page_panel, 
-                              text=_('Request'), 
+        self.notebook.AddPage(page = self.req_page_panel,
+                              text=_('Request'),
                               name = 'request')
 
         # list of layers
         self.layersBox = wx.StaticBox(parent = self.req_page_panel, id = wx.ID_ANY,
                                       label=_("List of layers "))
 
-        style = wx.TR_DEFAULT_STYLE | wx.TR_HAS_BUTTONS | wx.TR_FULL_ROW_HIGHLIGHT 
-        if self.drv_props['req_multiple_layers']: 
+        style = wx.TR_DEFAULT_STYLE | wx.TR_HAS_BUTTONS | wx.TR_FULL_ROW_HIGHLIGHT
+        if self.drv_props['req_multiple_layers']:
             style = style | wx.TR_MULTIPLE
         if 'WMS' not in self.ws:
             style = style | wx.TR_HIDE_ROOT
 
-        self.list = LayersList(parent = self.req_page_panel, 
-                               web_service = self.ws, 
+        self.list = LayersList(parent = self.req_page_panel,
+                               web_service = self.ws,
                                style = style)
 
-        self.params['format'] = None 
+        self.params['format'] = None
 
         self.params['srs'] = None
         if 'srs' not in  self.drv_props['ignored_params']:
             projText = wx.StaticText(parent = self.req_page_panel, id = wx.ID_ANY, label = _("Source projection:"))
             self.params['srs'] =  wx.Choice(parent = self.req_page_panel, id = wx.ID_ANY)
-        
+
         self.list.Bind(wx.EVT_TREE_SEL_CHANGED, self.OnListSelChanged)
-        
+
         # layout
         self.req_page_sizer = wx.BoxSizer(wx.VERTICAL)
-        
+
         layersSizer = wx.StaticBoxSizer(self.layersBox, wx.HORIZONTAL)
 
         layersSizer.Add(item = self.list, proportion = 1,
                         flag = wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, border = 5)
-        
+
         self.req_page_sizer.Add(item = layersSizer, proportion = 1,
                             flag = wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, border = 5)
 
@@ -187,17 +187,17 @@ class WSPanel(wx.Panel):
         if self.params['format'] is not None:
             self.source_sizer.Add(item = self.params['format'],
                                   flag = wx.LEFT | wx.RIGHT | wx.BOTTOM, border = 5)
- 
+
         if self.params['srs'] is not None:
             self.source_sizer.Add(item = projText, flag = wx.ALIGN_CENTER_VERTICAL | wx.ALL, border = 5)
             self.source_sizer.Add(item = self.params['srs'],
                                   flag = wx.ALIGN_CENTER_VERTICAL | wx.RIGHT | wx.TOP | wx.BOTTOM, border = 5)
-        
+
         self.req_page_sizer.Add(item = self.source_sizer,
                                 flag = wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, border = 5)
-        
+
         self.req_page_panel.SetSizer(self.req_page_sizer)
-    
+
     def enableButtons(self, enable = True):
         """Enable/disable up, down, buttons
         """
@@ -210,8 +210,8 @@ class WSPanel(wx.Panel):
         #TODO parse maxcol, maxrow, settings from d.wms module?
         #TODO OnEarth driver - add selection of time
         adv_setts_panel = wx.Panel(parent = self, id = wx.ID_ANY)
-        self.notebook.AddPage(page = adv_setts_panel, 
-                              text=_('Advanced request settings'), 
+        self.notebook.AddPage(page = adv_setts_panel,
+                              text=_('Advanced request settings'),
                               name = 'adv_req_setts')
 
         labels = {}
@@ -219,7 +219,7 @@ class WSPanel(wx.Panel):
         if 'WMS' in self.ws:
             labels['l_order'] = wx.StaticBox(parent = adv_setts_panel, id = wx.ID_ANY,
                                              label = _("Order of layers in raster"))
-            self.l_odrder_list = wx.ListBox(adv_setts_panel, id = wx.ID_ANY, choices = [], 
+            self.l_odrder_list = wx.ListBox(adv_setts_panel, id = wx.ID_ANY, choices = [],
                                                                 style = wx.LB_SINGLE|wx.LB_NEEDED_SB)
             self.btnUp = wx.Button(adv_setts_panel, id = wx.ID_ANY, label = _("Up"))
             self.btnDown = wx.Button(adv_setts_panel, id = wx.ID_ANY, label = _("Down"))
@@ -274,35 +274,35 @@ class WSPanel(wx.Panel):
         # layout
 
         border = wx.BoxSizer(wx.VERTICAL)
-       
+
         if 'WMS' in self.ws:
 
             boxSizer = wx.StaticBoxSizer(labels['l_order'], wx.VERTICAL)
             gridSizer  =  wx.GridBagSizer (hgap = 3, vgap = 3)
 
-            gridSizer.Add(self.l_odrder_list, 
-                          pos = (0,0), 
-                          span = (4, 1), 
-                          flag = wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 
+            gridSizer.Add(self.l_odrder_list,
+                          pos = (0,0),
+                          span = (4, 1),
+                          flag = wx.ALIGN_CENTER_VERTICAL|wx.EXPAND,
                           border = 0)
-        
+
             gridSizer.Add(self.btnUp,
-                          pos = (0,1), 
-                          flag = wx.ALIGN_CENTER_VERTICAL, 
+                          pos = (0,1),
+                          flag = wx.ALIGN_CENTER_VERTICAL,
                           border = 0)
 
-            gridSizer.Add(self.btnDown, 
-                          pos = (1,1), 
+            gridSizer.Add(self.btnDown,
+                          pos = (1,1),
                           flag = wx.ALIGN_CENTER_VERTICAL,
                           border = 0)
-        
+
             gridSizer.AddGrowableCol(0)
             boxSizer.Add(gridSizer,
                          flag = wx.EXPAND | wx.ALL,
                          border = 5)
 
             border.Add(item = boxSizer,
-                       flag = wx.LEFT | wx.RIGHT | wx.UP | wx.EXPAND, 
+                       flag = wx.LEFT | wx.RIGHT | wx.UP | wx.EXPAND,
                        border = 5)
 
         gridSizer  =  wx.GridBagSizer (hgap = 3, vgap = 3)
@@ -338,7 +338,7 @@ class WSPanel(wx.Panel):
 
         gridSizer.AddGrowableCol(0)
         border.Add(item = gridSizer,
-                   flag = wx.LEFT | wx.RIGHT | wx.TOP | wx.EXPAND, 
+                   flag = wx.LEFT | wx.RIGHT | wx.TOP | wx.EXPAND,
                    border = 5)
 
         if self.params['urlparams']:
@@ -357,7 +357,7 @@ class WSPanel(wx.Panel):
                           pos = (row, 1))
 
             border.Add(item = gridSizer,
-                       flag = wx.LEFT | wx.RIGHT | wx.TOP | wx.EXPAND, 
+                       flag = wx.LEFT | wx.RIGHT | wx.TOP | wx.EXPAND,
                        border = 5)
 
         adv_setts_panel.SetSizer(border)
@@ -368,9 +368,9 @@ class WSPanel(wx.Panel):
         if self.l_odrder_list.GetSelections():
             pos = self.l_odrder_list.GetSelection()
             if pos:
-                self.sel_layers.insert(pos - 1, self.sel_layers.pop(pos))               
+                self.sel_layers.insert(pos - 1, self.sel_layers.pop(pos))
             if pos > 0:
-                self._updateLayerOrderList(selected = (pos - 1)) 
+                self._updateLayerOrderList(selected = (pos - 1))
             else:
                 self._updateLayerOrderList(selected = 0)
 
@@ -382,7 +382,7 @@ class WSPanel(wx.Panel):
             if pos != len(self.sel_layers) - 1:
                 self.sel_layers.insert(pos + 1, self.sel_layers.pop(pos))
             if pos < len(self.sel_layers) -1:
-                self._updateLayerOrderList(selected = (pos + 1)) 
+                self._updateLayerOrderList(selected = (pos + 1))
             else:
                 self._updateLayerOrderList(selected = len(self.sel_layers) -1)
 
@@ -409,8 +409,8 @@ class WSPanel(wx.Panel):
         else:
             self.enableButtons(True)
             if selected is not None:
-                self.l_odrder_list.SetSelection(selected)  
-                self.l_odrder_list.EnsureVisible(selected)  
+                self.l_odrder_list.SetSelection(selected)
+                self.l_odrder_list.EnsureVisible(selected)
 
     def OnTransparent(self, event):
         checked = event.IsChecked()
@@ -527,7 +527,7 @@ class WSPanel(wx.Panel):
 
     def UpdateWidgetsByCmd(self, cmd):
         """Update panel widgets accordnig to passed cmd tuple
-        
+
         :param cmd: cmd in tuple
         """
 
@@ -556,7 +556,7 @@ class WSPanel(wx.Panel):
         for i in range(len(layers)):
             l_st_list.append({'style' : styles[i],
                               'layer' : layers[i]})
-        
+
         # WMS standard - first layer in params is most bottom...
         # therefore layers order need to be reversed
         l_st_list = [l for l in reversed(l_st_list)]
@@ -573,7 +573,7 @@ class WSPanel(wx.Panel):
         for p, v in params.iteritems():
             if self.params[p]:
                 self.params[p].SetStringSelection(v)
-   
+
         for p, conv_f in [('urlparams', None), ('maxcols', int), ('maxrows', int)]:
             if dcmd.has_key(p):
                 v = dcmd[p]
@@ -592,7 +592,7 @@ class WSPanel(wx.Panel):
             if len(bgcolor) == 8 and \
                '0x' == bgcolor[:2]:
 
-                colour= '#' + bgcolor[2:]
+                colour = '#' + bgcolor[2:]
                 self.params['bgcolor'].SetColour(colour)
 
     def IsConnected(self):
@@ -606,10 +606,10 @@ class WSPanel(wx.Panel):
         self.capParsed.emit(error_msg=error_msg)
 
     def CreateCmd(self):
-        """Create d.wms cmd from values of panels widgets 
+        """Create d.wms cmd from values of panels widgets
 
         :return: cmd list
-        :return: None if required widgets do not have selected/filled values. 
+        :return: None if required widgets do not have selected/filled values.
         """
 
         # check required widgets
@@ -620,8 +620,8 @@ class WSPanel(wx.Panel):
         lcmd = self.ws_cmdl
         lcmd = ['d.wms'] + lcmd
 
-        layers="layers="
-        styles='styles='
+        layers = "layers="
+        styles = 'styles='
         first = True
 
         # WMS standard - first layer in params is most bottom...
@@ -631,7 +631,7 @@ class WSPanel(wx.Panel):
                 layers += ','
                 styles += ','
             first = False
-            layers += layer['name'] 
+            layers += layer['name']
             if layer['style'] is not None:
                 styles += layer['style']['name']
 
@@ -659,7 +659,7 @@ class WSPanel(wx.Panel):
 
             c = self.params['bgcolor'].GetColour()
             hex_color = wx.Colour(c[0], c[1], c[2]).GetAsString(wx.C2S_HTML_SYNTAX)
-            lcmd.append("bgcolor=" + '0x' + hex_color[1:]) 
+            lcmd.append("bgcolor=" + '0x' + hex_color[1:])
 
         lcmd.append("map=" + self.o_layer_name)
 
@@ -683,7 +683,7 @@ class WSPanel(wx.Panel):
         else:
             self.sel_layers = curr_sel_ls
 
-        # update projection 
+        # update projection
 
         self.projs_list = []
         projs_list = []
@@ -716,7 +716,6 @@ class WSPanel(wx.Panel):
             self.projs_list = sorted(self.projs_list)
             self.params['srs'].SetItems(self.projs_list)
 
-
             if cur_sel:
                 self.params['srs'].SetStringSelection(cur_sel)
             else:
@@ -764,15 +763,16 @@ class WSPanel(wx.Panel):
             self.req_page_sizer.Detach(self.params['format'])
             self.params['format'].Destroy()
         if len(self.formats_list) > 0:
-            self.params['format'] =  wx.RadioBox(parent = self.req_page_panel, id = wx.ID_ANY, 
-                                                 label = _("Source image format"), pos = wx.DefaultPosition, 
-                                                 choices = formats_list,  majorDimension = 4, 
+            self.params['format'] =  wx.RadioBox(parent = self.req_page_panel, id = wx.ID_ANY,
+                                                 label = _("Source image format"), pos = wx.DefaultPosition,
+                                                 choices = formats_list,  majorDimension = 4,
                                                  style = wx.RA_SPECIFY_COLS)
-            self.source_sizer.Insert(item = self.params['format'], before = 2,
-                                     flag = wx.LEFT | wx.RIGHT | wx.BOTTOM, border = 5)
-        
-    def _getFormats(self, layer = None):
-        """Get formats 
+            self.source_sizer.Insert(item=self.params['format'], before=2,
+                                     flag=wx.LEFT | wx.RIGHT | wx.BOTTOM,
+                                     border=5)
+
+    def _getFormats(self, layer=None):
+        """Get formats
 
         WMS has formats defined generally for whole cap.
         In WMTS and NASA OnEarh formats are defined for layer.
@@ -792,7 +792,7 @@ class WSPanel(wx.Panel):
 
         return formats_label
 
-    def _checkImportValues(self,): 
+    def _checkImportValues(self,):
         """Check if required widgets are selected/filled
         """
         warning_str = ""
@@ -812,12 +812,11 @@ class WSPanel(wx.Panel):
             show_war = True
 
         if not self.o_layer_name:
-            warning_str += _("Choose output layer name.\n")  
+            warning_str += _("Choose output layer name.\n")
             show_war = True
 
         if show_war:
-            GMessage(parent = self.parent,
-                     message = warning_str)
+            GMessage(parent=self.parent, message=warning_str)
             return False
 
         return True
@@ -840,6 +839,7 @@ class WSPanel(wx.Panel):
         """
         return self.ws
 
+
 class LayersList(TreeListCtrl, listmix.ListCtrlAutoWidthMixin):
     def __init__(self, parent, web_service, style, pos=wx.DefaultPosition):
         """List of layers and styles available in capabilities file
@@ -848,7 +848,7 @@ class LayersList(TreeListCtrl, listmix.ListCtrlAutoWidthMixin):
         self.ws = web_service
 
         TreeListCtrl.__init__(self, parent = parent, id = wx.ID_ANY, style = style)
-        
+
         # setup mixins
         listmix.ListCtrlAutoWidthMixin.__init__(self)
         if self.ws != 'OnEarth':
@@ -859,7 +859,7 @@ class LayersList(TreeListCtrl, listmix.ListCtrlAutoWidthMixin):
 
         self.SetMainColumn(0) # column with the tree
         self.setResizeColumn(0)
-        
+
         self.root = None
         self.Bind(wx.EVT_TREE_SEL_CHANGING, self.OnListSelChanging)
 
@@ -873,10 +873,10 @@ class LayersList(TreeListCtrl, listmix.ListCtrlAutoWidthMixin):
 
         if not cap:
             return
-    
+
         def AddLayerChildrenToTree(parent_layer, parent_item):
             """Recursive function which adds all capabilities
-            layers/styles to the LayersList. 
+            layers/styles to the LayersList.
             """
             def gettitle(layer):
                 """Helper function"""
@@ -915,9 +915,9 @@ class LayersList(TreeListCtrl, listmix.ListCtrlAutoWidthMixin):
                         self.SetItemText(style_item, _('style'), 1)
 
                     self.SetPyData(style_item, {'type' : 'style',
-                                                'layer' : layer, # it is parent layer of style 
+                                                'layer' : layer, # it is parent layer of style
                                                 'style' : st})
- 
+
                 self.SetPyData(item, {'type' : 'layer', # is it layer or style?
                                       'layer' : layer,  # Layer instance from web_services.cap_interface
                                       'style' : def_st}) # layer can have assigned default style
@@ -929,7 +929,7 @@ class LayersList(TreeListCtrl, listmix.ListCtrlAutoWidthMixin):
                 addlayer(parent_layer, parent_item)
 
             for layer in parent_layer.GetChildren():
-                item = self.AppendItem(parent_item, gettitle(layer)) 
+                item = self.AppendItem(parent_item, gettitle(layer))
                 addlayer(layer, item)
                 AddLayerChildrenToTree(layer, item)
 
@@ -940,11 +940,11 @@ class LayersList(TreeListCtrl, listmix.ListCtrlAutoWidthMixin):
         """Get selected layers/styles in LayersList
 
         :return: dict with these items:
-                    'name'  : layer name used for request
-                              if it is style, it is name of parent layer
-                    'title' : layer title
-                    'style' : {'name' : 'style name', title : 'style title'}
-                    'cap_intf_l' : *Layer instance from web_services.cap_interface
+                 * 'name'  : layer name used for request
+                   if it is style, it is name of parent layer
+                 * 'title' : layer title
+                 * 'style' : {'name' : 'style name', title : 'style title'}
+                 * 'cap_intf_l' : \*Layer instance from web_services.cap_interface
         """
         sel_layers = self.GetSelections()
         sel_layers_dict = []
@@ -953,7 +953,7 @@ class LayersList(TreeListCtrl, listmix.ListCtrlAutoWidthMixin):
                 layer = self.GetPyData(s)['layer']
             except ValueError:
                 continue
-            sel_layers_dict.append({ 
+            sel_layers_dict.append({
                                     'name' : layer.GetLayerData('name'),
                                     'title' : layer.GetLayerData('title'),
                                     'style' : self.GetPyData(s)['style'],
@@ -997,7 +997,7 @@ class LayersList(TreeListCtrl, listmix.ListCtrlAutoWidthMixin):
             while True:
                 _selectRequestableChildren(chck_item, items_to_chck, items_to_sel)
                 if items_to_chck:
-                    chck_item = items_to_chck.pop() 
+                    chck_item = items_to_chck.pop()
                 else:
                     break
 
@@ -1005,7 +1005,7 @@ class LayersList(TreeListCtrl, listmix.ListCtrlAutoWidthMixin):
                 self.SelectItem(items_to_sel.pop(), unselect_others=False)
         else:
             _emitSelected(self.GetPyData(cur_item)['layer'])
-          
+
     def GetItemCount(self):
         """Required for listmix.ListCtrlAutoWidthMixin
         """
@@ -1052,14 +1052,14 @@ class LayersList(TreeListCtrl, listmix.ListCtrlAutoWidthMixin):
 
         self.UnselectAll()
 
-        l_st_list = deepcopy(l_st_list)        
+        l_st_list = deepcopy(l_st_list)
         root_item = self.GetRootItem()
 
         items_to_sel = [None] * len(l_st_list)
         checknext(root_item, l_st_list, items_to_sel)
 
         # items are selected according to position in l_st_list
-        # to be added to Layers order list in right order 
+        # to be added to Layers order list in right order
         for i in items_to_sel:
             if not i:
                 continue
@@ -1085,7 +1085,7 @@ class WSManageSettingsWidget(ManageSettingsWidget):
         self.btnAddDefaultServers = wx.Button(parent=self, id=wx.ID_ANY,
                                              label=_("Add default servers"))
         self.btnAddDefaultServers.Bind(wx.EVT_BUTTON, self.OnAddDefaultServers)
-        
+
         ManageSettingsWidget._layout(self)
         self.settingsSizer.Add(item=self.btnAddDefaultServers,
                                flag=wx.RIGHT,