Browse Source

sphinx documentation: backported 60817, 61141 and following related to python sphinx documentation

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@62706 15284696-431f-4ddb-bdfa-cd5b030d7da7
Luca Delucchi 10 years ago
parent
commit
2bafbf74cf
100 changed files with 4848 additions and 3987 deletions
  1. 1 0
      Makefile
  2. 0 4
      gui/wxpython/Makefile
  3. 14 14
      gui/wxpython/animation/anim.py
  4. 3 3
      gui/wxpython/animation/controller.py
  5. 3 3
      gui/wxpython/animation/data.py
  6. 14 14
      gui/wxpython/animation/dialogs.py
  7. 6 6
      gui/wxpython/animation/frame.py
  8. 2 1
      gui/wxpython/animation/g.gui.animation.py
  9. 10 10
      gui/wxpython/animation/mapwindow.py
  10. 1 1
      gui/wxpython/animation/nviztask.py
  11. 98 97
      gui/wxpython/animation/provider.py
  12. 15 12
      gui/wxpython/animation/temporal_manager.py
  13. 12 12
      gui/wxpython/animation/toolbars.py
  14. 29 31
      gui/wxpython/animation/utils.py
  15. 10 11
      gui/wxpython/core/debug.py
  16. 71 63
      gui/wxpython/core/gcmd.py
  17. 61 57
      gui/wxpython/core/gconsole.py
  18. 72 53
      gui/wxpython/core/giface.py
  19. 7 7
      gui/wxpython/core/globalvar.py
  20. 70 68
      gui/wxpython/core/layerlist.py
  21. 4 4
      gui/wxpython/core/menutree.py
  22. 400 388
      gui/wxpython/core/render.py
  23. 33 33
      gui/wxpython/core/settings.py
  24. 50 48
      gui/wxpython/core/toolboxes.py
  25. 27 27
      gui/wxpython/core/treemodel.py
  26. 23 27
      gui/wxpython/core/units.py
  27. 122 109
      gui/wxpython/core/utils.py
  28. 59 59
      gui/wxpython/core/workspace.py
  29. 17 16
      gui/wxpython/core/ws.py
  30. 151 144
      gui/wxpython/dbmgr/base.py
  31. 42 42
      gui/wxpython/dbmgr/dialogs.py
  32. 15 15
      gui/wxpython/dbmgr/manager.py
  33. 25 25
      gui/wxpython/dbmgr/sqlbuilder.py
  34. 8 8
      gui/wxpython/dbmgr/vinfo.py
  35. 5 4
      gui/wxpython/docs/wxGUI.html
  36. 53 16
      lib/python/pygrass/docs/Makefile
  37. 0 0
      gui/wxpython/docs/wxgui_sphinx/_static/pygrass.css
  38. 1 1
      lib/python/pygrass/docs/_templates/layout.html.template
  39. 9 0
      gui/wxpython/docs/wxgui_sphinx/_templates/oholosidebar.html
  40. 80 36
      lib/python/pygrass/docs/conf.py
  41. 55 3
      lib/python/pygrass/docs/make.bat
  42. 27 0
      gui/wxpython/docs/wxgui_sphinx/src/index.rst
  43. 23 0
      gui/wxpython/docs/wxgui_sphinx/src/wxgui_libraries.rst
  44. 402 0
      gui/wxpython/docs/wxgui_sphinx/src/wxgui_toolboxes.rst
  45. 16 0
      gui/wxpython/docs/wxgui_sphinx/src/wxgui_tools.rst
  46. 3 2
      gui/wxpython/gcp/g.gui.gcp.py
  47. 58 57
      gui/wxpython/gcp/manager.py
  48. 24 24
      gui/wxpython/gcp/mapdisplay.py
  49. 4 4
      gui/wxpython/gcp/statusbar.py
  50. 6 6
      gui/wxpython/gcp/toolbars.py
  51. 25 25
      gui/wxpython/gis_set.py
  52. 1 1
      gui/wxpython/gis_set_error.py
  53. 65 65
      gui/wxpython/gmodeler/dialogs.py
  54. 112 106
      gui/wxpython/gmodeler/frame.py
  55. 6 3
      gui/wxpython/gmodeler/giface.py
  56. 1 1
      gui/wxpython/gmodeler/menudata.py
  57. 217 216
      gui/wxpython/gmodeler/model.py
  58. 12 12
      gui/wxpython/gmodeler/preferences.py
  59. 3 3
      gui/wxpython/gmodeler/toolbars.py
  60. 188 182
      gui/wxpython/gui_core/dialogs.py
  61. 60 51
      gui/wxpython/gui_core/forms.py
  62. 17 16
      gui/wxpython/gui_core/ghelp.py
  63. 51 50
      gui/wxpython/gui_core/goutput.py
  64. 400 392
      gui/wxpython/gui_core/gselect.py
  65. 101 96
      gui/wxpython/gui_core/mapdisp.py
  66. 15 15
      gui/wxpython/gui_core/menu.py
  67. 28 27
      gui/wxpython/gui_core/preferences.py
  68. 28 27
      gui/wxpython/gui_core/prompt.py
  69. 6 5
      gui/wxpython/gui_core/pystc.py
  70. 13 13
      gui/wxpython/gui_core/query.py
  71. 27 27
      gui/wxpython/gui_core/simplelmgr.py
  72. 41 40
      gui/wxpython/gui_core/toolbars.py
  73. 23 23
      gui/wxpython/gui_core/treeview.py
  74. 298 282
      gui/wxpython/gui_core/widgets.py
  75. 60 58
      gui/wxpython/iclass/dialogs.py
  76. 25 24
      gui/wxpython/iclass/digit.py
  77. 104 98
      gui/wxpython/iclass/frame.py
  78. 24 24
      gui/wxpython/iclass/plots.py
  79. 19 18
      gui/wxpython/iclass/statistics.py
  80. 16 16
      gui/wxpython/iclass/toolbars.py
  81. 6 6
      gui/wxpython/icons/icon.py
  82. 111 10
      gui/wxpython/iscatt/controllers.py
  83. 1 1
      gui/wxpython/iscatt/core_c.py
  84. 18 18
      gui/wxpython/iscatt/dialogs.py
  85. 7 7
      gui/wxpython/iscatt/frame.py
  86. 13 16
      gui/wxpython/iscatt/iscatt_core.py
  87. 4 4
      gui/wxpython/iscatt/plots.py
  88. 7 7
      gui/wxpython/iscatt/toolbars.py
  89. 139 135
      gui/wxpython/lmgr/frame.py
  90. 34 28
      gui/wxpython/lmgr/giface.py
  91. 92 87
      gui/wxpython/lmgr/layertree.py
  92. 1 1
      gui/wxpython/lmgr/menudata.py
  93. 9 8
      gui/wxpython/lmgr/pyshell.py
  94. 15 15
      gui/wxpython/lmgr/toolbars.py
  95. 5 5
      gui/wxpython/location_wizard/base.py
  96. 12 12
      gui/wxpython/location_wizard/dialogs.py
  97. 56 56
      gui/wxpython/location_wizard/wizard.py
  98. 90 89
      gui/wxpython/mapdisp/frame.py
  99. 1 1
      gui/wxpython/mapdisp/gprint.py
  100. 0 0
      gui/wxpython/mapdisp/main.py

+ 1 - 0
Makefile

@@ -126,6 +126,7 @@ distclean: clean
 include $(MODULE_TOPDIR)/include/Make/Install.make
 include $(MODULE_TOPDIR)/include/Make/Docs.make
 include $(MODULE_TOPDIR)/include/Make/Doxygen.make
+include $(MODULE_TOPDIR)/include/Make/Sphinx.make
 
 DOXNAME=grass
 

+ 0 - 4
gui/wxpython/Makefile

@@ -4,7 +4,6 @@ SUBDIRS = docs animation mapswipe gmodeler rlisetup psmap dbmgr vdigit iclass gc
 EXTRA_CLEAN_FILES = menustrings.py build_ext.pyc xml/menudata.xml xml/module_tree_menudata.xml
 
 include $(MODULE_TOPDIR)/include/Make/Dir.make
-include $(MODULE_TOPDIR)/include/Make/Doxygen.make
 include $(MODULE_TOPDIR)/include/Make/Python.make
 
 DSTDIR = $(GUIDIR)/wxpython
@@ -62,6 +61,3 @@ $(DSTDIRS): %: | $(DSTDIR)
 
 $(DSTDIR):
 	$(MKDIR) $@
-
-#doxygen:
-DOXNAME = wxpython

+ 14 - 14
gui/wxpython/animation/anim.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package animation.anim
 
 @brief Animation class controls frame order
@@ -20,7 +20,7 @@ from core.utils import _
 
 
 class Animation(wx.EvtHandler):
-    """!Animation class specifies which frame to show at which instance."""
+    """Animation class specifies which frame to show at which instance."""
     def __init__(self):
         wx.EvtHandler.__init__(self)
 
@@ -37,33 +37,33 @@ class Animation(wx.EvtHandler):
         self.isActive = False
 
     def IsActive(self):
-        """!Returns if the animation is active or not"""
+        """Returns if the animation is active or not"""
         return self.isActive
 
     def SetActive(self, active):
         self.isActive = active
 
     def SetFrames(self, frames):
-        """!Sets animation frames.
+        """Sets animation frames.
 
-        @param frames list of strings
+        :param frames: list of strings
         """
         self.frames = frames
 
     def GetFrame(self, index):
-        """!Returns animation frame"""
+        """Returns animation frame"""
         if len(self.frames) <= 1:  # special case handling (only 1 map)
             return self.frames[0]
         return self.frames[index]
 
     def GetCount(self):
-        """!Get frame count."""
+        """Get frame count."""
         return len(self.frames)
 
     count = property(fget=GetCount)
 
     def GetReplayMode(self):
-        """!Returns replay mode (loop)."""
+        """Returns replay mode (loop)."""
         return self._replayMode
 
     def SetReplayMode(self, mode):
@@ -80,15 +80,15 @@ class Animation(wx.EvtHandler):
     orientation = property(fset=SetOrientation, fget=GetOrientation)
 
     def SetCallbackUpdateFrame(self, callback):
-        """!Sets function to be called when updating frame."""
+        """Sets function to be called when updating frame."""
         self.callbackUpdateFrame = callback
 
     def SetCallbackEndAnimation(self, callback):
-        """!Sets function to be called when animation ends."""
+        """Sets function to be called when animation ends."""
         self.callbackEndAnimation = callback
 
     def SetCallbackOrientationChanged(self, callback):
-        """!Sets function to be called when orientation changes."""
+        """Sets function to be called when orientation changes."""
         self.callbackOrientationChanged = callback
 
     def Start(self):
@@ -106,7 +106,7 @@ class Animation(wx.EvtHandler):
         self.callbackEndAnimation(self.currentIndex, self.GetFrame(self.currentIndex))
 
     def _arrivedToEnd(self):
-        """!Decides which action to do after animation end (stop, repeat)."""
+        """Decides which action to do after animation end (stop, repeat)."""
         if not self.IsActive():
             return
         if self.replayMode == ReplayMode.ONESHOT:
@@ -128,7 +128,7 @@ class Animation(wx.EvtHandler):
                 self.callbackOrientationChanged(Orientation.FORWARD)
 
     def Update(self):
-        """!Updates frame."""
+        """Updates frame."""
         if not self.IsActive():
             return
 
@@ -143,7 +143,7 @@ class Animation(wx.EvtHandler):
                 self._arrivedToEnd()
 
     def FrameChangedFromOutside(self, index):
-        """!Let the animation know that frame was changed from outside."""
+        """Let the animation know that frame was changed from outside."""
         if not self.IsActive():
             return
         self.currentIndex = index

+ 3 - 3
gui/wxpython/animation/controller.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package animation.controller
 
 @brief Animations management
@@ -259,9 +259,9 @@ class AnimationController(wx.EvtHandler):
         self._setAnimations()
 
     def SetAnimations(self, layerLists):
-        """!Set animation data directly.
+        """Set animation data directly.
 
-        @param layerLists list of layerLists
+        :param layerLists: list of layerLists
         """
         try:
             animationData = []

+ 3 - 3
gui/wxpython/animation/data.py

@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-"""!
+"""
 @package animation.data
 
 @brief animation data structures
@@ -76,7 +76,7 @@ class AnimationData(object):
     windowIndex = property(fget=GetWindowIndex, fset=SetWindowIndex)
 
     def SetLayerList(self, layerList):
-        """!
+        """
         Throws GException if layer list's combination of stds is not valid.
         """
         mapSeriesList = []
@@ -270,7 +270,7 @@ class AnimationData(object):
 
 
 class AnimLayer(Layer):
-    """!Animation layer allows to add either space-time dataset
+    """Animation layer allows to add either space-time dataset
     or series of maps."""
     def __init__(self):
         Layer.__init__(self)

+ 14 - 14
gui/wxpython/animation/dialogs.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package animation.dialogs
 
 @brief Dialogs for animation management, changing speed of animation
@@ -87,7 +87,7 @@ class SpeedDialog(wx.Dialog):
     temporalMode = property(fset=SetTemporalMode, fget=GetTemporalMode)
 
     def _layout(self):
-        """!Layout window"""
+        """Layout window"""
         mainSizer = wx.BoxSizer(wx.VERTICAL)
         #
         # simple mode
@@ -259,7 +259,7 @@ class SpeedDialog(wx.Dialog):
         return delta
 
     def _total_seconds(self, delta):
-        """!timedelta.total_seconds is new in version 2.7.
+        """timedelta.total_seconds is new in version 2.7.
         """
         return delta.seconds + delta.days * 24 * 3600
 
@@ -475,7 +475,7 @@ class InputDialog(wx.Dialog):
         return panel
 
     def _enableRegionWidgets(self):
-        """!Enables/disables region widgets
+        """Enables/disables region widgets
         according to which radiobutton is active."""
         endReg = self.endRegRadio.GetValue()
         self.endRegion.Enable(endReg)
@@ -514,7 +514,7 @@ class InputDialog(wx.Dialog):
                                                   completed=(self.GetOptData, '', ''))
 
     def OnLegendProperties(self, event):
-        """!Set options for legend"""
+        """Set options for legend"""
         if self._tmpLegendCmd:
             cmd = self._tmpLegendCmd
         elif self.animationData.legendCmd:
@@ -526,7 +526,7 @@ class InputDialog(wx.Dialog):
                                                   completed=(self.GetOptData, '', ''))
 
     def GetOptData(self, dcmd, layer, params, propwin):
-        """!Process decoration layer data"""
+        """Process decoration layer data"""
         if dcmd:
             self._tmpLegendCmd = dcmd
 
@@ -1203,7 +1203,7 @@ class ExportDialog(wx.Dialog):
 
 
 class AnimSimpleLayerManager(SimpleLayerManager):
-    """!Simple layer manager for animation tool.
+    """Simple layer manager for animation tool.
     Allows to add space-time dataset or series of maps.
     """
     def __init__(self, parent, layerList,
@@ -1214,7 +1214,7 @@ class AnimSimpleLayerManager(SimpleLayerManager):
         self._3dActivated = False
 
     def OnAddStds(self, event):
-        """!Opens dialog for specifying temporal dataset.
+        """Opens dialog for specifying temporal dataset.
         Dummy layer is added first."""
         layer = AnimLayer()
         layer.hidden = True
@@ -1242,7 +1242,7 @@ class AnimSimpleLayerManager(SimpleLayerManager):
         self.anyChange.emit()
 
     def _layerChangeProperties(self, layer):
-        """!Opens new module dialog or recycles it."""
+        """Opens new module dialog or recycles it."""
         if not hasattr(layer, 'maps'):
             GUI(parent=self, giface=None,
                 modal=self._modal).ParseCommand(cmd=layer.cmd,
@@ -1251,14 +1251,14 @@ class AnimSimpleLayerManager(SimpleLayerManager):
             self.SetStdsProperties(layer)
 
     def Activate3D(self, activate=True):
-        """!Activates/deactivates certain tool depending on 2D/3D view."""
+        """Activates/deactivates certain tool depending on 2D/3D view."""
         self._toolbar.EnableTools(['addRaster', 'addVector',
                                    'opacity', 'up', 'down'], not activate)
         self._3dActivated = activate
 
 
 class AddTemporalLayerDialog(wx.Dialog):
-    """!Dialog for adding space-time dataset/ map series."""
+    """Dialog for adding space-time dataset/ map series."""
     def __init__(self, parent, layer, volume=False,
                  title=_("Add space-time dataset layer")):
         wx.Dialog.__init__(self, parent=parent, title=title)
@@ -1452,7 +1452,7 @@ class AddTemporalLayerDialog(wx.Dialog):
 
 
 class PreferencesDialog(PreferencesBaseDialog):
-    """!Animation preferences dialog"""
+    """Animation preferences dialog"""
     def __init__(self, parent, giface, title=_("Animation Tool settings"),
                  settings=UserSettings):
         PreferencesBaseDialog.__init__(self, parent=parent, giface=giface, title=title,
@@ -1481,7 +1481,7 @@ class PreferencesDialog(PreferencesBaseDialog):
         self.SetSize(self.size)
 
     def _createGeneralPage(self, notebook):
-        """!Create notebook page for general settings"""
+        """Create notebook page for general settings"""
         panel = SP.ScrolledPanel(parent=notebook)
         panel.SetupScrolling(scroll_x=False, scroll_y=True)
         notebook.AddPage(page=panel, text=_("General"))
@@ -1511,7 +1511,7 @@ class PreferencesDialog(PreferencesBaseDialog):
         return panel
 
     def _createTemporalPage(self, notebook):
-        """!Create notebook page for temporal settings"""
+        """Create notebook page for temporal settings"""
         panel = SP.ScrolledPanel(parent=notebook)
         panel.SetupScrolling(scroll_x=False, scroll_y=True)
         notebook.AddPage(page=panel, text=_("Time"))

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

@@ -1,4 +1,4 @@
-"""!
+"""
 @package animation.frame
 
 @brief Animation frame and different types of sliders
@@ -116,7 +116,7 @@ class AnimationFrame(wx.Frame):
         self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
 
     def InitStatusbar(self):
-        """!Init statusbar."""
+        """Init statusbar."""
         self.CreateStatusBar(number=1, style=0)
 
     def _addPanes(self):
@@ -132,7 +132,7 @@ class AnimationFrame(wx.Frame):
             self._mgr.GetPane('slider_' + name).Hide()
 
     def _addToolbar(self, name):
-        """!Add defined toolbar to the window
+        """Add defined toolbar to the window
 
         Currently known toolbars are:
          - 'mainToolbar'          - data management
@@ -172,9 +172,9 @@ class AnimationFrame(wx.Frame):
                               BestSize((self.toolbars['miscToolbar'].GetBestSize())))
 
     def SetAnimations(self, layerLists):
-        """!Set animation data
+        """Set animation data
 
-        @param layerLists list of layerLists
+        :param layerLists: list of layerLists
         """
         self.controller.SetAnimations(layerLists)
 
@@ -313,7 +313,7 @@ class AnimationFrame(wx.Frame):
         self.Destroy()
 
     def __del__(self):
-        """!It might not be called, therefore we try to clean it all in OnCloseWindow."""
+        """It might not be called, therefore we try to clean it all in OnCloseWindow."""
         if hasattr(self, 'controller') and hasattr(self.controller, 'timer'):
             if self.controller.timer.IsRunning():
                 self.controller.timer.Stop()

+ 2 - 1
gui/wxpython/animation/g.gui.animation.py

@@ -84,7 +84,8 @@ def main():
         
 
     if numInputs > 1:
-        grass.fatal(_("Options 'rast', 'vect', 'strds' and 'stvds' are mutually exclusive."))
+        grass.fatal(_("%s=, %s=, %s= and %s= are mutually exclusive.") %
+                ("rast", "vect", "strds", "stvds"))
         
     if numInputs > 0:
         # We need to initialize the temporal framework in case

+ 10 - 10
gui/wxpython/animation/mapwindow.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package animation.mapwindow
 
 @brief Animation window
@@ -115,7 +115,7 @@ class AnimationWindow(BufferedWindow):
         self.Bind(wx.EVT_MOUSE_EVENTS, self.OnMouseEvents)
 
     def Draw(self, dc):
-        """!Draws bitmap."""
+        """Draws bitmap."""
         Debug.msg(5, "AnimationWindow.Draw()")
 
         dc.Clear()  # make sure you clear the bitmap!
@@ -131,7 +131,7 @@ class AnimationWindow(BufferedWindow):
             event.Skip()
 
     def DrawBitmap(self, bitmap):
-        """!Draws bitmap.
+        """Draws bitmap.
         Does not draw the bitmap if it is the same one as last time.
         """
         if self.bitmap == bitmap:
@@ -149,11 +149,11 @@ class AnimationWindow(BufferedWindow):
         self._pdc.EndDrawing()
 
     def SetOverlay(self, bitmap, xperc, yperc):
-        """!Sets overlay bitmap (legend)
+        """Sets overlay bitmap (legend)
 
-        @param bitmap instance of wx.Bitmap
-        @param xperc x coordinate of bitmap top left corner in % of screen
-        @param yperc y coordinate of bitmap top left corner in % of screen
+        :param bitmap: instance of wx.Bitmap
+        :param xperc: x coordinate of bitmap top left corner in % of screen
+        :param yperc: y coordinate of bitmap top left corner in % of screen
         """
         Debug.msg(3, "AnimationWindow.SetOverlay()")
         if bitmap:
@@ -170,7 +170,7 @@ class AnimationWindow(BufferedWindow):
         self.UpdateDrawing()
 
     def ClearOverlay(self):
-        """!Clear overlay (legend) """
+        """Clear overlay (legend) """
         Debug.msg(3, "AnimationWindow.ClearOverlay()")
         self._overlay = None
         self._pdc.RemoveAll()
@@ -184,7 +184,7 @@ class AnimationWindow(BufferedWindow):
             self._pdc.DrawToDC(dc)
 
     def OnMouseEvents(self, event):
-        """!Handle mouse events."""
+        """Handle mouse events."""
         # If it grows larger, split it.
         current = event.GetPosition()
         if event.LeftDown():
@@ -209,6 +209,6 @@ class AnimationWindow(BufferedWindow):
             self._tmpMousePos = current
 
     def GetOverlayPos(self):
-        """!Returns x, y position in pixels"""
+        """Returns x, y position in pixels"""
         rect = self._pdc.GetIdBounds(1)
         return rect.GetX(), rect.GetY()

+ 1 - 1
gui/wxpython/animation/nviztask.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package animation.nviztask
 
 @brief Conversion from workspace file to m.nviz.image command

+ 98 - 97
gui/wxpython/animation/provider.py

@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-"""!
+"""
 @package animation.provider
 
 @brief Animation files and bitmaps management
@@ -38,7 +38,7 @@ from grass.pydispatch.signal import Signal
 
 
 class BitmapProvider:
-    """!Class for management of image files and bitmaps.
+    """Class for management of image files and bitmaps.
 
     There is one instance of this class in the application.
     It handles both 2D and 3D animations.
@@ -78,15 +78,15 @@ class BitmapProvider:
         self._composer.compositionContinues.connect(self.compositionContinues)
 
     def SetCmds(self, cmdsForComposition, opacities, regions=None):
-        """!Sets commands to be rendered with opacity levels.
+        """Sets commands to be rendered with opacity levels.
         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']],
-                 ...]
-        @param opacities list of opacity values
-        @param regions list of regions
+        :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']],
+                                   ...]
+        :param opacities: list of opacity values
+        :param regions: list of regions
         """
         Debug.msg(2, "BitmapProvider.SetCmds: {n} lists".format(n=len(cmdsForComposition)))
         self._cmdsForComposition.extend(cmdsForComposition)
@@ -96,17 +96,17 @@ class BitmapProvider:
         self._getUniqueCmds()
 
     def SetCmds3D(self, cmds, region):
-        """!Sets commands for 3D rendering.
+        """Sets commands for 3D rendering.
 
-        @param cmds list of commands m.nviz.image (cmd as a list)
-        @param region for 3D rendering
+        :param cmds: list of commands m.nviz.image (cmd as a list)
+        :param region: for 3D rendering
         """
         Debug.msg(2, "BitmapProvider.SetCmds3D: {c} commands".format(c=len(cmds)))
         self._cmds3D = cmds
         self._regionFor3D = region
 
     def _getUniqueCmds(self):
-        """!Returns list of unique commands.
+        """Returns list of unique commands.
         Takes into account the region assigned."""
         unique = list()
         for cmdList, region in zip(self._cmdsForComposition, self._regions):
@@ -121,7 +121,7 @@ class BitmapProvider:
                                            for cmdAndRegion in unique])
 
     def Unload(self):
-        """!Unloads currently loaded data.
+        """Unloads currently loaded data.
         Needs to be called before setting new data.
         """
         Debug.msg(2, "BitmapProvider.Unload")
@@ -141,11 +141,11 @@ class BitmapProvider:
             self._regionFor3D = None
 
     def _dryRender(self, uniqueCmds, regions, force):
-        """!Determines how many files will be rendered.
+        """Determines how many files will be rendered.
 
-        @param uniqueCmds list of commands which are to be rendered
-        @param force if forced rerendering
-        @param regions list of regions assigned to the commands
+        :param uniqueCmds: list of commands which are to be rendered
+        :param force: if forced rerendering
+        :param regions: list of regions assigned to the commands
         """
         count = 0
         for cmd, region in zip(uniqueCmds, regions):
@@ -160,12 +160,12 @@ class BitmapProvider:
         return count
 
     def _dryCompose(self, cmdLists, regions, force):
-        """!Determines how many lists of (commands) files
+        """Determines how many lists of (commands) files
         will be composed (with g.pnmcomp).
 
-        @param cmdLists list of commands lists which are to be composed
-        @param regions list of regions assigned to the commands
-        @param force if forced rerendering
+        :param cmdLists: list of commands lists which are to be composed
+        :param regions: list of regions assigned to the commands
+        :param force: if forced rerendering
         """
         count = 0
         for cmdList, region in zip(cmdLists, regions):
@@ -180,12 +180,12 @@ class BitmapProvider:
         return count
 
     def Load(self, force=False, bgcolor=(255, 255, 255), nprocs=4):
-        """!Loads data, both 2D and 3D. In case of 2D, it creates composites,
+        """Loads data, both 2D and 3D. In case of 2D, it creates composites,
         even when there is only 1 layer to compose (to be changed for speedup)
 
-        @param force if True reload all data, otherwise only missing data
-        @param bgcolor background color as a tuple of 3 values 0 to 255
-        @param nprocs number of procs to be used for rendering
+        :param force: if True reload all data, otherwise only missing data
+        :param bgcolor: background color as a tuple of 3 values 0 to 255
+        :param nprocs: number of procs to be used for rendering
         """
         Debug.msg(2, "BitmapProvider.Load: "
                      "force={f}, bgcolor={b}, nprocs={n}".format(f=force,
@@ -227,16 +227,16 @@ class BitmapProvider:
         self.mapsLoaded.emit()
 
     def RequestStopRendering(self):
-        """!Requests to stop rendering/composition"""
+        """Requests to stop rendering/composition"""
         Debug.msg(2, "BitmapProvider.RequestStopRendering")
         self._renderer.RequestStopRendering()
         self._composer.RequestStopComposing()
 
     def GetBitmap(self, dataId):
-        """!Returns bitmap with given key
+        """Returns bitmap with given key
         or 'no data' bitmap if no such key exists.
 
-        @param dataId name of bitmap
+        :param dataId: name of bitmap
         """
         try:
             bitmap = self._bitmapPool[dataId]
@@ -245,7 +245,7 @@ class BitmapProvider:
         return bitmap
 
     def WindowSizeChanged(self, width, height):
-        """!Sets size when size of related window changes."""
+        """Sets size when size of related window changes."""
         Debug.msg(5, "BitmapProvider.WindowSizeChanged: w={w}, h={h}".format(w=width, h=height))
 
         self.imageWidth, self.imageHeight = width, height
@@ -254,11 +254,11 @@ class BitmapProvider:
         self._composer.imageHeight = self._renderer.imageHeight = height
 
     def LoadOverlay(self, cmd):
-        """!Creates raster legend with d.legend
+        """Creates raster legend with d.legend
 
-        @param cmd d.legend command as a list
+        :param cmd: d.legend command as a list
 
-        @return bitmap with legend
+        :return: bitmap with legend
         """
         Debug.msg(5, "BitmapProvider.LoadOverlay: cmd={c}".format(c=cmd))
 
@@ -280,7 +280,7 @@ class BitmapProvider:
 
 
 class BitmapRenderer:
-    """!Class which renderes 2D and 3D images to files."""
+    """Class which renderes 2D and 3D images to files."""
     def __init__(self, mapFilesPool, tempDir,
                  imageWidth, imageHeight):
         self._mapFilesPool = mapFilesPool
@@ -293,14 +293,14 @@ class BitmapRenderer:
         self._isRendering = False
 
     def Render(self, cmdList, regions, regionFor3D, bgcolor, force, nprocs):
-        """!Renders all maps and stores files.
-
-        @param cmdList list of rendering commands to run
-        @param regions regions for 2D rendering assigned to commands
-        @param regionFor3D region for setting 3D view
-        @param bgcolor background color as a tuple of 3 values 0 to 255
-        @param force if True reload all data, otherwise only missing data
-        @param nprocs number of procs to be used for rendering
+        """Renders all maps and stores files.
+
+        :param cmdList: list of rendering commands to run
+        :param regions: regions for 2D rendering assigned to commands
+        :param regionFor3D: region for setting 3D view
+        :param bgcolor: background color as a tuple of 3 values 0 to 255
+        :param force: if True reload all data, otherwise only missing data
+        :param nprocs: number of procs to be used for rendering
         """
         Debug.msg(3, "BitmapRenderer.Render")
         count = 0
@@ -369,13 +369,13 @@ class BitmapRenderer:
         return not stopped
 
     def RequestStopRendering(self):
-        """!Requests to stop rendering."""
+        """Requests to stop rendering."""
         if self._isRendering:
             self._stopRendering = True
 
 
 class BitmapComposer:
-    """!Class which handles the composition of image files with g.pnmcomp."""
+    """Class which handles the composition of image files with g.pnmcomp."""
     def __init__(self, tempDir, mapFilesPool, bitmapPool,
                  imageWidth, imageHeight):
         self._mapFilesPool = mapFilesPool
@@ -389,14 +389,14 @@ class BitmapComposer:
         self._isComposing = False
 
     def Compose(self, cmdLists, regions, opacityList, bgcolor, force, nprocs):
-        """!Performs the composition of ppm/pgm files.
-
-        @param cmdLisst lists of rendering commands lists to compose
-        @param regions regions for 2D rendering assigned to commands
-        @param opacityList list of lists of opacity values
-        @param bgcolor background color as a tuple of 3 values 0 to 255
-        @param force if True reload all data, otherwise only missing data
-        @param nprocs number of procs to be used for rendering
+        """Performs the composition of ppm/pgm files.
+
+        :param cmdLists: lists of rendering commands lists to compose
+        :param regions: regions for 2D rendering assigned to commands
+        :param opacityList: list of lists of opacity values
+        :param bgcolor: background color as a tuple of 3 values 0 to 255
+        :param force: if True reload all data, otherwise only missing data
+        :param nprocs: number of procs to be used for rendering
         """
         Debug.msg(3, "BitmapComposer.Compose")
 
@@ -463,23 +463,23 @@ class BitmapComposer:
         self._isComposing = False
 
     def RequestStopComposing(self):
-        """!Requests to stop the composition."""
+        """Requests to stop the composition."""
         if self._isComposing:
             self._stopComposing = True
 
 
 def RenderProcess2D(imageWidth, imageHeight, tempDir, cmd, region, bgcolor, fileQueue):
-    """!Render raster or vector files as ppm image and write the
+    """Render raster or vector files as ppm image and write the
        resulting ppm filename in the provided file queue
 
-    @param imageWidth image width
-    @param imageHeight image height
-    @param tempDir directory for rendering
-    @param cmd d.rast/d.vect command as a list
-    @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
+    :param imageWidth: image width
+    :param imageHeight: image height
+    :param tempDir: directory for rendering
+    :param cmd: d.rast/d.vect command as a list
+    :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
     """
 
     filename = GetFileFromCmd(tempDir, cmd, region)
@@ -506,17 +506,17 @@ def RenderProcess2D(imageWidth, imageHeight, tempDir, cmd, region, bgcolor, file
 
 
 def RenderProcess3D(imageWidth, imageHeight, tempDir, cmd, region, bgcolor, fileQueue):
-    """!Renders image with m.nviz.image and writes the
+    """Renders image with m.nviz.image and writes the
        resulting ppm filename in the provided file queue
 
-    @param imageWidth image width
-    @param imageHeight image height
-    @param tempDir directory for rendering
-    @param cmd m.nviz.image command as a list
-    @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
+    :param imageWidth: image width
+    :param imageHeight: image height
+    :param tempDir: directory for rendering
+    :param cmd: m.nviz.image command as a list
+    :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
     """
 
     filename = GetFileFromCmd(tempDir, cmd, None)
@@ -542,18 +542,18 @@ def RenderProcess3D(imageWidth, imageHeight, tempDir, cmd, region, bgcolor, file
 
 
 def CompositeProcess(imageWidth, imageHeight, tempDir, cmdList, region, opacities, bgcolor, fileQueue):
-    """!Performs the composition of image ppm files and writes the
+    """Performs the composition of image ppm files and writes the
        resulting ppm filename in the provided file queue
 
-    @param imageWidth image width
-    @param imageHeight image height
-    @param tempDir directory for rendering
-    @param cmdList list of d.rast/d.vect commands
-    @param region region as a dict or None
-    @param opacities 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
+    :param imageWidth: image width
+    :param imageHeight: image height
+    :param tempDir: directory for rendering
+    :param cmdList: list of d.rast/d.vect commands
+    :param region: region as a dict or None
+    :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
     """
 
     maps = []
@@ -588,8 +588,9 @@ def CompositeProcess(imageWidth, imageHeight, tempDir, cmdList, region, opacitie
 
 
 class DictRefCounter:
-    """!Base class storing map files/bitmaps (emulates dictionary).
-        Counts the references to know which files/bitmaps to delete."""
+    """Base class storing map files/bitmaps (emulates dictionary).
+    Counts the references to know which files/bitmaps to delete.
+    """
     def __init__(self):
         self.dictionary = {}
         self.referenceCount = {}
@@ -616,7 +617,7 @@ class DictRefCounter:
         return self.dictionary.keys()
 
     def Clear(self):
-        """!Clears items which are not needed any more."""
+        """Clears items which are not needed any more."""
         Debug.msg(4, 'DictRefCounter.Clear')
         for key in self.dictionary.keys():
             if key is not None:
@@ -626,7 +627,7 @@ class DictRefCounter:
 
 
 class MapFilesPool(DictRefCounter):
-    """!Stores rendered images as files."""
+    """Stores rendered images as files."""
     def __init__(self):
         DictRefCounter.__init__(self)
         self.size = {}
@@ -638,7 +639,7 @@ class MapFilesPool(DictRefCounter):
         return self.size[key]
 
     def Clear(self):
-        """!Removes files which are not needed anymore.
+        """Removes files which are not needed anymore.
         Removes both ppm and pgm.
         """
         Debug.msg(4, 'MapFilesPool.Clear')
@@ -655,13 +656,13 @@ class MapFilesPool(DictRefCounter):
 
 
 class BitmapPool(DictRefCounter):
-    """!Class storing bitmaps (emulates dictionary)"""
+    """Class storing bitmaps (emulates dictionary)"""
     def __init__(self):
         DictRefCounter.__init__(self)
 
 
 class CleanUp:
-    """!Responsible for cleaning up the files."""
+    """Responsible for cleaning up the files."""
     def __init__(self, tempDir):
         self._tempDir = tempDir
 
@@ -676,13 +677,13 @@ class CleanUp:
 
 
 def _setEnvironment(width, height, filename, transparent, bgcolor):
-    """!Sets environmental variables for 2D rendering.
+    """Sets environmental variables for 2D rendering.
 
-    @param width rendering width
-    @param height rendering height
-    @param filename file name
-    @param transparent use transparency
-    @param bgcolor background color as a tuple of 3 values 0 to 255
+    :param width: rendering width
+    :param height: rendering height
+    :param filename: file name
+    :param transparent: use transparency
+    :param bgcolor: background color as a tuple of 3 values 0 to 255
     """
     Debug.msg(5, "_setEnvironment: width={w}, height={h}, "
                  "filename={f}, transparent={t}, bgcolor={b}".format(w=width,
@@ -707,13 +708,13 @@ def _setEnvironment(width, height, filename, transparent, bgcolor):
 
 
 def createNoDataBitmap(imageWidth, imageHeight, text="No data"):
-    """!Creates 'no data' bitmap.
+    """Creates 'no data' bitmap.
 
     Used when requested bitmap is not available (loading data was not successful) or
     we want to show 'no data' bitmap.
 
-    @param imageWidth image width
-    @param imageHeight image height
+    :param imageWidth: image width
+    :param imageHeight: image height
     """
     Debug.msg(4, "createNoDataBitmap: w={w}, h={h}, text={t}".format(w=imageWidth,
                                                                      h=imageHeight,

+ 15 - 12
gui/wxpython/animation/temporal_manager.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package animation.temporal_manager
 
 @brief Management of temporal datasets used in animation
@@ -39,7 +39,7 @@ class GranularityMode:
 
 
 class TemporalManager(object):
-    """!Class for temporal data processing."""
+    """Class for temporal data processing."""
     def __init__(self):
         self.timeseriesList = []
         self.timeseriesInfo = {}
@@ -50,7 +50,9 @@ class TemporalManager(object):
         self.granularityMode = GranularityMode.ORIGINAL
 
     def GetTemporalType(self):
-        """!Get temporal type (TemporalType.ABSOLUTE, TemporalType.RELATIVE)"""
+        """Get temporal type (TemporalType.ABSOLUTE,
+        TemporalType.RELATIVE)
+        """
         return self._temporalType
 
     def SetTemporalType(self, ttype):
@@ -59,18 +61,18 @@ class TemporalManager(object):
     temporalType = property(fget=GetTemporalType, fset=SetTemporalType)
 
     def AddTimeSeries(self, timeseries, etype):
-        """!Add space time dataset
+        """Add space time dataset
         and collect basic information about it.
 
         Raises GException (e.g. with invalid topology).
 
-        @param timeseries name of timeseries (with or without mapset)
-        @param etype element type (strds, stvds)
+        :param timeseries: name of timeseries (with or without mapset)
+        :param etype: element type (strds, stvds)
         """
         self._gatherInformation(timeseries, etype, self.timeseriesList, self.timeseriesInfo)
 
     def EvaluateInputData(self):
-        """!Checks if all timeseries are compatible (raises GException).
+        """Checks if all timeseries are compatible (raises GException).
 
         Sets internal variables.
         """
@@ -133,7 +135,8 @@ class TemporalManager(object):
         return True, None
 
     def GetGranularity(self):
-        """!Returns temporal granularity of currently loaded timeseries."""
+        """Returns temporal granularity of currently loaded timeseries.
+        """
         if self.dataMode == DataMode.SIMPLE:
             gran = self.timeseriesInfo[self.timeseriesList[0]]['granularity']
             if 'unit' in self.timeseriesInfo[self.timeseriesList[0]]:  # relative:
@@ -171,7 +174,7 @@ class TemporalManager(object):
             return (granNum, unit)
 
     def GetLabelsAndMaps(self):
-        """!Returns time labels and map names.
+        """Returns time labels and map names.
         """
         mapLists = []
         labelLists = []
@@ -217,7 +220,7 @@ class TemporalManager(object):
         return timestamps, mapDict
 
     def _getLabelsAndMaps(self, timeseries):
-        """!Returns time labels and map names (done by sampling)
+        """Returns time labels and map names (done by sampling)
         for both interval and point data.
         """
         sp = tgis.dataset_factory(self.timeseriesInfo[timeseries]['etype'], timeseries)
@@ -292,7 +295,7 @@ class TemporalManager(object):
         return timeLabels, listOfMaps
 
     def _pretifyTimeLabels(self, labels):
-        """!Convert absolute time labels to grass time and
+        """Convert absolute time labels to grass time and
         leave only datum when time is 0.
         """
         grassLabels = []
@@ -315,7 +318,7 @@ class TemporalManager(object):
         return grassLabels
 
     def _gatherInformation(self, timeseries, etype, timeseriesList, infoDict):
-        """!Get info about timeseries and check topology (raises GException)"""
+        """Get info about timeseries and check topology (raises GException)"""
         id = validateTimeseriesName(timeseries, etype)
         sp = tgis.dataset_factory(etype, id)
         # Insert content from db

+ 12 - 12
gui/wxpython/animation/toolbars.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package animation.toolbars
 
 @brief Animation toolbars
@@ -52,10 +52,10 @@ simpleLmgrIcons = {
 
 
 class MainToolbar(BaseToolbar):
-    """!Main toolbar (data management)
+    """Main toolbar (data management)
     """
     def __init__(self, parent):
-        """!Main toolbar constructor
+        """Main toolbar constructor
         """
         BaseToolbar.__init__(self, parent)
 
@@ -65,7 +65,7 @@ class MainToolbar(BaseToolbar):
         self.Realize()
 
     def _toolbarData(self):
-        """!Returns toolbar data (name, icon, handler)"""
+        """Returns toolbar data (name, icon, handler)"""
         # BaseIcons are a set of often used icons. It is possible
         # to reuse icons in ./trunk/gui/icons/grass or add new ones there.
         icons = ganimIcons
@@ -81,10 +81,10 @@ class MainToolbar(BaseToolbar):
 
 
 class AnimationToolbar(BaseToolbar):
-    """!Animation toolbar (to control animation)
+    """Animation toolbar (to control animation)
     """
     def __init__(self, parent):
-        """!Animation toolbar constructor
+        """Animation toolbar constructor
         """
         BaseToolbar.__init__(self, parent)
 
@@ -97,7 +97,7 @@ class AnimationToolbar(BaseToolbar):
         self.EnableAnimTools(False)
 
     def _toolbarData(self):
-        """!Returns toolbar data (name, icon, handler)"""
+        """Returns toolbar data (name, icon, handler)"""
         # BaseIcons are a set of often used icons. It is possible
         # to reuse icons in ./trunk/gui/icons/grass or add new ones there.
         icons = ganimIcons
@@ -194,7 +194,7 @@ class AnimationToolbar(BaseToolbar):
         self.ToggleTool(self.bothDirectionReplay, both)
 
     def EnableAnimTools(self, enable):
-        """!Enable or diable animation tools"""
+        """Enable or diable animation tools"""
         self.EnableTool(self.playForward, enable)
         self.EnableTool(self.playBack, enable)
         self.EnableTool(self.pause, enable)
@@ -202,10 +202,10 @@ class AnimationToolbar(BaseToolbar):
 
 
 class MiscToolbar(BaseToolbar):
-    """!Toolbar with miscellaneous tools related to app
+    """Toolbar with miscellaneous tools related to app
     """
     def __init__(self, parent):
-        """!Toolbar constructor
+        """Toolbar constructor
         """
         BaseToolbar.__init__(self, parent)
 
@@ -214,7 +214,7 @@ class MiscToolbar(BaseToolbar):
         self.Realize()
 
     def _toolbarData(self):
-        """!Toolbar data"""
+        """Toolbar data"""
         return self._getToolbarData((("settings", BaseIcons['settings'],
                                       self.parent.OnPreferences),
                                      ("help", BaseIcons['help'],
@@ -225,7 +225,7 @@ class MiscToolbar(BaseToolbar):
 
 
 class AnimSimpleLmgrToolbar(SimpleLmgrToolbar):
-    """!Simple layer manager toolbar for animation tool.
+    """Simple layer manager toolbar for animation tool.
     Allows to add space-time dataset or series of maps.
     """
     def __init__(self, parent, lmgrStyle):

+ 29 - 31
gui/wxpython/animation/utils.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package animation.utils
 
 @brief Miscellaneous functions and enum classes
@@ -56,7 +56,7 @@ class ReplayMode:
 
 
 def validateTimeseriesName(timeseries, etype='strds'):
-    """!Checks if space time dataset exists and completes missing mapset.
+    """Checks if space time dataset exists and completes missing mapset.
 
     Raises GException if dataset doesn't exist.
     """
@@ -76,7 +76,7 @@ def validateTimeseriesName(timeseries, etype='strds'):
 
 
 def validateMapNames(names, etype):
-    """!Checks if maps exist and completes missing mapset.
+    """Checks if maps exist and completes missing mapset.
 
     Input is list of map names.
     Raises GException if map doesn't exist.
@@ -103,7 +103,7 @@ def validateMapNames(names, etype):
 
 
 def getRegisteredMaps(timeseries, etype):
-    """!Returns list of maps registered in dataset.
+    """Returns list of maps registered in dataset.
     Can throw ScriptError if the dataset doesn't exist.
     """
     timeseriesMaps = []
@@ -118,7 +118,7 @@ def getRegisteredMaps(timeseries, etype):
 
 
 def getNameAndLayer(name):
-    """!Checks whether map name contains layer
+    """Checks whether map name contains layer
     and returns map name with mapset (when there was mapset)
     and layer (can be None).
 
@@ -140,12 +140,12 @@ def getNameAndLayer(name):
 
 
 def checkSeriesCompatibility(mapSeriesList=None, timeseriesList=None):
-    """!Checks whether time series (map series and stds) are compatible,
-        which means they have equal number of maps ad times (in case of stds).
-        This is needed within layer list, not within the entire animation tool.
-        Throws GException if these are incompatible.
+    """Checks whether time series (map series and stds) are compatible,
+    which means they have equal number of maps ad times (in case of stds).
+    This is needed within layer list, not within the entire animation tool.
+    Throws GException if these are incompatible.
 
-        @return number of maps for animation
+    :return: number of maps for animation
     """
     timeseriesInfo = {'count': set(), 'temporalType': set(), 'mapType': set(),
                       'mapTimes': set()}
@@ -209,18 +209,16 @@ def checkSeriesCompatibility(mapSeriesList=None, timeseriesList=None):
 
 
 def ComputeScaledRect(sourceSize, destSize):
-    """!Fits source rectangle into destination rectangle
+    """Fits source rectangle into destination rectangle
     by scaling and centering.
 
-    @code
 
-    >>> ComputeScaledRect(sourceSize = (10, 40), destSize = (100, 50))
-    {'height': 50, 'scale': 1.25, 'width': 13, 'x': 44, 'y': 0}
+        >>> ComputeScaledRect(sourceSize = (10, 40), destSize = (100, 50))
+        {'height': 50, 'scale': 1.25, 'width': 13, 'x': 44, 'y': 0}
 
-    @endcode
 
-    @param sourceSize size of source rectangle
-    @param destSize size of destination rectangle
+    :param sourceSize: size of source rectangle
+    :param destSize: size of destination rectangle
     """
     ratio1 = destSize[0] / float(sourceSize[0])
     ratio2 = destSize[1] / float(sourceSize[1])
@@ -241,7 +239,7 @@ def ComputeScaledRect(sourceSize, destSize):
 
 
 def RenderText(text, font):
-    """!Renderes text with given font to bitmap."""
+    """Renderes text with given font to bitmap."""
     dc = wx.MemoryDC()
     dc.SetFont(font)
     w, h = dc.GetTextExtent(text)
@@ -258,14 +256,14 @@ def RenderText(text, font):
 
 
 def WxImageToPil(image):
-    """!Converts wx.Image to PIL image"""
+    """Converts wx.Image to PIL image"""
     pilImage = Image.new('RGB', (image.GetWidth(), image.GetHeight()))
     pilImage.fromstring(image.GetData())
     return pilImage
 
 
 def HashCmd(cmd, region):
-    """!Returns a hash from command given as a list and a region as a dict."""
+    """Returns a hash from command given as a list and a region as a dict."""
     name = '_'.join(cmd)
     if region:
         name += str(sorted(region.items()))
@@ -273,7 +271,7 @@ def HashCmd(cmd, region):
 
 
 def HashCmds(cmds, region):
-    """!Returns a hash from list of commands and regions as dicts."""
+    """Returns a hash from list of commands and regions as dicts."""
     name = ';'.join([item for sublist in cmds for item in sublist])
     if region:
         name += str(sorted(region.items()))
@@ -281,20 +279,20 @@ def HashCmds(cmds, region):
 
 
 def GetFileFromCmd(dirname, cmd, region, extension='ppm'):
-    """!Returns file path created as a hash from command and region."""
+    """Returns file path created as a hash from command and region."""
     return os.path.join(dirname, HashCmd(cmd, region) + '.' + extension)
 
 
 def GetFileFromCmds(dirname, cmds, region, extension='ppm'):
-    """!Returns file path created as a hash from list of commands and regions."""
+    """Returns file path created as a hash from list of commands and regions."""
     return os.path.join(dirname, HashCmds(cmds, region) + '.' + extension)
 
 
 def layerListToCmdsMatrix(layerList):
-    """!Goes thru layerList and create matrix of commands
+    """Goes thru layerList and create matrix of commands
     for the composition of map series.:
 
-    @returns matrix of cmds for composition
+    :return: matrix of cmds for composition
     """
     count = 0
     for layer in layerList:
@@ -330,7 +328,7 @@ def layerListToCmdsMatrix(layerList):
 
 
 def sampleCmdMatrixAndCreateNames(cmdMatrix, sampledSeries, regions):
-    """!Applies information from temporal sampling
+    """Applies information from temporal sampling
     to the command matrix."""
     namesList = []
     j = -1
@@ -348,7 +346,7 @@ def sampleCmdMatrixAndCreateNames(cmdMatrix, sampledSeries, regions):
 
 
 def getCpuCount():
-    """!Returns number of available cpus.
+    """Returns number of available cpus.
     If fails, default (4) is returned.
     """
     try:
@@ -358,11 +356,11 @@ def getCpuCount():
 
 
 def interpolate(start, end, count):
-    """!Interpolates values between start and end.
+    """Interpolates values between start and end.
 
-    @param start start value (float)
-    @param end end value (float)
-    @param count total number of values including start and end
+    :param start: start value (float)
+    :param end: end value (float)
+    :param count: total number of values including start and end
 
     >>> interpolate(0, 10, 5)
     [0, 2.5, 5.0, 7.5, 10]

+ 10 - 11
gui/wxpython/core/debug.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package core.debug
 
 @brief wxGUI debugging
@@ -25,11 +25,10 @@ import sys
 import grass.script as grass
 
 class DebugMsg:
-    """!wxGUI debugging
+    """wxGUI debugging
     
-    @code
-    g.gisenv set=WX_DEBUG=[0-5]
-    @endcode
+        g.gisenv set=WX_DEBUG=[0-5]
+
     """
     def __init__(self):
         # default level
@@ -38,16 +37,16 @@ class DebugMsg:
         self.SetLevel()
 
     def SetLevel(self):
-        """!Initialize gui debug level
+        """Initialize gui debug level
         """
         self.debuglevel = int(grass.gisenv().get('WX_DEBUG', 0))
         
     def msg(self, level, message, *args):
-        """!Print debug message
+        """Print debug message
 
-        @param level debug level (0-5)
-        @param message message to be printed
-        @param *args formatting params
+        :param level: debug level (0-5)
+        :param message: message to be printed
+        :param args: formatting params
         """
         # self.SetLevel()
         if self.debuglevel > 0 and level > 0 and level <= self.debuglevel:
@@ -60,7 +59,7 @@ class DebugMsg:
             sys.stderr.flush() # force flush (required for MS Windows)
         
     def GetLevel(self):
-        """!Return current GUI debug level"""
+        """Return current GUI debug level"""
         return self.debuglevel
 
 # Debug instance

+ 71 - 63
gui/wxpython/core/gcmd.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package core.gcmd
 
 @brief wxGUI command interface
@@ -60,13 +60,22 @@ except IOError:
         return string
     _ = null_gettext
 
+def GetRealCmd(cmd):
+    """Return real command name - only for MS Windows
+    """
+    if sys.platform == 'win32':
+        for ext in globalvar.grassScripts.keys():
+            if cmd in globalvar.grassScripts[ext]:
+                return cmd + ext
+    
+    return cmd
 
 def DecodeString(string):
-    """!Decode string using system encoding
+    """Decode string using system encoding
     
-    @param string string to be decoded
+    :param string: string to be decoded
     
-    @return decoded string
+    :return: decoded string
     """
     if not string:
         return string
@@ -78,11 +87,11 @@ def DecodeString(string):
     return string
 
 def EncodeString(string):
-    """!Return encoded string using system locales
+    """Return encoded string using system locales
     
-    @param string string to be encoded
+    :param string: string to be encoded
     
-    @return encoded string
+    :return: encoded string
     """
     if not string:
         return string
@@ -95,12 +104,12 @@ def EncodeString(string):
 
 class GError:
     def __init__(self, message, parent = None, caption = None, showTraceback = True):
-        """!Show error message window
+        """Show error message window
 
-        @param message error message
-        @param parent centre window on parent if given
-        @param caption window caption (if not given "Error")
-        @param showTraceback True to show also Python traceback
+        :param message: error message
+        :param parent: centre window on parent if given
+        :param caption: window caption (if not given "Error")
+        :param showTraceback: True to show also Python traceback
         """
         if not caption:
             caption = _('Error')
@@ -155,7 +164,7 @@ class GException(Exception):
         return self.value
 
 class Popen(subprocess.Popen):
-    """!Subclass subprocess.Popen"""
+    """Subclass subprocess.Popen"""
     def __init__(self, args, **kwargs):
         if subprocess.mswindows:
             args = map(EncodeString, args)
@@ -183,7 +192,7 @@ class Popen(subprocess.Popen):
         setattr(self, which, None)
 
     def kill(self):
-        """!Try to kill running process"""
+        """Try to kill running process"""
         if subprocess.mswindows:
             import win32api
             handle = win32api.OpenProcess(1, 0, self.pid)
@@ -308,13 +317,12 @@ def send_all(p, data):
         data = buffer(data, sent)
 
 class Command:
-    """!Run command in separate thread. Used for commands launched
+    """Run command in separate thread. Used for commands launched
     on the background.
 
     If stdout/err is redirected, write() method is required for the
     given classes.
 
-    @code
         cmd = Command(cmd=['d.rast', 'elevation.dem'], verbose=3, wait=True)
 
         if cmd.returncode == None:
@@ -323,21 +331,20 @@ class Command:
             print 'SUCCESS'
         else:
             print 'FAILURE (%d)' % cmd.returncode
-    @endcode
     """
     def __init__ (self, cmd, stdin = None,
                   verbose = None, wait = True, rerr = False,
                   stdout = None, stderr = None):
         """
-        @param cmd     command given as list
-        @param stdin   standard input stream
-        @param verbose verbose level [0, 3] (--q, --v)
-        @param wait    wait for child execution terminated
-        @param rerr    error handling (when GException raised).
-        True for redirection to stderr, False for GUI dialog,
-        None for no operation (quiet mode)
-        @param stdout  redirect standard output or None
-        @param stderr  redirect standard error output or None
+        :param cmd: command given as list
+        :param stdin: standard input stream
+        :param verbose: verbose level [0, 3] (--q, --v)
+        :param wait: wait for child execution terminated
+        :param rerr: error handling (when GException raised).
+                     True for redirection to stderr, False for GUI
+                     dialog, None for no operation (quiet mode)
+        :param stdout:  redirect standard output or None
+        :param stderr:  redirect standard error output or None
         """
         Debug.msg(1, "gcmd.Command(): %s" % ' '.join(cmd))
         self.cmd = cmd
@@ -405,9 +412,9 @@ class Command:
             del os.environ["GRASS_VERBOSE"]
             
     def __ReadOutput(self, stream):
-        """!Read stream and return list of lines
+        """Read stream and return list of lines
 
-        @param stream stream to be read
+        :param stream: stream to be read
         """
         lineList = []
 
@@ -424,14 +431,14 @@ class Command:
         return lineList
                     
     def __ReadErrOutput(self):
-        """!Read standard error output and return list of lines"""
+        """Read standard error output and return list of lines"""
         return self.__ReadOutput(self.cmdThread.module.stderr)
 
     def __ProcessStdErr(self):
         """
         Read messages/warnings/errors from stderr
 
-        @return list of (type, message)
+        :return: list of (type, message)
         """
         if self.stderr is None:
             lines = self.__ReadErrOutput()
@@ -464,7 +471,7 @@ class Command:
         return msg
 
     def __GetError(self):
-        """!Get error message or ''"""
+        """Get error message or ''"""
         if not self.cmdThread.module:
             return _("Unable to exectute command: '%s'") % ' '.join(self.cmd)
         
@@ -477,16 +484,16 @@ class Command:
         return ''
     
 class CommandThread(Thread):
-    """!Create separate thread for command. Used for commands launched
+    """Create separate thread for command. Used for commands launched
     on the background."""
     def __init__ (self, cmd, env = None, stdin = None,
                   stdout = sys.stdout, stderr = sys.stderr):
         """
-        @param cmd command (given as list)
-        @param env environmental variables
-        @param stdin standard input stream 
-        @param stdout redirect standard output or None
-        @param stderr redirect standard error output or None
+        :param cmd: command (given as list)
+        :param env: environmental variables
+        :param stdin: standard input stream 
+        :param stdout: redirect standard output or None
+        :param stderr: redirect standard error output or None
         """
         Thread.__init__(self)
         
@@ -515,7 +522,7 @@ class CommandThread(Thread):
             del os.environ["GRASS_MESSAGE_FORMAT"]
         
     def run(self):
-        """!Run command"""
+        """Run command"""
         if len(self.cmd) == 0:
             return
 
@@ -560,7 +567,7 @@ class CommandThread(Thread):
         self._redirect_stream()
         
     def _redirect_stream(self):
-        """!Redirect stream"""
+        """Redirect stream"""
         if self.stdout:
             # make module stdout/stderr non-blocking
             out_fileno = self.module.stdout.fileno()
@@ -601,11 +608,11 @@ class CommandThread(Thread):
                 self.error = line
             
     def abort(self):
-        """!Abort running process, used by main thread to signal an abort"""
+        """Abort running process, used by main thread to signal an abort"""
         self._want_abort = True
     
 def _formatMsg(text):
-    """!Format error messages for dialogs
+    """Format error messages for dialogs
     """
     message = ''
     for line in text.splitlines():
@@ -624,25 +631,26 @@ def _formatMsg(text):
     
     return message
 
-def RunCommand(prog, flags = "", overwrite = False, quiet = False, verbose = False,
-               parent = None, read = False, parse = None, stdin = None, getErrorMsg = False, **kwargs):
-    """!Run GRASS command
-
-    @param prog program to run
-    @param flags flags given as a string
-    @param overwrite, quiet, verbose flags
-    @param parent parent window for error messages
-    @param read fetch stdout
-    @param parse fn to parse stdout (e.g. grass.parse_key_val) or None
-    @param stdin stdin or None
-    @param getErrorMsg get error messages on failure
-    @param kwargs program parameters
-    
-    @return returncode (read == False and getErrorMsg == False)
-    @return returncode, messages (read == False and getErrorMsg == True)
-    @return stdout (read == True and getErrorMsg == False)
-    @return returncode, stdout, messages (read == True and getErrorMsg == True)
-    @return stdout, stderr
+def RunCommand(prog, flags = "", overwrite = False, quiet = False,
+               verbose = False, parent = None, read = False,
+               parse = None, stdin = None, getErrorMsg = False, **kwargs):
+    """Run GRASS command
+
+    :param prog: program to run
+    :param flags: flags given as a string
+    :param overwrite, quiet, verbose: flags
+    :param parent: parent window for error messages
+    :param read: fetch stdout
+    :param parse: fn to parse stdout (e.g. grass.parse_key_val) or None
+    :param stdin: stdin or None
+    :param getErrorMsg: get error messages on failure
+    :param kwargs: program parameters
+    
+    :return: returncode (read == False and getErrorMsg == False)
+    :return: returncode, messages (read == False and getErrorMsg == True)
+    :return: stdout (read == True and getErrorMsg == False)
+    :return: returncode, stdout, messages (read == True and getErrorMsg == True)
+    :return: stdout, stderr
     """
     cmdString = ' '.join(grass.make_command(prog, flags, overwrite,
                                             quiet, verbose, **kwargs))
@@ -719,11 +727,11 @@ def RunCommand(prog, flags = "", overwrite = False, quiet = False, verbose = Fal
     return stdout, _formatMsg(stderr)
 
 def GetDefaultEncoding(forceUTF8 = False):
-    """!Get default system encoding
+    """Get default system encoding
     
-    @param forceUTF8 force 'UTF-8' if encoding is not defined
+    :param bool forceUTF8: force 'UTF-8' if encoding is not defined
 
-    @return system encoding (can be None)
+    :return: system encoding (can be None)
     """
     enc = locale.getdefaultlocale()[1]
     if forceUTF8 and (enc is None or enc == 'UTF8'):

+ 61 - 57
gui/wxpython/core/gconsole.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package core.gconsole
 
 @brief Command output widgets
@@ -55,18 +55,18 @@ wxCmdPrepare, EVT_CMD_PREPARE = NewEvent()
 
 
 def GrassCmd(cmd, env=None, stdout=None, stderr=None):
-    """!Return GRASS command thread"""
+    """Return GRASS command thread"""
     return CommandThread(cmd, env=env,
                          stdout=stdout, stderr=stderr)
 
 
 class CmdThread(threading.Thread):
-    """!Thread for GRASS commands"""
+    """Thread for GRASS commands"""
     requestId = 0
 
     def __init__(self, receiver, requestQ=None, resultQ=None, **kwds):
-        """!
-        @param receiver event receiver (used in PostEvent)
+        """
+        :param receiver: event receiver (used in PostEvent)
         """
         threading.Thread.__init__(self, **kwds)
 
@@ -90,12 +90,12 @@ class CmdThread(threading.Thread):
         self.start()
 
     def RunCmd(self, *args, **kwds):
-        """!Run command in queue
+        """Run command in queue
 
-        @param args unnamed command arguments
-        @param kwds named command arguments
+        :param args: unnamed command arguments
+        :param kwds: named command arguments
 
-        @return request id in queue
+        :return: request id in queue
         """
         CmdThread.requestId += 1
 
@@ -105,11 +105,11 @@ class CmdThread(threading.Thread):
         return CmdThread.requestId
 
     def GetId(self):
-         """!Get id for next command"""
-         return CmdThread.requestId + 1
+        """Get id for next command"""
+        return CmdThread.requestId + 1
 
     def SetId(self, id):
-        """!Set starting id"""
+        """Set starting id"""
         CmdThread.requestId = id
 
     def run(self):
@@ -208,7 +208,7 @@ class CmdThread(threading.Thread):
                 wx.PostEvent(self.receiver, event)
 
     def abort(self, abortall=True):
-        """!Abort command(s)"""
+        """Abort command(s)"""
         if abortall:
             self._want_abort_all = True
         if self.requestCmd is not None:
@@ -217,7 +217,7 @@ class CmdThread(threading.Thread):
             self._want_abort_all = False
 
 class GStdout:
-    """!GConsole standard output
+    """GConsole standard output
 
     Based on FrameOutErr.py
 
@@ -228,8 +228,8 @@ class GStdout:
     Licence:   GPL
     """
     def __init__(self, receiver):
-        """!
-        @param receiver event receiver (used in PostEvent)
+        """
+        :param receiver: event receiver (used in PostEvent)
         """
         self.receiver = receiver
 
@@ -250,7 +250,7 @@ class GStdout:
 
 
 class GStderr:
-    """!GConsole standard error output
+    """GConsole standard error output
 
     Based on FrameOutErr.py
 
@@ -261,8 +261,8 @@ class GStderr:
     Licence:   GPL
     """
     def __init__(self, receiver):
-        """!
-        @param receiver event receiver (used in PostEvent)
+        """
+        :param receiver: event receiver (used in PostEvent)
         """
         self.receiver = receiver
         self.type = ''
@@ -331,14 +331,15 @@ gIgnoredCmdRun, EVT_IGNORED_CMD_RUN = NewEvent()
 
 
 class GConsole(wx.EvtHandler):
-    """!
+    """
     """
     def __init__(self, guiparent=None, giface=None, ignoredCmdPattern=None):
-        """!
-        @param guiparent parent window for created GUI objects
-        @param lmgr layer manager window (TODO: replace by giface)
-        @param ignoredCmdPattern regular expression specifying commads
-        to be ignored (e.g. @c '^d\..*' for display commands)
+        """
+        :param guiparent: parent window for created GUI objects
+        :param lmgr: layer manager window (TODO: replace by giface)
+        :param ignoredCmdPattern: regular expression specifying commads
+                                  to be ignored (e.g. @c '^d\..*' for
+                                  display commands)
         """
         wx.EvtHandler.__init__(self)
 
@@ -378,7 +379,7 @@ class GConsole(wx.EvtHandler):
         self.cmdThread = CmdThread(self, self.requestQ, self.resultQ)
 
     def Redirect(self):
-        """!Redirect stdout/stderr
+        """Redirect stdout/stderr
         """
         if Debug.GetLevel() == 0 and int(grass.gisenv().get('DEBUG', 0)) == 0:
             # don't redirect when debugging is enabled
@@ -395,54 +396,56 @@ class GConsole(wx.EvtHandler):
 
     def WriteLog(self, text, style=None, wrap=None,
                  notification=Notification.HIGHLIGHT):
-        """!Generic method for writing log message in
+        """Generic method for writing log message in
         given style
 
-        @param text text line
-        @param notification form of notification
+        :param text: text line
+        :param notification: form of notification
         """
         self.writeLog.emit(text=text, wrap=wrap,
                           notification=notification)
 
     def WriteCmdLog(self, text, pid=None, notification=Notification.MAKE_VISIBLE):
-        """!Write message in selected style
+        """Write message in selected style
 
-        @param text message to be printed
-        @param pid process pid or None
-        @param notification form of notification
+        :param text: message to be printed
+        :param pid: process pid or None
+        :param notification: form of notification
         """
         self.writeCmdLog.emit(text=text, pid=pid,
                               notification=notification)
 
     def WriteWarning(self, text):
-        """!Write message in warning style"""
+        """Write message in warning style"""
         self.writeWarning.emit(text=text)
 
     def WriteError(self, text):
-        """!Write message in error style"""
+        """Write message in error style"""
         self.writeError.emit(text=text)
 
     def RunCmd(self, command, compReg=True, skipInterface=False,
                onDone=None, onPrepare=None, userData=None, notification=Notification.MAKE_VISIBLE):
-        """!Run command typed into console command prompt (GPrompt).
+        """Run command typed into console command prompt (GPrompt).
 
-        @todo Document the other event.
-        @todo Solve problem with the other event
-        (now uses gOutputText event but there is no text,
-        use onPrepare handler instead?)
+        .. todo::
+            Document the other event.
+        .. todo::
+            Solve problem with the other event (now uses gOutputText
+            event but there is no text, use onPrepare handler instead?)
 
         Posts event EVT_IGNORED_CMD_RUN when command which should be ignored
         (according to ignoredCmdPattern) is run.
         For example, see layer manager which handles d.* on its own.
 
-        @param command command given as a list (produced e.g. by utils.split())
-        @param compReg True use computation region
-        @param notification form of notification
-        @param skipInterface True to do not launch GRASS interface
-        parser when command has no arguments given
-        @param onDone function to be called when command is finished
-        @param onPrepare function to be called before command is launched
-        @param userData data defined for the command
+        :param command: command given as a list (produced e.g. by utils.split())
+        :param compReg: True use computation region
+        :param notification: form of notification
+        :param bool skipInterface: True to do not launch GRASS interface
+                                   parser when command has no arguments
+                                   given
+        :param onDone: function to be called when command is finished
+        :param onPrepare: function to be called before command is launched
+        :param userData: data defined for the command
         """
         if len(command) == 0:
             Debug.msg(2, "GPrompt:RunCmd(): empty command")
@@ -567,11 +570,12 @@ class GConsole(wx.EvtHandler):
             self.cmdOutputTimer.Start(50)
 
     def GetLog(self, err=False):
-        """!Get widget used for logging
+        """Get widget used for logging
 
-        @todo what's this?
+        .. todo::
+           what's this?
 
-        @param err True to get stderr widget
+        :param bool err: True to get stderr widget
         """
         if err:
             return self.cmdStdErr
@@ -579,22 +583,22 @@ class GConsole(wx.EvtHandler):
         return self.cmdStdOut
 
     def GetCmd(self):
-        """!Get running command or None"""
+        """Get running command or None"""
         return self.requestQ.get()
 
     def OnCmdAbort(self, event):
-        """!Abort running command"""
+        """Abort running command"""
         self.cmdThread.abort()
         event.Skip()
 
     def OnCmdRun(self, event):
-        """!Run command"""
+        """Run command"""
         self.WriteCmdLog('(%s)\n%s' % (str(time.ctime()), ' '.join(event.cmd)),
                          notification=event.notification)
         event.Skip()
 
     def OnCmdDone(self, event):
-        """!Command done (or aborted)
+        """Command done (or aborted)
 
         Sends signal mapCreated if map is recognized in output
         parameters or for specific modules (as r.colors).
@@ -676,9 +680,9 @@ class GConsole(wx.EvtHandler):
         wx.GetApp().ProcessPendingEvents()
 
     def UpdateHistoryFile(self, command):
-        """!Update history file
+        """Update history file
         
-        @param command the command given as a string
+        :param command: the command given as a string
         """
         env = grass.gisenv()
         try:

+ 72 - 53
gui/wxpython/core/giface.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package core.giface
 
 @brief GRASS interface for standalone application (without layer manager)
@@ -27,7 +27,7 @@ from grass.pydispatch.signal import Signal
 
 
 class Notification:
-    """!Enum class for notifications suggestions.
+    """Enum class for notifications suggestions.
 
     Can be used for log messages, commands, warnings, errors.
     The value is the suggestion how user should be notified
@@ -40,76 +40,84 @@ class Notification:
 
 
 class Layer(object):
-    """!Layer is generaly usable layer object.
+    """Layer is generaly usable layer object.
 
-    @note Currently without specifying the interface.
-    Current implementations only provides all attributes of existing layer
-    as used in lmgr.
+    .. note::
+        Currently without specifying the interface.
+        Current implementations only provides all attributes of existing
+        layer as used in lmgr.
     """
     pass
 
 
 class LayerList(object):
     def GetSelectedLayers(self, checkedOnly=True):
-        """!Returns list of selected layers.
+        """Returns list of selected layers.
 
-        @note Usage of checked and selected is still subject to change.
-        Checked layers should be showed. Selected are for analyses.
-        However, this may be the same for some implementations
-        (e.g. it d.mon has all layers checked and selected).
+        .. note::
+            Usage of checked and selected is still subject to change.
+            Checked layers should be showed. Selected are for analyses.
+            However, this may be the same for some implementations
+            (e.g. it d.mon has all layers checked and selected).
         """
         raise NotImplementedError()
 
     def GetSelectedLayer(self, checkedOnly=False):
-        """!Returns selected layer or None when there is no selected layer.
+        """Returns selected layer or None when there is no selected layer.
 
-        @note Parameter checkedOnly is here False by default. This might change
-        if we find the right way of handling unchecked layers.
+        .. note::
+            Parameter checkedOnly is here False by default. This might
+            change if we find the right way of handling unchecked layers.
         """
         raise NotImplementedError()
 
     def AddLayer(self, ltype, name=None, checked=None,
                  opacity=1.0, cmd=None):
-        """!Adds a new layer to the layer list.
+        """Adds a new layer to the layer list.
 
         Launches property dialog if needed (raster, vector, etc.)
 
-        @param ltype layer type (raster, vector, 3d-raster, ...)
-        @param name layer name
-        @param checked if True layer is checked
-        @param opacity layer opacity level
-        @param cmd command (given as a list)
+        :param ltype: layer type (raster, vector, 3d-raster, ...)
+        :param name: layer name
+        :param checked: if True layer is checked
+        :param opacity: layer opacity level
+        :param cmd: command (given as a list)
         """
         raise NotImplementedError()
 
     def GetLayersByName(self, name):
-        """!Returns list of layers with a given name.
+        """Returns list of layers with a given name.
 
-        @param name fully qualified map name
+        :param name: fully qualified map name
 
-        @todo if common usage is just to check the presence of layer,
-        intoroduce a new method ContainsLayerByName(name)
+        .. todo::
+            if common usage is just to check the presence of layer,
+            intoroduce a new method ContainsLayerByName(name)
         """
         raise NotImplementedError()
 
     def GetLayerByData(self, key, value):
-        """!Returns layer with specified.
+        """Returns layer with specified.
 
-        @note Returns only one layer. This might change.
+        .. note::
+            Returns only one layer. This might change.
 
-        @warning Avoid using this method, it might be removed in the future.
+        .. warning::
+            Avoid using this method, it might be removed in the future.
         """
         raise NotImplementedError()
 
 
 class GrassInterface:
-    """!GrassInterface provides the functionality which should be available
+    """GrassInterface provides the functionality which should be available
     to every GUI component.
 
-    @note The GrassInterface process is not finished.
+    .. note::
+
+        The GrassInterface process is not finished.
     """
     def RunCmd(self, *args, **kwargs):
-        """!Executes a command.
+        """Executes a command.
         """
         raise NotImplementedError()
 
@@ -119,70 +127,81 @@ class GrassInterface:
         raise NotImplementedError()
 
     def WriteLog(self, text, wrap=None, notification=Notification.HIGHLIGHT):
-        """!Writes log message.
+        """Writes log message.
         """
         raise NotImplementedError()
 
     def WriteCmdLog(self, text, pid=None, notification=Notification.MAKE_VISIBLE):
-        """!Writes message related to start or end of the command.
+        """Writes message related to start or end of the command.
         """
         raise NotImplementedError()
 
     def WriteWarning(self, text):
-        """!Writes warning message for the user.
+        """Writes warning message for the user.
         """
         raise NotImplementedError()
 
     def WriteError(self, text):
-        """!Writes error message for the user."""
+        """Writes error message for the user."""
         raise NotImplementedError()
 
     def GetLayerTree(self):
-        """!Returns LayerManager's tree GUI object.
-        @note Will be removed from the interface.
+        """Returns LayerManager's tree GUI object.
+        .. note::
+
+            Will be removed from the interface.
         """
         raise NotImplementedError()
 
     def GetLayerList(self):
-        """!Returns a layer management object.
+        """Returns a layer management object.
         """
         raise NotImplementedError()
 
     def GetMapDisplay(self):
-        """!Returns current map display.
+        """Returns current map display.
+
+        .. note::
 
-        @note For layer related tasks use GetLayerList().
+            For layer related tasks use GetLayerList().
 
-        @return MapFrame instance
-        @return None when no mapdisplay open
+        :return: MapFrame instance
+        :return: None when no mapdisplay open
         """
         raise NotImplementedError()
 
     def GetAllMapDisplays(self):
-        """!Get list of all map displays.
+        """Get list of all map displays.
 
-        @note Might be removed from the interface.
+        .. note::
 
-        @return list of MapFrame instances
+            Might be removed from the interface.
+
+        :return: list of MapFrame instances
         """
         raise NotImplementedError()
 
     def GetMapWindow(self):
-        """!Returns current map window.
-        @note For layer related tasks use GetLayerList().
+        """Returns current map window.
+
+        .. note::
+
+            For layer related tasks use GetLayerList().
         """
         raise NotImplementedError()
 
     def GetProgress(self):
-        """!Returns object which shows the progress.
+        """Returns object which shows the progress.
+
+        .. note::
 
-        @note Some implementations may not implement this method.
+            Some implementations may not implement this method.
         """
         raise NotImplementedError()
 
 
 class StandaloneGrassInterface():
-    """!@implements GrassInterface"""
+    """@implements GrassInterface"""
     def __init__(self):
 
         # Signal when some map is created or updated by a module.
@@ -206,7 +225,7 @@ class StandaloneGrassInterface():
         self._gconsole.writeError.connect(self.WriteError)
 
     def _onCmdOutput(self, event):
-        """!Print command output"""
+        """Print command output"""
         message = event.text
         style = event.type
 
@@ -219,7 +238,7 @@ class StandaloneGrassInterface():
         event.Skip()
 
     def _onCmdProgress(self, event):
-        """!Update progress message info"""
+        """Update progress message info"""
         grass.percent(event.value, 100, 1)
         event.Skip()
 
@@ -260,12 +279,12 @@ class StandaloneGrassInterface():
         return None
 
     def GetMapDisplay(self):
-        """!Get current map display.
+        """Get current map display.
         """
         return None
 
     def GetAllMapDisplays(self):
-        """!Get list of all map displays.
+        """Get list of all map displays.
         """
         return []
 

+ 7 - 7
gui/wxpython/core/globalvar.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package core.globalvar
 
 @brief Global variables used by wxGUI
@@ -42,7 +42,7 @@ except IOError:
 from grass.script.core import get_commands
 
 def CheckWxVersion(version = [2, 8, 11, 0]):
-    """!Check wx version"""
+    """Check wx version"""
     ver = wx.version().split(' ')[0]
     if map(int, ver.split('.')) < version:
         return False
@@ -50,7 +50,7 @@ def CheckWxVersion(version = [2, 8, 11, 0]):
     return True
 
 def CheckForWx():
-    """!Try to import wx module and check its version"""
+    """Try to import wx module and check its version"""
     if 'wx' in sys.modules.keys():
         return
 
@@ -91,7 +91,7 @@ Deleted automatically on re-render action
 # temporal query layer (removed on re-render action)
 QUERYLAYER = 'qlayer'
 
-"""!Style definition for FlatNotebook pages"""
+"""Style definition for FlatNotebook pages"""
 FNPageStyle = FN.FNB_VC8 | \
     FN.FNB_BACKGROUND_GRADIENT | \
     FN.FNB_NODRAG | \
@@ -104,7 +104,7 @@ FNPageDStyle = FN.FNB_FANCY_TABS | \
 
 FNPageColor = wx.Colour(125,200,175)
 
-"""!Dialog widget dimension"""
+"""Dialog widget dimension"""
 DIALOG_SPIN_SIZE = (150, -1)
 DIALOG_COMBOBOX_SIZE = (300, -1)
 DIALOG_GSELECT_SIZE = (400, -1)
@@ -137,10 +137,10 @@ else:
 
 
 def UpdateGRASSAddOnCommands(eList = None):
-    """!Update list of available GRASS AddOns commands to use when
+    """Update list of available GRASS AddOns commands to use when
     parsing string from the command line
 
-    @param eList list of AddOns commands to remove
+    :param eList: list of AddOns commands to remove
     """
     global grassCmd, grassScripts
 

+ 70 - 68
gui/wxpython/core/layerlist.py

@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-"""!
+"""
 @package core.layerlist
 
 @brief Non GUI classes for layer management (so far used for class simplelmgr only)
@@ -21,7 +21,7 @@ from grass.script import core as gcore
 
 
 class LayerList(object):
-    """!Non GUI class managing list of layers.
+    """Non GUI class managing list of layers.
 
     It provides API for handling layers. In the future,
     a non GUI class (e.g. named LayerTree) which includes this API,
@@ -31,9 +31,9 @@ class LayerList(object):
         self._list = []
 
     def GetSelectedLayers(self, activeOnly=True):
-        """!Returns list of selected layers.
+        """Returns list of selected layers.
 
-        @param activeOnly return only active layers
+        :param bool activeOnly: return only active layers
         """
         layers = []
         for layer in self._list:
@@ -45,9 +45,9 @@ class LayerList(object):
         return layers
 
     def GetSelectedLayer(self, activeOnly=False):
-        """!Returns selected layer or None when there is no selected layer.
+        """Returns selected layer or None when there is no selected layer.
 
-        @param activeOnly return only active layers
+        :param bool activeOnly: return only active layers
         """
         layers = self.GetSelectedLayers(activeOnly)
         if layers:
@@ -55,13 +55,13 @@ class LayerList(object):
         return None
 
     def GetActiveLayers(self):
-        """!Returns list of active layers."""
+        """Returns list of active layers."""
         return [layer for layer in self._list if layer.IsActive()]
 
     def GetLayersByTypes(self, mapTypes):
-        """!Returns layers by types.
+        """Returns layers by types.
 
-        @param mapTypes list of types
+        :param mapTypes: list of types
         """
         layers = []
         for layer in self._list:
@@ -71,16 +71,16 @@ class LayerList(object):
 
     def AddNewLayer(self, name, mapType, cmd, active=True, hidden=False,
                     opacity=1, label=None, pos=0):
-        """!Creates new layer and adds it to the list (insert to the first position).
-
-        @param ltype layer type (raster, vector, 3d-raster, ...)
-        @param cmd command (given as a list)
-        @param active if True layer is active
-        @param hidden if True layer is hidden
-        @param opacity layer opacity level (0 - 100)
-        @param name layer name (set automatically from cmd)
-        @param label layer label (set automatically from name)
-        @param pos add layer to position
+        """Creates new layer and adds it to the list (insert to the first position).
+
+        :param ltype: layer type (raster, vector, 3d-raster, ...)
+        :param cmd: command (given as a list)
+        :param active: if True layer is active
+        :param hidden: if True layer is hidden
+        :param opacity: layer opacity level (0 - 100)
+        :param name: layer name (set automatically from cmd)
+        :param label: layer label (set automatically from name)
+        :param pos: add layer to position
         """
         layer = Layer()
         layer.hidden = hidden
@@ -96,41 +96,43 @@ class LayerList(object):
         return layer
 
     def AddLayer(self, layer):
-        """!Adds a layer to the layer list.
+        """Adds a layer to the layer list.
         """
         self._list.insert(0, layer)
 
     def InsertLayer(self, index, layer):
-        """!Adds a layer to the layer list.
+        """Adds a layer to the layer list.
         """
         self._list.insert(index, layer)
 
     def RemoveLayer(self, layer):
-        """!Removes layer."""
+        """Removes layer."""
         self._list.remove(layer)
 
     def GetLayerByData(self, key, value):
-        """!Returns layer with specified.
+        """Returns layer with specified.
 
-        @note Returns only one layer. This might change.
+        .. note::
+            Returns only one layer. This might change.
 
-        @warning Avoid using this method, it might be removed in the future.
+        .. warning::
+            Avoid using this method, it might be removed in the future.
         """
         raise NotImplementedError()
 
     def GetLayerIndex(self, layer):
-        """!Get index of layer."""
+        """Get index of layer."""
         return self._list.index(layer)
 
     def MoveLayerUp(self, layer):
-        """!Moves layer up (1 step)."""
+        """Moves layer up (1 step)."""
         idx = self._list.index(layer)
         if idx > 0:
             lr = self._list.pop(idx)
             self._list.insert(idx - 1, lr)
 
     def MoveLayerDown(self, layer):
-        """!Moves layer down (1 step)."""
+        """Moves layer down (1 step)."""
         idx = self._list.index(layer)
         if idx < len(self._list) - 1:
             lr = self._list.pop(idx)
@@ -154,28 +156,28 @@ class LayerList(object):
 
 
 class Layer(object):
-    """!Object representing layer.
+    """Object representing layer.
 
     Properties of the object are checked during setting.
     Map types can be extended if needed.
 
-    >>> layer = Layer()
-    >>> layer.selected = True
-    >>> layer.IsSelected()
-    True
-    >>> layer.opacity = 0.1
-    Traceback (most recent call last):
-    ...
-    ValueError: Opacity must be an integer between 0 and 100, not 0.1.
-    >>> layer.name = 'blablabla'
-    Traceback (most recent call last):
-    ...
-    ValueError: To set layer name, the type of layer must be specified.
-    >>> layer.mapType = 'rast'
-    >>> layer.name = 'blablabla'
-    Traceback (most recent call last):
-    ...
-    ValueError: Map <blablabla> not found.
+        >>> layer = Layer()
+        >>> layer.selected = True
+        >>> layer.IsSelected()
+        True
+        >>> layer.opacity = 0.1
+        Traceback (most recent call last):
+        ...
+        ValueError: Opacity must be an integer between 0 and 100, not 0.1.
+        >>> layer.name = 'blablabla'
+        Traceback (most recent call last):
+        ...
+        ValueError: To set layer name, the type of layer must be specified.
+        >>> layer.mapType = 'rast'
+        >>> layer.name = 'blablabla'
+        Traceback (most recent call last):
+        ...
+        ValueError: Map <blablabla> not found.
     """
     def __init__(self):
         self._mapType = None
@@ -199,7 +201,7 @@ class Layer(object):
         return self._name
 
     def SetName(self, name):
-        """!Sets name of the layer.
+        """Sets name of the layer.
 
         It checks the name of the layer by g.findfile
         (raises ValueError if map does not exist).
@@ -242,9 +244,9 @@ class Layer(object):
         return self._mapType
 
     def SetMapType(self, mapType):
-        """!Sets map type of the layer.
+        """Sets map type of the layer.
 
-        @param mapType can be 'rast', 'vect', 'rast3'
+        :param mapType: can be 'rast', 'vect', 'rast3'
         """
         if mapType not in self._mapTypes:
             raise ValueError("Wrong map type used: {mtype}".format(mtype=mapType))
@@ -254,16 +256,16 @@ class Layer(object):
     mapType = property(fget=GetMapType, fset=SetMapType)
 
     def GetOpacity(self):
-        """!Returns opacity value.
+        """Returns opacity value.
 
-        @return opacity as float between 0 and 1
+        :return: opacity as float between 0 and 1
         """
         return self._opacity
 
     def SetOpacity(self, opacity):
-        """!Sets opacity of the layer.
+        """Sets opacity of the layer.
 
-        @param opacity float between 0 and 1
+        :param float opacity: value between 0 and 1
         """
         if not (0 <= opacity <= 1):
             raise ValueError("Opacity value must be between 0 and 1, not {op}.".format(op=opacity))
@@ -283,7 +285,7 @@ class Layer(object):
         return self._active
 
     def Activate(self, active=True):
-        """!Sets if layer is active (checked)."""
+        """Sets if layer is active (checked)."""
         self._active = active
 
     active = property(fget=IsActive, fset=Activate)
@@ -292,30 +294,30 @@ class Layer(object):
         return self._hidden
 
     def Hide(self, hide=True):
-        """!Sets if layer is hidden."""
+        """Sets if layer is hidden."""
         self._hidden = hide
 
     hidden = property(fget=IsHidden, fset=Hide)
 
 
 class LayerListToRendererConverter:
-    """!Help class for converting LayerList layers into renderer list (Map)"""
+    """Help class for converting LayerList layers into renderer list (Map)"""
     def __init__(self, renderer):
-        """!
+        """
 
-        @param layerList instance of LayerList
-        @param renderer instance of Map
+        :param layerList: instance of LayerList
+        :param renderer: instance of Map
         """
         self._renderer = renderer
 
     def _getRendererLayer(self, index):
-        """!Returns corresponding layer of renderer."""
+        """Returns corresponding layer of renderer."""
         rLayers = self._renderer.GetListOfLayers()
         index = len(rLayers) - index - 1
         return rLayers[index]
 
     def ConvertAll(self, layerList):
-        """!Removes all layers in Map and adds new layers form layerList.
+        """Removes all layers in Map and adds new layers form layerList.
         It's not meant for continuous update because everything is rerendered.
         """
         self._renderer.DeleteAllLayers()
@@ -323,22 +325,22 @@ class LayerListToRendererConverter:
             self.AddLayer(index=-1, layer=layer)
 
     def ChangeLayerOpacity(self, index, layer):
-        """!Changes layer opacity in renderer."""
+        """Changes layer opacity in renderer."""
         rLayer = self._getRendererLayer(index)
         self._renderer.ChangeLayer(rLayer, opacity=layer.opacity)
 
     def ChangeLayerCmd(self, index, layer):
-        """!Changes layer cmd in renderer."""
+        """Changes layer cmd in renderer."""
         rLayer = self._getRendererLayer(index)
         self._renderer.ChangeLayer(rLayer, command=layer.cmd)
 
     def ChangeLayerActive(self, index, layer):
-        """!Changes layer active state in renderer."""
+        """Changes layer active state in renderer."""
         rLayer = self._getRendererLayer(index)
         self._renderer.ChangeLayer(rLayer, active=layer.active)
 
     def MoveLayerUp(self, index):
-        """!Moves layer up in renderer."""
+        """Moves layer up in renderer."""
         rLayers = self._renderer.GetListOfLayers()
         index = len(rLayers) - index - 1
         rLayer = rLayers.pop(index)
@@ -346,7 +348,7 @@ class LayerListToRendererConverter:
         self._renderer.SetLayers(rLayers)
 
     def MoveLayerDown(self, index):
-        """!Moves layer down in renderer."""
+        """Moves layer down in renderer."""
         rLayers = self._renderer.GetListOfLayers()
         index = len(rLayers) - index - 1
         rLayer = rLayers.pop(index)
@@ -354,7 +356,7 @@ class LayerListToRendererConverter:
         self._renderer.SetLayers(rLayers)
 
     def AddLayer(self, index, layer):
-        """!Adds layer to renderer (prepends)."""
+        """Adds layer to renderer (prepends)."""
         mapType = None
         if layer.mapType == 'rast':
             mapType = 'raster'
@@ -370,5 +372,5 @@ class LayerListToRendererConverter:
                                 render=True, pos=-1)
 
     def RemoveLayer(self, index):
-        """!Removes layer from renderer."""
+        """Removes layer from renderer."""
         self._renderer.DeleteLayer(self._getRendererLayer(index))

+ 4 - 4
gui/wxpython/core/menutree.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package core.menutree
 
 @brief Creates tree structure for wxGUI menus (former menudata.py)
@@ -54,7 +54,7 @@ if not os.getenv("GISBASE"):
 
 # TODO: change the system to remove strange derived classes
 class MenuTreeModelBuilder:
-    """!Abstract menu data class"""
+    """Abstract menu data class"""
     def __init__(self, filename, expandAddons=True):
 
         self.menustyle = UserSettings.Get(group = 'appearance',
@@ -150,9 +150,9 @@ class MenuTreeModelBuilder:
             printTree(node=child, fh=fh)
 
     def PrintStrings(self, fh):
-        """!Print menu strings to file (used for localization)
+        """Print menu strings to file (used for localization)
 
-        @param fh file descriptor
+        :param fh: file descriptor
         """
         className = str(self.__class__).split('.', 1)[1]
         fh.write('menustrings_%s = [\n' % className)

File diff suppressed because it is too large
+ 400 - 388
gui/wxpython/core/render.py


+ 33 - 33
gui/wxpython/core/settings.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package core.settings
 
 @brief Default GUI settings
@@ -29,7 +29,7 @@ from core.gcmd  import GException, GError
 from core.utils import GetSettingsPath, PathJoin, rgb2str, _
 
 class Settings:
-    """!Generic class where to store settings"""
+    """Generic class where to store settings"""
     def __init__(self):
         # settings file
         self.filePath = os.path.join(GetSettingsPath(), 'wx')
@@ -51,7 +51,7 @@ class Settings:
         self._internalSettings() # -> self.internalSettings
 
     def _generateLocale(self):
-        """!Generate locales
+        """Generate locales
         """
         try:
             self.locs = os.listdir(os.path.join(os.environ['GISBASE'], 'locale'))
@@ -66,7 +66,7 @@ class Settings:
         return 'system'
         
     def _defaultSettings(self):
-        """!Define default settings
+        """Define default settings
         """
         try:
             projFile = PathJoin(os.environ["GRASS_PROJSHARE"], 'epsg')
@@ -826,7 +826,7 @@ class Settings:
             self.defaultSettings['general']['defWindowPos']['enabled'] = False
 
     def _internalSettings(self):
-        """!Define internal settings (based on user settings)
+        """Define internal settings (based on user settings)
         """
         self.internalSettings = {}
         for group in self.userSettings.keys():
@@ -919,7 +919,7 @@ class Settings:
                                                                           _("circle"))
 
     def ReadSettingsFile(self, settings = None):
-        """!Reads settings file (mapset, location, gisdbase)"""
+        """Reads settings file (mapset, location, gisdbase)"""
         if settings is None:
             settings = self.userSettings
         
@@ -934,10 +934,10 @@ class Settings:
             os.environ["GRASS_ENCODING"] = enc
         
     def _readFile(self, filename, settings = None):
-        """!Read settings from file to dict
+        """Read settings from file to dict
 
-        @param filename settings file path
-        @param settings dict where to store settings (None for self.userSettings)
+        :param filename: settings file path
+        :param settings: dict where to store settings (None for self.userSettings)
         """
         if settings is None:
             settings = self.userSettings
@@ -982,7 +982,7 @@ class Settings:
         fd.close()
         
     def SaveToFile(self, settings = None):
-        """!Save settings to the file"""
+        """Save settings to the file"""
         if settings is None:
             settings = self.userSettings
         
@@ -1034,7 +1034,7 @@ class Settings:
         return self.filePath
         
     def _parseValue(self, value, read = False):
-        """!Parse value to be store in settings file"""
+        """Parse value to be store in settings file"""
         if read: # -> read settings (cast values)
             if value == 'True':
                 value = True
@@ -1064,16 +1064,16 @@ class Settings:
         return value
 
     def Get(self, group, key = None, subkey = None, internal = False):
-        """!Get value by key/subkey
+        """Get value by key/subkey
 
         Raise KeyError if key is not found
         
-        @param group settings group
-        @param key (value, None)
-        @param subkey (value, list or None)
-        @param internal use internal settings instead
+        :param group: settings group
+        :param key: (value, None)
+        :param subkey: (value, list or None)
+        :param internal: use internal settings instead
 
-        @return value
+        :return: value
         """
         if internal is True:
             settings = self.internalSettings
@@ -1098,15 +1098,15 @@ class Settings:
                 (group, key, subkey)
         
     def Set(self, group, value, key = None, subkey = None, internal = False):
-        """!Set value of key/subkey
+        """Set value of key/subkey
         
         Raise KeyError if group/key is not found
         
-        @param group settings group
-        @param key key (value, None)
-        @param subkey subkey (value, list or None)
-        @param value value
-        @param internal use internal settings instead
+        :param group: settings group
+        :param key: key (value, None)
+        :param subkey: subkey (value, list or None)
+        :param value: value
+        :param internal: use internal settings instead
         """
         if internal is True:
             settings = self.internalSettings
@@ -1129,16 +1129,16 @@ class Settings:
             raise GException("%s '%s:%s:%s'" % (_("Unable to set "), group, key, subkey))
         
     def Append(self, dict, group, key, subkey, value, overwrite = True):
-        """!Set value of key/subkey
+        """Set value of key/subkey
 
         Create group/key/subkey if not exists
         
-        @param dict settings dictionary to use
-        @param group settings group
-        @param key key
-        @param subkey subkey (value or list)
-        @param value value
-        @param overwrite True to overwrite existing value
+        :param dict: settings dictionary to use
+        :param group: settings group
+        :param key: key
+        :param subkey: subkey (value or list)
+        :param value: value
+        :param overwrite: True to overwrite existing value
         """
 
         hasValue = True
@@ -1176,13 +1176,13 @@ class Settings:
                     ' (' + group + ':' + key + ':' + subkey + ')'
         
     def GetDefaultSettings(self):
-        """!Get default user settings"""
+        """Get default user settings"""
         return self.defaultSettings
 
     def Reset(self, key = None):
-        """!Reset to default settings
+        """Reset to default settings
 
-        @param key key in settings dict (None for all keys)
+        :param key: key in settings dict (None for all keys)
         """
         if not key:
             self.userSettings = copy.deepcopy(self.defaultSettings)

+ 50 - 48
gui/wxpython/core/toolboxes.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package core.toolboxes
 
 @brief Functions for modifying menu from default/user toolboxes specified in XML files
@@ -56,7 +56,7 @@ if not os.path.exists(userMainMenuFile):
 
 
 def toolboxesOutdated():
-    """!Removes auto-generated menudata.xml
+    """Removes auto-generated menudata.xml
     to let gui regenerate it next time it starts."""
     path = os.path.join(GetSettingsPath(), 'toolboxes', 'menudata.xml')
     if os.path.exists(path):
@@ -64,11 +64,11 @@ def toolboxesOutdated():
 
 
 def getMenudataFile(userRootFile, newFile, fallback):
-    """!Returns path to XML file for building menu or another tree.
+    """Returns path to XML file for building menu or another tree.
 
-    Creates toolbox directory where user defined toolboxes should be located.
-    Checks whether it is needed to create new XML file (user changed toolboxes)
-    or the already generated file could be used.
+    Creates toolbox directory where user defined toolboxes should be
+    located. Checks whether it is needed to create new XML file (user
+    changed toolboxes) or the already generated file could be used.
     If something goes wrong during building or user doesn't modify menu,
     default file (from distribution) is returned.
     """
@@ -147,7 +147,7 @@ def getMenudataFile(userRootFile, newFile, fallback):
 
 
 def _setupToolboxes():
-    """!Create 'toolboxes' directory if doesn't exist."""
+    """Create 'toolboxes' directory if doesn't exist."""
     basePath = GetSettingsPath()
     path = os.path.join(basePath, 'toolboxes')
     if not os.path.exists(basePath):
@@ -159,7 +159,7 @@ def _setupToolboxes():
 
 
 def _createPath(path):
-    """!Creates path (for toolboxes) if it doesn't exist'"""
+    """Creates path (for toolboxes) if it doesn't exist'"""
     if not os.path.exists(path):
         try:
             os.mkdir(path)
@@ -173,15 +173,15 @@ def _createPath(path):
 
 
 def createTree(distributionRootFile, userRootFile, userDefined=True):
-    """!Creates XML file with data for menu.
+    """Creates XML file with data for menu.
 
     Parses toolboxes files from distribution and from users,
     puts them together, adds metadata to modules and convert
     tree to previous format used for loading menu.
 
-    @param userDefined use toolboxes defined by user or not (during compilation)
+    :param userDefined: use toolboxes defined by user or not (during compilation)
 
-    @return ElementTree instance
+    :return: ElementTree instance
     """
     if userDefined and userRootFile:
         mainMenu = etree.parse(userRootFile)
@@ -207,15 +207,15 @@ def createTree(distributionRootFile, userRootFile, userDefined=True):
 
 def toolboxes2menudata(mainMenu, toolboxes, userToolboxes,
                        wxguiItems, moduleItems):
-    """!Creates XML file with data for menu.
+    """Creates XML file with data for menu.
 
     Parses toolboxes files from distribution and from users,
     puts them together, adds metadata to modules and convert
     tree to previous format used for loading menu.
 
-    @param userDefined use toolboxes defined by user or not (during compilation)
+    :param userDefined: use toolboxes defined by user or not (during compilation)
 
-    @return ElementTree instance
+    :return: ElementTree instance
     """
     root = mainMenu.getroot()
 
@@ -249,7 +249,7 @@ def toolboxes2menudata(mainMenu, toolboxes, userToolboxes,
 
 
 def _indent(elem, level=0):
-    """!Helper function to fix indentation of XML files."""
+    """Helper function to fix indentation of XML files."""
     i = "\n" + level * "  "
     if len(elem):
         if not elem.text or not elem.text.strip():
@@ -266,7 +266,7 @@ def _indent(elem, level=0):
 
 
 def expandAddons(tree):
-    """!Expands addons element.
+    """Expands addons element.
     """
     root = tree.getroot()
     _expandAddonsItem(root)
@@ -277,12 +277,12 @@ def expandAddons(tree):
 
 
 def _expandToolboxes(node, toolboxes):
-    """!Expands tree with toolboxes.
+    """Expands tree with toolboxes.
 
     Function is called recursively.
 
-    @param node tree node where to look for subtoolboxes to be expanded
-    @param toolboxes tree of toolboxes to be used for expansion
+    :param node: tree node where to look for subtoolboxes to be expanded
+    :param toolboxes: tree of toolboxes to be used for expansion
 
     >>> menu = etree.fromstring('''
     ... <toolbox name="Raster">
@@ -362,7 +362,7 @@ def _expandToolboxes(node, toolboxes):
 
 
 def _expandUserToolboxesItem(node, toolboxes):
-    """!Expand tag 'user-toolboxes-list'.
+    """Expand tag 'user-toolboxes-list'.
 
     Include all user toolboxes.
 
@@ -388,7 +388,7 @@ def _expandUserToolboxesItem(node, toolboxes):
 
 
 def _removeUserToolboxesItem(root):
-    """!Removes tag 'user-toolboxes-list' if there are no user toolboxes.
+    """Removes tag 'user-toolboxes-list' if there are no user toolboxes.
 
     >>> tree = etree.fromstring('<toolbox><items><user-toolboxes-list/></items></toolbox>')
     >>> _removeUserToolboxesItem(tree)
@@ -418,10 +418,11 @@ def _removeAddonsItem(node, addonsNodes):
 
 
 def _expandAddonsItem(node):
-    """!Expands addons element with currently installed addons.
+    """Expands addons element with currently installed addons.
 
-    Note: there is no mechanism yet to tell the gui to rebuild the menudata.xml
-    file when new addons are added/removed.
+    .. note::
+        there is no mechanism yet to tell the gui to rebuild the
+        menudata.xml file when new addons are added/removed.
     """
     # no addonsTag -> do nothing
     addonsTags = node.findall('.//addons')
@@ -457,7 +458,7 @@ def _expandAddonsItem(node):
 
 
 def _expandItems(node, items, itemTag):
-    """!Expand items from file
+    """Expand items from file
 
     >>> tree = etree.fromstring('<items><module-item name="g.region"></module-item></items>')
     >>> items = etree.fromstring('<module-items><module-item name="g.region"><module>g.region</module><description>GRASS region management</description></module-item></module-items>')
@@ -487,7 +488,7 @@ def _expandItems(node, items, itemTag):
 
 
 def _expandRuntimeModules(node):
-    """!Add information to modules (desc, keywords)
+    """Add information to modules (desc, keywords)
     by running them with --interface-description.
 
     >>> tree = etree.fromstring('<items>'
@@ -519,7 +520,7 @@ def _expandRuntimeModules(node):
 
 
 def _escapeXML(text):
-    """!Helper function for correct escaping characters for XML.
+    """Helper function for correct escaping characters for XML.
 
     Duplicate function in core/toolboxes and probably also in man compilation
     and some existing Python package.
@@ -531,10 +532,10 @@ def _escapeXML(text):
 
 
 def _loadMetadata(module):
-    """!Load metadata to modules.
+    """Load metadata to modules.
 
-    @param module module name
-    @return (description, keywords as a list)
+    :param module: module name
+    :return: (description, keywords as a list)
     """
     try:
         task = gtask.parse_interface(module)
@@ -546,7 +547,7 @@ def _loadMetadata(module):
 
 
 def _addHandlers(node):
-    """!Add missing handlers to modules"""
+    """Add missing handlers to modules"""
     for n in node.findall('.//module-item'):
         if n.find('handler') is None:
             handlerNode = etree.SubElement(parent=n, tag='handler')
@@ -560,7 +561,7 @@ def _addHandlers(node):
 
 
 def _convertTag(node, old, new):
-    """!Converts tag name.
+    """Converts tag name.
 
     >>> tree = etree.fromstring('<toolboxes><toolbox><items><module-item/></items></toolbox></toolboxes>')
     >>> _convertTag(tree, 'toolbox', 'menu')
@@ -587,7 +588,7 @@ def _convertTagAndRemoveAttrib(node, old, new):
 
 
 def _convertTree(root):
-    """!Converts tree to be the form readable by core/menutree.py.
+    """Converts tree to be the form readable by core/menutree.py.
 
     >>> tree = etree.fromstring('<toolbox name="MainMenu"><label>Main menu</label><items><toolbox><label>Raster</label><items><module-item name="g.region"><module>g.region</module></module-item></items></toolbox></items></toolbox>')
     >>> _convertTree(tree)
@@ -615,12 +616,12 @@ def _convertTree(root):
 
 
 def _getXMLString(root):
-    """!Converts XML tree to string
+    """Converts XML tree to string
 
     Since it is usually requier, this function adds a comment (about
     autogenerated file) to XML file.
 
-    @return XML as string
+    :return: XML as string
     """
     xml = etree.tostring(root, encoding='UTF-8')
     return xml.replace("<?xml version='1.0' encoding='UTF-8'?>\n",
@@ -634,20 +635,21 @@ def do_doctest_gettext_workaround():
     When using gettext with dynamically defined underscore function
     (`_("For translation")`), doctest does not work properly.
 
-    One option is to use `import as` instead of dynamically defined underscore
-    function but this requires change all modules which are used by tested
-    module.
+    One option is to use `import as` instead of dynamically defined
+    underscore function but this requires change all modules which are
+    used by tested module.
 
-    The second option is to define dummy underscore function and one other
-    function which creates the right environment to satisfy all. This is done
-    by this function. Moreover, `sys.displayhook` and also
+    The second option is to define dummy underscore function and one
+    other function which creates the right environment to satisfy all.
+    This is done by this function. Moreover, `sys.displayhook` and also
     `sys.__displayhook__` needs to be redefined too (the later one probably
     should not be newer redefined but some cases just requires that).
 
-    GRASS specific note is that wxGUI switched to use imported underscore
-    function for translation. However, GRASS Python libraries still uses the
-    dynamically defined underscore function, so this workaround function is
-    still needed when you import something from GRASS Python libraries.
+    GRASS specific note is that wxGUI switched to use imported
+    underscore function for translation. However, GRASS Python libraries
+    still uses the dynamically defined underscore function, so this
+    workaround function is still needed when you import something from
+    GRASS Python libraries.
     """
     def new_displayhook(string):
         """A replacement for default `sys.displayhook`"""
@@ -668,7 +670,7 @@ def do_doctest_gettext_workaround():
 def doc_test():
     """Tests the module using doctest
 
-    @return a number of failed tests
+    :return: a number of failed tests
     """
     import doctest
     do_doctest_gettext_workaround()
@@ -676,8 +678,8 @@ def doc_test():
 
 
 def module_test():
-    """Tests the module using test files included in the current directory and
-    in files from distribution.
+    """Tests the module using test files included in the current
+    directory and in files from distribution.
     """
     toolboxesFile   = os.path.join(WXGUIDIR, 'xml', 'toolboxes.xml')
     userToolboxesFile = 'test.toolboxes_user_toolboxes.xml'

+ 27 - 27
gui/wxpython/core/treemodel.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package core.treemodel
 
 @brief tree structure model (used for menu, search tree)
@@ -18,7 +18,7 @@ This program is free software under the GNU General Public License
 
 
 class TreeModel(object):
-    """!Class represents a tree structure with hidden root.
+    """Class represents a tree structure with hidden root.
     
     TreeModel is used together with TreeView class to display results in GUI.
     The functionality is not complete, only needed methods are implemented.
@@ -53,9 +53,9 @@ class TreeModel(object):
         * xxx : 1
     """
     def __init__(self, nodeClass):
-        """!Constructor creates root node.
+        """Constructor creates root node.
 
-        @param nodeClass class which is used for creating nodes
+        :param nodeClass: class which is used for creating nodes
         """
         self._root = nodeClass('root')
         self.nodeClass = nodeClass
@@ -65,13 +65,13 @@ class TreeModel(object):
         return self._root
 
     def AppendNode(self, parent, label, data=None):
-        """!Create node and append it to parent node.
+        """Create node and append it to parent node.
         
-        @param parent parent node of the new node
-        @param label node label
-        @param data optional node data
+        :param parent: parent node of the new node
+        :param label: node label
+        :param data: optional node data
         
-        @return new node
+        :return: new node
         """
         node = self.nodeClass(label=label, data=data)
         parent.children.append(node)
@@ -79,30 +79,30 @@ class TreeModel(object):
         return node
 
     def SearchNodes(self, **kwargs):
-        """!Search nodes according to specified attributes."""
+        """Search nodes according to specified attributes."""
         nodes = []
         self._searchNodes(node=self.root, foundNodes=nodes, **kwargs)
         return nodes
         
     def _searchNodes(self, node, foundNodes, **kwargs):
-        """!Helper method for searching nodes."""
+        """Helper method for searching nodes."""
         if node.match(**kwargs):
             foundNodes.append(node)
         for child in node.children:
             self._searchNodes(node=child, foundNodes=foundNodes, **kwargs)
 
     def GetNodeByIndex(self, index):
-        """!Method used for communication between view (VirtualTree) and model.
+        """Method used for communication between view (VirtualTree) and model.
 
-        @param index index of node, as defined in VirtualTree doc
-        (e.g. root ~ [], second node of a first node ~ [0, 1])
+        :param index: index of node, as defined in VirtualTree doc
+                      (e.g. root ~ [], second node of a first node ~ [0, 1])
         """
         if len(index) == 0:
             return self.root
         return self._getNode(self.root, index)
         
     def GetIndexOfNode(self, node):
-        """!Method used for communication between view (VirtualTree) and model."""
+        """Method used for communication between view (VirtualTree) and model."""
         index = []
         return self._getIndex(node, index)
         
@@ -115,7 +115,7 @@ class TreeModel(object):
         
         
     def GetChildrenByIndex(self, index):
-        """!Method used for communication between view (VirtualTree) and model."""
+        """Method used for communication between view (VirtualTree) and model."""
         if len(index) == 0:
             return self.root.children
         node = self._getNode(self.root, index)
@@ -128,12 +128,12 @@ class TreeModel(object):
             return self._getNode(node.children[index[0]], index[1:])
 
     def RemoveNode(self, node):
-        """!Removes node."""
+        """Removes node."""
         if node.parent:
             node.parent.children.remove(node)
 
     def __str__(self):
-        """!Print tree."""
+        """Print tree."""
         text = []
         for child in self.root.children:
             child.nprint(text)
@@ -141,12 +141,12 @@ class TreeModel(object):
 
 
 class DictNode(object):
-    """!Node which has data in a form of dictionary."""
+    """Node which has data in a form of dictionary."""
     def __init__(self, label, data=None):
-        """!Create node.
+        """Create node.
 
-        @param label node label (displayed in GUI)
-        @param data data as dictionary or None
+        :param label: node label (displayed in GUI)
+        :param data: data as dictionary or None
         """
 
         self.label = label
@@ -174,10 +174,10 @@ class DictNode(object):
                 child.nprint(text, indent + 2)
 
     def match(self, key, value):
-        """!Method used for searching according to given parameters.
+        """Method used for searching according to given parameters.
 
-        @param value dictionary value to be matched
-        @param key data dictionary key
+        :param value: dictionary value to be matched
+        :param key: data dictionary key
         """
         if key in self.data and self.data[key] == value:
             return True
@@ -185,12 +185,12 @@ class DictNode(object):
 
 
 class ModuleNode(DictNode):
-    """!Node representing module."""
+    """Node representing module."""
     def __init__(self, label, data=None):
         super(ModuleNode, self).__init__(label=label, data=data)
 
     def match(self, key, value):
-        """!Method used for searching according to command,
+        """Method used for searching according to command,
         keywords or description."""
         if not self.data:
             return False

+ 23 - 27
gui/wxpython/core/units.py

@@ -1,15 +1,14 @@
-"""!
+"""
 @package core.units
 
 @brief Units management
 
-@todo Probably will be replaced by Python ctypes fns in the near
-future(?)
+.. todo::
+    Probably will be replaced by Python ctypes fns in the near future(?)
 
 Usage:
-@code
-from core.units import Units
-@endcode
+
+    from core.units import Units
 
 Classes:
  - units::BaseUnits
@@ -46,11 +45,11 @@ class BaseUnits:
                              4 : { 'key' : 'ht', 'label' : _('hectares') } }
 
     def GetUnitsList(self, type):
-        """!Get list of units (their labels)
+        """Get list of units (their labels)
         
-        @param type units type ('length' or 'area')
+        :param type: units type ('length' or 'area')
         
-        @return list of units labels
+        :return: list of units labels
         """
         result = list()
         try:
@@ -64,20 +63,20 @@ class BaseUnits:
         return result
 
     def GetUnitsKey(self, type, index):
-        """!Get units key based on index
+        """Get units key based on index
         
-        @param type units type ('length' or 'area')
-        @param index units index
+        :param type: units type ('length' or 'area')
+        :param index: units index
         """
         return self._units[type][index]['key']
 
     def GetUnitsIndex(self, type, key):
-        """!Get units index based on key
+        """Get units index based on key
         
-        @param type units type ('length' or 'area')
-        @param key units key, e.g. 'me' for meters
+        :param type: units type ('length' or 'area')
+        :param key: units key, e.g. 'me' for meters
 
-        @return index
+        :return: index
         """
         for k, u in self._units[type].iteritems():
             if u['key'] == key:
@@ -87,13 +86,13 @@ class BaseUnits:
 Units = BaseUnits()
 
 def ConvertValue(value, type, units):
-    """!Convert value from map units to given units
+    """Convert value from map units to given units
 
     Inspired by vector/v.to.db/units.c
 
-    @param value value to be converted
-    @param type units type ('length', 'area')
-    @param unit  destination units
+    :param value: value to be converted
+    :param type: units type ('length', 'area')
+    :param unit: destination units
     """
     # get map units
     # TODO
@@ -126,11 +125,10 @@ def ConvertValue(value, type, units):
 
 
 def formatDist(distance, mapunits):
-        """!Formats length numbers and units in a nice way.
+        """Formats length numbers and units in a nice way.
 
         Formats length numbers and units as a function of length.
 
-        @code
         >>> formatDist(20.56915, 'metres')
         (20.57, 'm')
         >>> formatDist(6983.4591, 'metres')
@@ -146,13 +144,11 @@ def formatDist(distance, mapunits):
         >>> formatDist(82.146, 'unknown')
         (82.15, 'units')
 
-        @endcode
-
         Accepted map units are 'meters', 'metres', 'feet', 'degree'.
         Returns 'units' instead of unrecognized units.
 
-        @param distance map units
-        @param mapunits map units
+        :param distance: map units
+        :param mapunits: map units
 
         From code by Hamish Bowman Grass Development Team 2006.
         """
@@ -206,7 +202,7 @@ def formatDist(distance, mapunits):
 def doc_test():
     """Tests the module using doctest
 
-    @return a number of failed tests
+    :return: a number of failed tests
     """
     import doctest
     from core.utils import do_doctest_gettext_workaround

+ 122 - 109
gui/wxpython/core/utils.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package core.utils
 
 @brief Misc utilities for wxGUI
@@ -39,11 +39,11 @@ except IOError:
     _ = null_gettext
 
 def normalize_whitespace(text):
-    """!Remove redundant whitespace from a string"""
+    """Remove redundant whitespace from a string"""
     return string.join(string.split(text), ' ')
 
 def split(s):
-    """!Platform spefic shlex.split"""
+    """Platform spefic shlex.split"""
     try:
         if sys.platform == "win32":
             return shlex.split(s.replace('\\', r'\\'))
@@ -55,13 +55,14 @@ def split(s):
     return []
 
 def GetTempfile(pref=None):
-    """!Creates GRASS temporary file using defined prefix.
+    """Creates GRASS temporary file using defined prefix.
 
-    @todo Fix path on MS Windows/MSYS
+    .. todo::
+        Fix path on MS Windows/MSYS
 
-    @param pref prefer the given path
+    :param pref: prefer the given path
 
-    @return Path to file name (string) or None
+    :return: Path to file name (string) or None
     """
     ret = RunCommand('g.tempfile',
                      read = True,
@@ -84,17 +85,18 @@ def GetTempfile(pref=None):
 
 def GetLayerNameFromCmd(dcmd, fullyQualified = False, param = None,
                         layerType = None):
-    """!Get map name from GRASS command
+    """Get map name from GRASS command
     
     Parameter dcmd can be modified when first parameter is not
     defined.
     
-    @param dcmd GRASS command (given as list)
-    @param fullyQualified change map name to be fully qualified
-    @param param params directory
-    @param layerType check also layer type ('raster', 'vector', '3d-raster', ...)
+    :param dcmd: GRASS command (given as list)
+    :param fullyQualified: change map name to be fully qualified
+    :param param: params directory
+    :param str layerType: check also layer type ('raster', 'vector',
+                          '3d-raster', ...)
     
-    @return tuple (name, found)
+    :return: tuple (name, found)
     """
     mapname = ''
     found   = True
@@ -190,9 +192,10 @@ def GetLayerNameFromCmd(dcmd, fullyQualified = False, param = None,
     return mapname, found
 
 def GetValidLayerName(name):
-    """!Make layer name SQL compliant, based on G_str_to_sql()
+    """Make layer name SQL compliant, based on G_str_to_sql()
     
-    @todo: Better use directly Ctypes to reuse venerable libgis C fns...
+    .. todo::
+        Better use directly Ctypes to reuse venerable libgis C fns...
     """
     retName = str(name).strip()
     
@@ -222,14 +225,14 @@ def GetValidLayerName(name):
     return retName
 
 def ListOfCatsToRange(cats):
-    """!Convert list of category number to range(s)
+    """Convert list of category number to range(s)
 
     Used for example for d.vect cats=[range]
 
-    @param cats category list
+    :param cats: category list
 
-    @return category range string
-    @return '' on error
+    :return: category range string
+    :return: '' on error
     """
 
     catstr = ''
@@ -260,12 +263,12 @@ def ListOfCatsToRange(cats):
     return catstr.strip(',')
 
 def ListOfMapsets(get = 'ordered'):
-    """!Get list of available/accessible mapsets
+    """Get list of available/accessible mapsets
 
-    @param get method ('all', 'accessible', 'ordered')
+    :param str get: method ('all', 'accessible', 'ordered')
     
-    @return list of mapsets
-    @return None on error
+    :return: list of mapsets
+    :return: None on error
     """
     mapsets = []
     
@@ -302,11 +305,11 @@ def ListOfMapsets(get = 'ordered'):
     return mapsets
 
 def ListSortLower(list):
-    """!Sort list items (not case-sensitive)"""
+    """Sort list items (not case-sensitive)"""
     list.sort(cmp=lambda x, y: cmp(x.lower(), y.lower()))
 
 def GetVectorNumberOfLayers(vector):
-    """!Get list of all vector layers"""
+    """Get list of all vector layers"""
     layers = list()
     if not vector:
         return layers
@@ -336,16 +339,16 @@ def GetVectorNumberOfLayers(vector):
     return layers
 
 def Deg2DMS(lon, lat, string = True, hemisphere = True, precision = 3):
-    """!Convert deg value to dms string
+    """Convert deg value to dms string
 
-    @param lon longitude (x)
-    @param lat latitude (y)
-    @param string True to return string otherwise tuple
-    @param hemisphere print hemisphere
-    @param precision seconds precision
+    :param lon: longitude (x)
+    :param lat: latitude (y)
+    :param string: True to return string otherwise tuple
+    :param hemisphere: print hemisphere
+    :param precision: seconds precision
     
-    @return DMS string or tuple of values
-    @return empty string on error
+    :return: DMS string or tuple of values
+    :return: empty string on error
     """
     try:
         flat = float(lat)
@@ -390,13 +393,13 @@ def Deg2DMS(lon, lat, string = True, hemisphere = True, precision = 3):
     return (slon + hlon, slat + hlat)
 
 def DMS2Deg(lon, lat):
-    """!Convert dms value to deg
+    """Convert dms value to deg
 
-    @param lon longitude (x)
-    @param lat latitude (y)
+    :param lon: longitude (x)
+    :param lat: latitude (y)
     
-    @return tuple of converted values
-    @return ValueError on error
+    :return: tuple of converted values
+    :return: ValueError on error
     """
     x = __ll_parts(lon, reverse = True)
     y = __ll_parts(lat, reverse = True)
@@ -404,14 +407,14 @@ def DMS2Deg(lon, lat):
     return (x, y)
 
 def __ll_parts(value, reverse = False, precision = 3):
-    """!Converts deg to d:m:s string
+    """Converts deg to d:m:s string
 
-    @param value value to be converted
-    @param reverse True to convert from d:m:s to deg
-    @param precision seconds precision (ignored if reverse is True)
+    :param value: value to be converted
+    :param reverse: True to convert from d:m:s to deg
+    :param precision: seconds precision (ignored if reverse is True)
     
-    @return converted value (string/float)
-    @return ValueError on error (reverse == True)
+    :return: converted value (string/float)
+    :return: ValueError on error (reverse == True)
     """
     if not reverse:
         if value == 0.0:
@@ -468,20 +471,20 @@ def __ll_parts(value, reverse = False, precision = 3):
         return coef * (float(d) + fm + fs)
     
 def GetCmdString(cmd):
-    """!Get GRASS command as string.
+    """Get GRASS command as string.
     
-    @param cmd GRASS command given as tuple
+    :param cmd: GRASS command given as tuple
     
-    @return command string
+    :return: command string
     """
     return ' '.join(CmdTupleToList(cmd))
 
 def CmdTupleToList(cmd):
-    """!Convert command tuple to list.
+    """Convert command tuple to list.
     
-    @param cmd GRASS command given as tuple
+    :param cmd: GRASS command given as tuple
     
-    @return command in list
+    :return: command in list
     """
     cmdList = []
     if not cmd:
@@ -504,7 +507,7 @@ def CmdTupleToList(cmd):
     return cmdList
 
 def CmdToTuple(cmd):
-    """!Convert command list to tuple for gcmd.RunCommand()"""
+    """Convert command list to tuple for gcmd.RunCommand()"""
     if len(cmd) < 1:
         return None
     
@@ -528,7 +531,7 @@ def CmdToTuple(cmd):
     return (cmd[0], dcmd)
 
 def PathJoin(*args):
-    """!Check path created by os.path.join"""
+    """Check path created by os.path.join"""
     path = os.path.join(*args)
     if platform.system() == 'Windows' and \
             '/' in path:
@@ -537,12 +540,12 @@ def PathJoin(*args):
     return path
 
 def ReadEpsgCodes(path):
-    """!Read EPSG code from the file
+    """Read EPSG code from the file
 
-    @param path full path to the file with EPSG codes
+    :param path: full path to the file with EPSG codes
 
-    @return dictionary of EPSG code
-    @return string on error
+    :return: dictionary of EPSG code
+    :return: string on error
     """
     epsgCodeDict = dict()
     try:
@@ -577,13 +580,13 @@ def ReadEpsgCodes(path):
     return epsgCodeDict
 
 def ReprojectCoordinates(coord, projOut, projIn = None, flags = ''):
-    """!Reproject coordinates
+    """Reproject coordinates
 
-    @param coord coordinates given as tuple
-    @param projOut output projection
-    @param projIn input projection (use location projection settings)
+    :param coord: coordinates given as tuple
+    :param projOut: output projection
+    :param projIn: input projection (use location projection settings)
 
-    @return reprojected coordinates (returned as tuple)
+    :return: reprojected coordinates (returned as tuple)
     """
     coors = RunCommand('m.proj',
                        flags = flags,
@@ -612,11 +615,11 @@ def ReprojectCoordinates(coord, projOut, projIn = None, flags = ''):
     return (None, None)
 
 def GetListOfLocations(dbase):
-    """!Get list of GRASS locations in given dbase
+    """Get list of GRASS locations in given dbase
 
-    @param dbase GRASS database path
+    :param dbase: GRASS database path
 
-    @return list of locations (sorted)
+    :return: list of locations (sorted)
     """
     listOfLocations = list()
 
@@ -635,13 +638,13 @@ def GetListOfLocations(dbase):
     return listOfLocations
 
 def GetListOfMapsets(dbase, location, selectable = False):
-    """!Get list of mapsets in given GRASS location
+    """Get list of mapsets in given GRASS location
 
-    @param dbase      GRASS database path
-    @param location   GRASS location
-    @param selectable True to get list of selectable mapsets, otherwise all
+    :param dbase: GRASS database path
+    :param location: GRASS location
+    :param selectable: True to get list of selectable mapsets, otherwise all
 
-    @return list of mapsets - sorted (PERMANENT first)
+    :return: list of mapsets - sorted (PERMANENT first)
     """
     listOfMapsets = list()
     
@@ -667,7 +670,7 @@ def GetListOfMapsets(dbase, location, selectable = False):
     return listOfMapsets
 
 def GetColorTables():
-    """!Get list of color tables"""
+    """Get list of color tables"""
     ret = RunCommand('r.colors',
                      read = True,
                      flags = 'l')
@@ -677,7 +680,7 @@ def GetColorTables():
     return ret.splitlines()
 
 def _getGDALFormats():
-    """!Get dictionary of avaialble GDAL drivers"""
+    """Get dictionary of avaialble GDAL drivers"""
     try:
         ret = grass.read_command('r.in.gdal',
                                  quiet = True,
@@ -688,7 +691,7 @@ def _getGDALFormats():
     return _parseFormats(ret), _parseFormats(ret, writableOnly = True)
 
 def _getOGRFormats():
-    """!Get dictionary of avaialble OGR drivers"""
+    """Get dictionary of avaialble OGR drivers"""
     try:
         ret = grass.read_command('v.in.ogr',
                                  quiet = True,
@@ -699,7 +702,7 @@ def _getOGRFormats():
     return _parseFormats(ret), _parseFormats(ret, writableOnly = True)
 
 def _parseFormats(output, writableOnly = False):
-    """!Parse r.in.gdal/v.in.ogr -f output"""
+    """Parse r.in.gdal/v.in.ogr -f output"""
     formats = { 'file'     : list(),
                 'database' : list(),
                 'protocol' : list()
@@ -747,7 +750,7 @@ def _parseFormats(output, writableOnly = False):
 formats = None
 
 def GetFormats(writableOnly = False):
-    """!Get GDAL/OGR formats"""
+    """Get GDAL/OGR formats"""
     global formats
     if not formats:
         gdalAll, gdalWritable = _getGDALFormats()
@@ -838,7 +841,7 @@ vectorFormatExtension = {
 
 
 def GetSettingsPath():
-    """!Get full path to the settings directory
+    """Get full path to the settings directory
     """
     try:
         verFd = open(os.path.join(globalvar.ETCDIR, "VERSIONNUMBER"))
@@ -855,14 +858,14 @@ def GetSettingsPath():
     return os.path.join(os.getenv('HOME'), '.grass%d' % version)
 
 def StoreEnvVariable(key, value = None, envFile = None):
-    """!Store environmental variable
+    """Store environmental variable
 
     If value is not given (is None) then environmental variable is
     unset.
     
-    @param key env key
-    @param value env value
-    @param envFile path to the environmental file (None for default location)
+    :param key: env key
+    :param value: env value
+    :param envFile: path to the environmental file (None for default location)
     """
     windows = sys.platform == 'win32'
     if not envFile:
@@ -924,10 +927,10 @@ def StoreEnvVariable(key, value = None, envFile = None):
     fd.close()
 
 def SetAddOnPath(addonPath = None, key = 'PATH'):
-    """!Set default AddOn path
+    """Set default AddOn path
 
-    @param addonPath path to addons (None for default)
-    @param key env key - 'PATH' or 'BASE'
+    :param addonPath: path to addons (None for default)
+    :param key: env key - 'PATH' or 'BASE'
     """
     gVersion = grass.version()['version'].split('.', 1)[0]
     # update env file
@@ -947,28 +950,36 @@ def SetAddOnPath(addonPath = None, key = 'PATH'):
     # update path
     if addonPath not in os.environ['PATH']:
         os.environ['PATH'] = addonPath + os.pathsep + os.environ['PATH']
-    
-# From lib/gis/col_str.c, except purple which is mentioned
-# there but not given RGB values
+
+
+# predefined colors and their names
+# must be in sync with lib/gis/color_str.c
 str2rgb = {'aqua': (100, 128, 255),
            'black': (0, 0, 0),
            'blue': (0, 0, 255),
            'brown': (180, 77, 25),
            'cyan': (0, 255, 255),
            'gray': (128, 128, 128),
-           'green': (0, 255, 0),
            'grey': (128, 128, 128),
+           'green': (0, 255, 0),
            'indigo': (0, 128, 255),
            'magenta': (255, 0, 255),
            'orange': (255, 128, 0),
-           'purple': (128, 0, 128),
            'red': (255, 0, 0),
            'violet': (128, 0, 255),
+           'purple': (128, 0, 255),
            'white': (255, 255, 255),
            'yellow': (255, 255, 0)}
 rgb2str = {}
-for (s,r) in str2rgb.items():
-    rgb2str[ r ] = s
+for (s, r) in str2rgb.items():
+    rgb2str[r] = s
+# ensure that gray value has 'gray' string and not 'grey'
+rgb2str[str2rgb['gray']] = 'gray'
+# purple is defined as nickname for violet in lib/gis
+# (although Wikipedia says that purple is (128, 0, 128))
+# we will prefer the defined color, not nickname
+rgb2str[str2rgb['violet']] = 'violet'
+
 
 def color_resolve(color):
     if len(color) > 0 and color[0] in "0123456789":
@@ -1016,14 +1027,14 @@ for (cmd, ltype) in command2ltype.items():
 
 
 def GetGEventAttribsForHandler(method, event):
-    """!Get attributes from event, which can be used by handler method. 
+    """Get attributes from event, which can be used by handler method. 
 
     Be aware of event class attributes.
 
-    @param method - handler method (including self arg)
-    @param event - event
+    :param method: handler method (including self arg)
+    :param event: event
 
-    @return (valid kwargs for method, 
+    :return: (valid kwargs for method, 
              list of method's args without default value 
              which were not found among event attributes)
     """
@@ -1050,15 +1061,20 @@ def GetGEventAttribsForHandler(method, event):
     return kwargs, missing_args
 
 def GuiModuleMain(mainfn):
-    """!Main function for g.gui.* modules
-
-    os.fork removed in r62649 as fragile
+    """Main function for g.gui.* modules
+    
+    Note: os.fork() is supported only on Unix platforms
+    
+    .. todo::
+        Replace os.fork() by multiprocessing (?)
+    
+    :param mainfn: main function
     """
     mainfn()
 
 
 def PilImageToWxImage(pilImage, copyAlpha = True):
-    """!Convert PIL image to wx.Image
+    """Convert PIL image to wx.Image
     
     Based on http://wiki.wxpython.org/WorkingWithImages
     """
@@ -1083,12 +1099,12 @@ def PilImageToWxImage(pilImage, copyAlpha = True):
 
 
 def autoCropImageFromFile(filename):
-    """!Loads image from file and crops it automatically.
+    """Loads image from file and crops it automatically.
 
     If PIL is not installed, it does not crop it.
 
-    @param filename path to file
-    @return wx.Image instance
+    :param filename: path to file
+    :return: wx.Image instance
     """
     try:
         from PIL import Image
@@ -1102,12 +1118,11 @@ def autoCropImageFromFile(filename):
 
 
 def isInRegion(regionA, regionB):
-    """!Tests if 'regionA' is inside of 'regionB'.
+    """Tests if 'regionA' is inside of 'regionB'.
 
     For example, region A is a display region and region B is some reference
     region, e.g., a computational region.
 
-    @code
     >>> displayRegion = {'n': 223900, 's': 217190, 'w': 630780, 'e': 640690}
     >>> compRegion = {'n': 228500, 's': 215000, 'w': 630000, 'e': 645000}
     >>> isInRegion(displayRegion, compRegion)
@@ -1116,13 +1131,11 @@ def isInRegion(regionA, regionB):
     >>> isInRegion(displayRegion, compRegion)
     False
 
-    @endcode
-
-    @param regionA input region A as dictionary
-    @param regionB input region B as dictionary
+    :param regionA: input region A as dictionary
+    :param regionB: input region B as dictionary
 
-    @return True if region A is inside of region B
-    @return False othewise
+    :return: True if region A is inside of region B
+    :return: False othewise
     """
     if regionA['s'] >= regionB['s'] and \
             regionA['n'] <= regionB['n'] and \
@@ -1162,7 +1175,7 @@ def do_doctest_gettext_workaround():
 def doc_test():
     """Tests the module using doctest
 
-    @return a number of failed tests
+    :return: a number of failed tests
     """
     import doctest
     do_doctest_gettext_workaround()

+ 59 - 59
gui/wxpython/core/workspace.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package core.workspace
 
 @brief Open/save workspace definition file
@@ -30,7 +30,7 @@ from grass.script import core as gcore
 
 class ProcessWorkspaceFile:
     def __init__(self, tree):
-        """!A ElementTree handler for the GXW XML file, as defined in
+        """A ElementTree handler for the GXW XML file, as defined in
         grass-gxw.dtd.
         """
         self.tree = tree
@@ -66,9 +66,9 @@ class ProcessWorkspaceFile:
             self.nvizDefault = None
         
     def __filterValue(self, value):
-        """!Filter value
+        """Filter value
         
-        @param value
+        :param value:
         """
         value = value.replace('&lt;', '<')
         value = value.replace('&gt;', '>')
@@ -76,7 +76,7 @@ class ProcessWorkspaceFile:
         return value
 
     def __getNodeText(self, node, tag, default = ''):
-        """!Get node text"""
+        """Get node text"""
         p = node.find(tag)
         if p is not None:
             # if empty text is inside tag,
@@ -89,7 +89,7 @@ class ProcessWorkspaceFile:
         return default
     
     def __processFile(self):
-        """!Process workspace file"""
+        """Process workspace file"""
         #
         # layer manager
         #
@@ -164,10 +164,10 @@ class ProcessWorkspaceFile:
             self.__processNvizState(display)
 
     def __processLayers(self, node, inGroup = -1):
-        """!Process layers/groups of selected display
+        """Process layers/groups of selected display
         
-        @param node display tree node
-        @param inGroup in group -> index of group item otherwise -1
+        :param node: display tree node
+        :param inGroup: in group -> index of group item otherwise -1
         """
         for item in node.getchildren():
             if item.tag == 'group':
@@ -204,9 +204,9 @@ class ProcessWorkspaceFile:
                         "nviz"     : nviz } )
             
     def __processLayer(self, layer):
-        """!Process layer item
+        """Process layer item
 
-        @param layer tree node
+        :param layer: tree node
         """
         cmd = list()
         
@@ -262,9 +262,9 @@ class ProcessWorkspaceFile:
         return (cmd, selected, vdigit, nviz)
 
     def __processLayerVdigit(self, node_vdigit):
-        """!Process vector digitizer layer settings
+        """Process vector digitizer layer settings
 
-        @param node_vdigit vdigit node
+        :param node_vdigit: vdigit node
         """
         # init nviz layer properties
         vdigit = dict()
@@ -280,9 +280,9 @@ class ProcessWorkspaceFile:
         return vdigit
     
     def __processLayerNviz(self, node_nviz):
-        """!Process 3D layer settings
+        """Process 3D layer settings
 
-        @param node_nviz nviz node
+        :param node_nviz: nviz node
         """
         # init nviz layer properties
         nviz = {}
@@ -309,10 +309,10 @@ class ProcessWorkspaceFile:
         return nviz
 
     def __processLayerNvizSurface(self, nvizData, nodeSurface):
-        """!Process 3D layer settings - surface
+        """Process 3D layer settings - surface
 
-        @param nodeData nviz data dict
-        @param nodeSurface nviz surface node
+        :param nodeData: nviz data dict
+        :param nodeSurface: nviz surface node
         """
         # attributes
         for attrb in nodeSurface.findall('attribute'):
@@ -373,10 +373,10 @@ class ProcessWorkspaceFile:
                 dc[coor] = value
 
     def __processLayerNvizVolume(self, nvizData, nodeVolume):
-        """!Process 3D layer settings - volume
+        """Process 3D layer settings - volume
 
-        @param nodeData nviz data dict
-        @param nodeVolume nviz volume node
+        :param nodeData: nviz data dict
+        :param nodeVolume: nviz volume node
         """
         # attributes
         for attrb in nodeVolume.findall('attribute'):
@@ -475,10 +475,10 @@ class ProcessWorkspaceFile:
                 dc[coor] = value
 
     def __processLayerNvizVectorPoints(self, nvizData, nodePoints):
-        """!Process 3D layer settings - vector points
+        """Process 3D layer settings - vector points
 
-        @param nodeData nviz data dict
-        @param nodeVector nviz vector points node
+        :param nodeData: nviz data dict
+        :param nodeVector: nviz vector points node
         """
         marker = str(nodePoints.get('marker', ''))
         markerId = list(UserSettings.Get(group='nviz', key='vector',
@@ -530,10 +530,10 @@ class ProcessWorkspaceFile:
                 thematic[use] = int(node_thematic.get(use, '0'))
 
     def __processLayerNvizVectorLines(self, nvizData, nodeLines):
-        """!Process 3D layer settings - vector lines
+        """Process 3D layer settings - vector lines
 
-        @param nodeData nviz data dict
-        @param nodeVector nviz vector lines node
+        :param nodeData: nviz data dict
+        :param nodeVector: nviz vector lines node
         """
         node_mode = nodeLines.find('mode')
         if node_mode is not None:
@@ -576,7 +576,7 @@ class ProcessWorkspaceFile:
                 thematic[use] = int(node_thematic.get(use, '0'))
 
     def __processLayerNvizNode(self, node, tag, cast, dc = None):
-        """!Process given tag nviz/vector"""
+        """Process given tag nviz/vector"""
         node_tag = node.find(tag)
         if node_tag is not None:
             if node_tag.find('value') is not None:
@@ -596,7 +596,7 @@ class ProcessWorkspaceFile:
                 return value
     
     def __processNvizState(self, node):
-        """!Process tag nviz_state"""
+        """Process tag nviz_state"""
         node_state = node.find('nviz_state')
         if node_state is None:
             return
@@ -699,7 +699,7 @@ class ProcessWorkspaceFile:
         self.nviz_state['constants'] = constants    
 
 class WriteWorkspaceFile(object):
-    """!Generic class for writing workspace file"""
+    """Generic class for writing workspace file"""
     def __init__(self, lmgr, file):
         self.file =  file
         self.lmgr = lmgr
@@ -803,14 +803,14 @@ class WriteWorkspaceFile(object):
         file.write('%s</gxw>\n' % (' ' * self.indent))
 
     def __filterValue(self, value):
-        """!Make value XML-valid"""
+        """Make value XML-valid"""
         value = value.replace('<', '&lt;')
         value = value.replace('>', '&gt;')
         
         return value
     
     def __writeLayer(self, mapTree, item):
-        """!Write bunch of layers to GRASS Workspace XML file"""
+        """Write bunch of layers to GRASS Workspace XML file"""
         self.indent += 4
         itemSelected = mapTree.GetSelections()
         while item and item.IsOk():
@@ -901,9 +901,9 @@ class WriteWorkspaceFile(object):
         self.indent -= 4
         
     def __writeNvizSurface(self, data):
-        """!Save Nviz raster layer properties to workspace
+        """Save Nviz raster layer properties to workspace
 
-        @param data Nviz layer properties
+        :param data: Nviz layer properties
         """
         if 'object' not in data: # skip disabled
             return
@@ -974,9 +974,9 @@ class WriteWorkspaceFile(object):
         self.indent -= 4
 
     def __writeNvizVolume(self, data):
-        """!Save Nviz volume layer properties to workspace
+        """Save Nviz volume layer properties to workspace
 
-        @param data Nviz layer properties
+        :param data: Nviz layer properties
         """
         if 'object' not in data:  # skip disabled
             return
@@ -1102,9 +1102,9 @@ class WriteWorkspaceFile(object):
         self.indent -= 4
 
     def __writeNvizVector(self, data):
-        """!Save Nviz vector layer properties (lines/points) to workspace
+        """Save Nviz vector layer properties (lines/points) to workspace
 
-        @param data Nviz layer properties
+        :param data: Nviz layer properties
         """
         self.indent += 4
         for attrb in data.iterkeys():
@@ -1168,11 +1168,11 @@ class WriteWorkspaceFile(object):
         self.indent -= 4
 
     def __writeNvizState(self, view, iview, light, constants):
-        """"!Save Nviz properties (view, light) to workspace
+        """"Save Nviz properties (view, light) to workspace
 
-        @param view Nviz view properties
-        @param iview Nviz internal view properties
-        @param light Nviz light properties
+        :param view: Nviz view properties
+        :param iview: Nviz internal view properties
+        :param light: Nviz light properties
         """
         self.indent += 4
         self.file.write('%s<nviz_state>\n' % (' ' * self.indent))
@@ -1284,11 +1284,11 @@ class WriteWorkspaceFile(object):
         self.indent -= 4
     
     def __writeTagWithValue(self, tag, data, format = 'd'):
-        """!Helper function for writing pair tag
+        """Helper function for writing pair tag
         
-        @param tag written tag
-        @param data written data
-        @param format conversion type
+        :param tag: written tag
+        :param data: written data
+        :param format: conversion type
         """
         self.file.write('%s<%s>\n' % (' ' * self.indent, tag))
         self.indent += 4
@@ -1299,7 +1299,7 @@ class WriteWorkspaceFile(object):
         
 class ProcessGrcFile(object):
     def __init__(self, filename):
-        """!Process GRC file"""
+        """Process GRC file"""
         self.filename = filename
 
         # elements
@@ -1315,11 +1315,11 @@ class ProcessGrcFile(object):
         self.num_error = 0
 
     def read(self, parent):
-        """!Read GRC file
+        """Read GRC file
 
-        @param parent parent window
+        :param parent: parent window
 
-        @return list of map layers
+        :return: list of map layers
         """
         try:
             file = open(self.filename, "r")
@@ -1349,7 +1349,7 @@ class ProcessGrcFile(object):
         return self.layers
 
     def process_line(self, line, line_id):
-        """!Process line definition"""
+        """Process line definition"""
         element = self._get_element(line)
         if element == 'Group':
             self.groupName = self._get_value(line)
@@ -1560,24 +1560,24 @@ class ProcessGrcFile(object):
             self.num_error += 1
 
     def _get_value(self, line):
-        """!Get value of element"""
+        """Get value of element"""
         try:
             return line.strip(' ').split(' ')[1].strip(' ')
         except:
             return ''
 
     def _get_element(self, line):
-        """!Get element tag"""
+        """Get element tag"""
         return line.strip(' ').split(' ')[0].strip(' ')
 
     def _get_cmd_param_index(self, cmd, name):
-        """!Get index of parameter in cmd list
+        """Get index of parameter in cmd list
 
-        @param cmd cmd list
-        @param name parameter name
+        :param cmd: cmd list
+        :param name: parameter name
 
-        @return index
-        @return -1 if not found
+        :return: index
+        :return: -1 if not found
         """
         i = 0
         for param in cmd:
@@ -1592,7 +1592,7 @@ class ProcessGrcFile(object):
         return -1
 
     def _color_name_to_rgb(self, value):
-        """!Convert color name (#) to rgb values"""
+        """Convert color name (#) to rgb values"""
         col = wx.NamedColour(value)
         return str(col.Red()) + ':' + \
             str(col.Green()) + ':' + \

+ 17 - 16
gui/wxpython/core/ws.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package core.ws
 
 @brief Fetching and preparation of web service data for rendering.
@@ -42,7 +42,7 @@ from grass.pydispatch.signal import Signal
 
 
 class RenderWMSMgr(wx.EvtHandler):
-    """!Fetch and prepare WMS data for rendering.
+    """Fetch and prepare WMS data for rendering.
     """
     def __init__(self, layer, mapfile, maskfile):
         if not haveGdal:
@@ -78,10 +78,11 @@ class RenderWMSMgr(wx.EvtHandler):
         try_remove(self.tempMap)
 
     def Render(self, cmd, env):
-        """!If it is needed, download missing WMS data.
+        """If it is needed, download missing WMS data.
 
-        @todo lmgr deletes mapfile and maskfile when order of layers
-        was changed (drag and drop) - if deleted, fetch data again
+        .. todo::
+            lmgr deletes mapfile and maskfile when order of layers
+            was changed (drag and drop) - if deleted, fetch data again
         """
         if not haveGdal:
             return
@@ -136,7 +137,7 @@ class RenderWMSMgr(wx.EvtHandler):
             self.thread.RunCmd(cmdList, env=env, stderr=self.cmdStdErr)
 
     def OnCmdOutput(self, event):
-        """!Print cmd output according to debug level.
+        """Print cmd output according to debug level.
         """
         if Debug.GetLevel() == 0:
             if event.type == 'error':
@@ -146,7 +147,7 @@ class RenderWMSMgr(wx.EvtHandler):
             Debug.msg(1, event.text)
 
     def OnDataFetched(self, event):
-        """!Fetch data
+        """Fetch data
         """
         if event.pid != self.currentPid:
             return
@@ -173,7 +174,7 @@ class RenderWMSMgr(wx.EvtHandler):
         self.dataFetched.emit()
 
     def _getRegionDict(self, env):
-        """!Parse string from GRASS_REGION env variable into dict.
+        """Parse string from GRASS_REGION env variable into dict.
         """
         region = {}
         parsedRegion = env["GRASS_REGION"].split(';')
@@ -193,7 +194,7 @@ class RenderWMSMgr(wx.EvtHandler):
         return region
 
     def _createRegionStr(self, region):
-        """!Create string for GRASS_REGION env variable from  dict created by _getRegionDict.
+        """Create string for GRASS_REGION env variable from  dict created by _getRegionDict.
         """
         regionStr = ''
         for k, v in region.iteritems():
@@ -205,12 +206,12 @@ class RenderWMSMgr(wx.EvtHandler):
         return regionStr
 
     def IsDownloading(self):
-        """!Is it downloading any data from WMS server? 
+        """Is it downloading any data from WMS server? 
         """
         return self.downloading
 
     def _fitAspect(self, region, size):
-        """!Compute region parameters to have direction independent resolution.
+        """Compute region parameters to have direction independent resolution.
         """
         if region['n-s resol'] > region['e-w resol']:
             delta = region['n-s resol'] * size['cols'] / 2
@@ -231,18 +232,18 @@ class RenderWMSMgr(wx.EvtHandler):
             region['n-s resol'] = region['e-w resol']
 
     def Abort(self):
-        """!Abort process"""
+        """Abort process"""
         self.updateMap = False
         self.thread.abort(abortall = True)        
 
 
 class GDALRasterMerger:
-    """!Merge rasters.
+    """Merge rasters.
 
         Based on gdal_merge.py utility.
     """
     def __init__(self, targetFile, region, bandsNum, gdalDriver, fillValue = None):
-        """!Create raster for merging.
+        """Create raster for merging.
         """
         self.gdalDrvType = gdalDriver
 
@@ -262,7 +263,7 @@ class GDALRasterMerger:
                 self.tDataset.GetRasterBand(iBand).Fill(fillValue)
 
     def AddRasterBands(self, sourceFile, sTBands):
-        """!Add raster bands from sourceFile into the merging raster.
+        """Add raster bands from sourceFile into the merging raster.
         """
         sDataset = gdal.Open(sourceFile, gdal.GA_ReadOnly) 
         if sDataset is None:
@@ -330,7 +331,7 @@ class GDALRasterMerger:
         return ulx, uly, lrx, lry 
 
     def SetGeorefAndProj(self):
-        """!Set georeference and projection to target file
+        """Set georeference and projection to target file
         """
         projection = grass.read_command('g.proj', 
                                         flags = 'wf')

+ 151 - 144
gui/wxpython/dbmgr/base.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package dbmgr.base
 
 @brief GRASS Attribute Table Manager base classes
@@ -16,7 +16,8 @@ List of classes:
  - base::LayerBook
  - base::FieldStatistics
 
-@todo Implement giface class
+.. todo::
+    Implement giface class
 
 (C) 2007-2014 by the GRASS Development Team
 
@@ -54,21 +55,21 @@ from dbmgr.dialogs    import ModifyTableRecord, AddColumnDialog
 from core.settings    import UserSettings
 
 class Log:
-    """!The log output SQL is redirected to the status bar of the
+    """The log output SQL is redirected to the status bar of the
     containing frame.
     """
     def __init__(self, parent):
         self.parent = parent
 
     def write(self, text_string):
-        """!Update status bar"""
+        """Update status bar"""
         if self.parent:
             self.parent.SetStatusText(text_string.strip())
 
 class VirtualAttributeList(wx.ListCtrl,
                            listmix.ListCtrlAutoWidthMixin,
                            listmix.ColumnSorterMixin):
-    """!Support virtual list class for Attribute Table Manager (browse page)
+    """Support virtual list class for Attribute Table Manager (browse page)
     """
     def __init__(self, parent, log, dbMgrData, layer, pages):
         # initialize variables
@@ -125,7 +126,7 @@ class VirtualAttributeList(wx.ListCtrl,
         self.Bind(wx.EVT_LIST_COL_RIGHT_CLICK, self.OnColumnMenu)     
         
     def Update(self, mapDBInfo = None):
-        """!Update list according new mapDBInfo description"""
+        """Update list according new mapDBInfo description"""
         if mapDBInfo:
             self.mapDBInfo = mapDBInfo
             self.LoadData(self.layer)
@@ -133,15 +134,15 @@ class VirtualAttributeList(wx.ListCtrl,
             self.LoadData(self.layer, **self.sqlFilter)
 
     def LoadData(self, layer, columns = None, where = None, sql = None):
-        """!Load data into list
+        """Load data into list
 
-        @param layer layer number
-        @param columns list of columns for output (-> v.db.select)
-        @param where where statement (-> v.db.select)
-        @param sql full sql statement (-> db.select)
+        :param layer: layer number
+        :param columns: list of columns for output (-> v.db.select)
+        :param where: where statement (-> v.db.select)
+        :param sql: full sql statement (-> db.select)
         
-        @return id of key column 
-        @return -1 if key column is not displayed
+        :return: id of key column 
+        :return: -1 if key column is not displayed
         """
         self.log.write(_("Loading data..."))
         
@@ -290,7 +291,7 @@ class VirtualAttributeList(wx.ListCtrl,
         return keyId
     
     def AddDataRow(self, i, record, columns, keyId):
-        """!Add row to the data list"""
+        """Add row to the data list"""
         self.itemDataMap[i] = []
         keyColumn = self.mapDBInfo.layers[self.layer]['key']
         j = 0
@@ -336,7 +337,7 @@ class VirtualAttributeList(wx.ListCtrl,
             self.itemCatsMap[i] = cat
         
     def OnItemSelected(self, event):
-        """!Item selected. Add item to selected cats..."""
+        """Item selected. Add item to selected cats..."""
         #         cat = int(self.GetItemText(event.m_itemIndex))
         #         if cat not in self.selectedCats:
         #             self.selectedCats.append(cat)
@@ -345,7 +346,7 @@ class VirtualAttributeList(wx.ListCtrl,
         event.Skip()
 
     def OnItemDeselected(self, event):
-        """!Item deselected. Remove item from selected cats..."""
+        """Item deselected. Remove item from selected cats..."""
         #         cat = int(self.GetItemText(event.m_itemIndex))
         #         if cat in self.selectedCats:
         #             self.selectedCats.remove(cat)
@@ -354,7 +355,7 @@ class VirtualAttributeList(wx.ListCtrl,
         event.Skip()
 
     def GetSelectedItems(self):
-        """!Return list of selected items (category numbers)"""
+        """Return list of selected items (category numbers)"""
         cats = []
         item = self.GetFirstSelected()
         while item != -1:
@@ -364,7 +365,7 @@ class VirtualAttributeList(wx.ListCtrl,
         return cats
 
     def GetItems(self):
-        """!Return list of items (category numbers)"""
+        """Return list of items (category numbers)"""
         cats = []
         for item in range(self.GetItemCount()):
             cats.append(self.GetItemText(item))
@@ -372,29 +373,29 @@ class VirtualAttributeList(wx.ListCtrl,
         return cats
 
     def GetColumnText(self, index, col):
-        """!Return column text"""
+        """Return column text"""
         item = self.GetItem(index, col)
         return item.GetText()
 
     def GetListCtrl(self):
-        """!Returt list"""
+        """Returt list"""
         return self
 
     def OnGetItemText(self, item, col):
-        """!Get item text"""
+        """Get item text"""
         index = self.itemIndexMap[item]
         s = self.itemDataMap[index][col]
         return s
 
     def OnGetItemAttr(self, item):
-        """!Get item attributes"""
+        """Get item attributes"""
         if ( item % 2) == 0:
             return self.attr2
         else:
             return self.attr1
 
     def OnColumnMenu(self, event):
-        """!Column heading right mouse button -> pop-up menu"""
+        """Column heading right mouse button -> pop-up menu"""
         self._col = event.GetColumn()
         
         popupMenu = wx.Menu()
@@ -465,7 +466,7 @@ class VirtualAttributeList(wx.ListCtrl,
         popupMenu.Destroy()
 
     def OnColumnSort(self, event):
-        """!Column heading left mouse button -> sorting"""
+        """Column heading left mouse button -> sorting"""
         self._col = event.GetColumn()
         
         self.ColumnSort()
@@ -473,17 +474,17 @@ class VirtualAttributeList(wx.ListCtrl,
         event.Skip()
 
     def OnColumnSortAsc(self, event):
-        """!Sort values of selected column (ascending)"""
+        """Sort values of selected column (ascending)"""
         self.SortListItems(col = self._col, ascending = True)
         event.Skip()
 
     def OnColumnSortDesc(self, event):
-        """!Sort values of selected column (descending)"""
+        """Sort values of selected column (descending)"""
         self.SortListItems(col = self._col, ascending = False)
         event.Skip()
         
     def OnColumnCompute(self, event):
-        """!Compute values of selected column"""
+        """Compute values of selected column"""
         id = event.GetId()
         
         option = None
@@ -519,7 +520,7 @@ class VirtualAttributeList(wx.ListCtrl,
         self.LoadData(self.layer)
         
     def ColumnSort(self):
-        """!Sort values of selected column (self._col)"""
+        """Sort values of selected column (self._col)"""
         # remove duplicated arrow symbol from column header
         # FIXME: should be done automatically
         info = wx.ListItem()
@@ -530,7 +531,7 @@ class VirtualAttributeList(wx.ListCtrl,
             self.SetColumn(column, info)
         
     def OnFieldCalculator(self, event):
-        """!Calls SQLBuilderUpdate instance"""
+        """Calls SQLBuilderUpdate instance"""
         if not self.fieldCalc:
             self.fieldCalc = SQLBuilderUpdate(parent = self, id = wx.ID_ANY,
                                               vectmap = self.dbMgrData['vectName'],
@@ -555,7 +556,7 @@ class VirtualAttributeList(wx.ListCtrl,
                                column = self.GetColumn(self._col).GetText())
 
     def OnAddColumn(self, event):
-        """!Add column into table"""
+        """Add column into table"""
         table = self.dbMgrData['mapDBInfo'].layers[self.layer]['table']
         dlg = AddColumnDialog(parent = self, title = _('Add column to table <%s>') % table)
         if not dlg:
@@ -568,7 +569,7 @@ class VirtualAttributeList(wx.ListCtrl,
         dlg.Destroy()
 
     def SortItems(self, sorter = cmp):
-        """!Sort items"""
+        """Sort items"""
         items = list(self.itemDataMap.keys())
         items.sort(self.Sorter)
         self.itemIndexMap = items
@@ -602,11 +603,11 @@ class VirtualAttributeList(wx.ListCtrl,
             return -cmpVal
 
     def GetSortImages(self):
-        """!Used by the ColumnSorterMixin, see wx/lib/mixins/listctrl.py"""
+        """Used by the ColumnSorterMixin, see wx/lib/mixins/listctrl.py"""
         return (self.sm_dn, self.sm_up)
 
     def IsEmpty(self):
-        """!Check if list if empty"""
+        """Check if list if empty"""
         if self.columns:
             return False
         
@@ -617,15 +618,15 @@ class DbMgrBase:
                  vectorName = None, item = None, giface = None,
                  statusbar = None, 
                  **kwargs):
-        """!Base class, which enables usage of separate pages of Attribute Table Manager 
-
-        @param id window id
-        @param mapdisplay MapFrame instance
-        @param vetorName name of vector map
-        @param item item from Layer Tree
-        @param log log window
-        @param statusbar widget with statusbar 
-        @param kwagrs other wx.Frame's arguments
+        """Base class, which enables usage of separate pages of Attribute Table Manager 
+
+        :param id: window id
+        :param mapdisplay: MapFrame instance
+        :param vectorName: name of vector map
+        :param item: item from Layer Tree
+        :param log: log window
+        :param statusbar: widget with statusbar 
+        :param kwagrs: other wx.Frame's arguments
         """
 
         # stores all data, which are shared by pages
@@ -674,7 +675,7 @@ class DbMgrBase:
                      }
 
     def ChangeVectorMap(self, vectorName):
-        """!Change of vector map
+        """Change of vector map
 
         Does not import layers of new vector map into pages.
         For the import use methods addLayer in DbMgrBrowsePage and DbMgrTablesPage
@@ -702,13 +703,15 @@ class DbMgrBase:
             self.pages['manageLayer'].UpdatePage()       
 
     def CreateDbMgrPage(self, parent, pageName, onlyLayer = -1):
-        """!Creates chosen page
-
-        @param pageName can be 'browse' or 'manageTable' or 'manageLayer' which corresponds with pages in 
-                        Attribute Table Manager
-        @return created instance of page - if the page has been already created returns the previously created instance
-        @return None  if wrong identifier was passed
-        """         
+        """Creates chosen page
+
+        :param pageName: can be 'browse' or 'manageTable' or
+                         'manageLayer' which corresponds with pages in
+                         Attribute Table Manager
+        :return: created instance of page, if the page has been already
+                 created returns the previously created instance
+        :return: None  if wrong identifier was passed
+        """       
         if pageName == 'browse':
             if not self.pages['browse']:
                 self.pages[pageName] = DbMgrBrowsePage(parent = parent, parentDbMgrBase = self,
@@ -726,7 +729,7 @@ class DbMgrBase:
         return None
 
     def UpdateDialog(self, layer):
-        """!Updates dialog layout for given layer"""
+        """Updates dialog layout for given layer"""
         # delete page
         if layer in self.dbMgrData['mapDBInfo'].layers.keys():
             # delete page
@@ -758,19 +761,19 @@ class DbMgrBase:
             self.pages['manageLayer'].UpdatePage()
     
     def GetVectorName(self):
-        """!Get vector name"""
+        """Get vector name"""
         return self.dbMgrData['vectName']
 
     def GetVectorLayers(self):
-        """!Get layers of vector map which have table"""
+        """Get layers of vector map which have table"""
         return self.dbMgrData['mapDBInfo'].layers.keys()
 
 class DbMgrNotebookBase(FN.FlatNotebook):
     def __init__(self, parent, parentDbMgrBase):
-        """!Base class for notebook with attribute tables in tabs
+        """Base class for notebook with attribute tables in tabs
 
-        @param parent GUI parent
-        @param parentDbMgrBase instance of DbMgrBase class
+        :param parent: GUI parent
+        :param parentDbMgrBase: instance of DbMgrBase class
         """
 
         self.parent = parent
@@ -813,7 +816,7 @@ class DbMgrNotebookBase(FN.FlatNotebook):
         self.Bind(FN.EVT_FLATNOTEBOOK_PAGE_CHANGED, self.OnLayerPageChanged)
 
     def OnLayerPageChanged(self, event):
-        """!Layer tab changed"""
+        """Layer tab changed"""
 
         # because of SQL Query notebook  
         if event.GetEventObject() != self:
@@ -840,9 +843,10 @@ class DbMgrNotebookBase(FN.FlatNotebook):
             self.dbMgrData['mapDBInfo'].GetColumns(table)
 
     def ApplyCommands(self, listOfCommands, listOfSQLStatements):
-        """!Apply changes
+        """Apply changes
 
-        @todo: this part should be _completely_ redesigned
+        .. todo::
+            this part should be _completely_ redesigned
         """
         # perform GRASS commands (e.g. v.db.addcolumn)
         wx.BeginBusyCursor()
@@ -898,7 +902,7 @@ class DbMgrNotebookBase(FN.FlatNotebook):
         wx.EndBusyCursor()        
 
     def DeletePage(self, layer):
-        """!Removes layer page"""
+        """Removes layer page"""
         if layer not in self.layers:
             return False
 
@@ -915,14 +919,14 @@ class DbMgrNotebookBase(FN.FlatNotebook):
         return True
 
     def DeleteAllPages(self):
-        """!Removes all layer pages"""
+        """Removes all layer pages"""
         FN.FlatNotebook.DeleteAllPages(self)
         self.layerPage = {}
         self.layers = []
         self.selLayer = None
 
     def AddColumn(self, name, ctype, length):
-        """!Add new column to the table"""
+        """Add new column to the table"""
         table = self.dbMgrData['mapDBInfo'].layers[self.selLayer]['table']
         
         if not name:
@@ -959,16 +963,17 @@ class DbMgrNotebookBase(FN.FlatNotebook):
         return True
 
     def GetAddedLayers(self):
-        """!Get list of added layers"""
+        """Get list of added layers"""
         return self.layers[:]
 
 class DbMgrBrowsePage(DbMgrNotebookBase):
     def __init__(self, parent, parentDbMgrBase, onlyLayer = -1):
-        """!Browse page class
+        """Browse page class
 
-        @param parent GUI parent
-        @param parentDbMgrBase instance of DbMgrBase class
-        @param onlyLayer create only tab of given layer, if -1 creates tabs of all layers 
+        :param parent: GUI parent
+        :param parentDbMgrBase: instance of DbMgrBase class
+        :param onlyLayer: create only tab of given layer, if -1 creates
+                          tabs of all layers 
         """
 
         DbMgrNotebookBase.__init__(self, parent = parent, 
@@ -995,13 +1000,14 @@ class DbMgrBrowsePage(DbMgrNotebookBase):
         self.builder = None
 
     def AddLayer(self, layer, pos = -1):
-        """!Adds tab which represents table and enables browse it
+        """Adds tab which represents table and enables browse it
 
-        @param layer vector map layer conntected to table
-        @param pos position of tab, if -1 it is added to end
+        :param layer: vector map layer conntected to table
+        :param pos: position of tab, if -1 it is added to end
 
-        @return True if layer was added 
-        @return False if layer was not added - layer has been already added or has empty table or does not exist 
+        :return: True if layer was added 
+        :return: False if layer was not added - layer has been already
+                 added or has empty table or does not exist 
         """
         if layer in self.layers or \
             layer not in self.parentDbMgrBase.GetVectorLayers():
@@ -1180,11 +1186,11 @@ class DbMgrBrowsePage(DbMgrNotebookBase):
         return True
 
     def OnSqlQuerySizeWrap(self, layer):
-        """!Helper function"""
+        """Helper function"""
         return lambda event : self.OnSqlQuerySize(event, layer)  
 
     def OnSqlQuerySize(self, event, layer):
-        """!Adapts SQL Query Simple tab on current width"""
+        """Adapts SQL Query Simple tab on current width"""
 
         sqlNtb = event.GetEventObject()
         if not self.sqlBestSize:
@@ -1217,13 +1223,13 @@ class DbMgrBrowsePage(DbMgrNotebookBase):
         event.Skip()
 
     def OnDataItemActivated(self, event):
-        """!Item activated, highlight selected item"""
+        """Item activated, highlight selected item"""
         self.OnDataDrawSelected(event)
 
         event.Skip()
 
     def OnDataRightUp(self, event):
-        """!Table description area, context menu"""
+        """Table description area, context menu"""
         if not hasattr(self, "popupDataID1"):
             self.popupDataID1 = wx.NewId()
             self.popupDataID2 = wx.NewId()
@@ -1291,7 +1297,7 @@ class DbMgrBrowsePage(DbMgrNotebookBase):
                            tlist.GetItemCount())
 
     def OnDataItemEdit(self, event):
-        """!Edit selected record of the attribute table"""
+        """Edit selected record of the attribute table"""
         tlist      = self.FindWindowById(self.layerPage[self.selLayer]['data'])
         item      = tlist.GetFirstSelected()
         if item == -1:
@@ -1388,7 +1394,7 @@ class DbMgrBrowsePage(DbMgrNotebookBase):
             tlist.Update()
         
     def OnDataItemAdd(self, event):
-        """!Add new record to the attribute table"""
+        """Add new record to the attribute table"""
         tlist      = self.FindWindowById(self.layerPage[self.selLayer]['data'])
         table     = self.dbMgrData['mapDBInfo'].layers[self.selLayer]['table']
         keyColumn = self.dbMgrData['mapDBInfo'].layers[self.selLayer]['key']
@@ -1505,7 +1511,7 @@ class DbMgrBrowsePage(DbMgrNotebookBase):
 
         
     def OnDataItemDelete(self, event):
-        """!Delete selected item(s) from the tlist (layer/category pair)"""
+        """Delete selected item(s) from the tlist (layer/category pair)"""
         dlist = self.FindWindowById(self.layerPage[self.selLayer]['data'])
         item = dlist.GetFirstSelected()
         
@@ -1569,7 +1575,7 @@ class DbMgrBrowsePage(DbMgrNotebookBase):
         return True
 
     def OnDataItemDeleteAll(self, event):
-        """!Delete all items from the list"""
+        """Delete all items from the list"""
         dlist = self.FindWindowById(self.layerPage[self.selLayer]['data'])
         if UserSettings.Get(group = 'atm', key = 'askOnDeleteRec', subkey = 'enabled'):
             deleteDialog = wx.MessageBox(parent = self,
@@ -1594,7 +1600,7 @@ class DbMgrBrowsePage(DbMgrNotebookBase):
         event.Skip()
 
     def _drawSelected(self, zoom, selectedOnly=True):
-        """!Highlight selected features"""
+        """Highlight selected features"""
         if not self.map or not self.mapdisplay:
             return
         
@@ -1675,9 +1681,9 @@ class DbMgrBrowsePage(DbMgrNotebookBase):
             self.mapdisplay.MapWindow.UpdateMap(render = False, renderVector = True)
         
     def AddQueryMapLayer(self, selectedOnly = True):
-        """!Redraw a map
+        """Redraw a map
 
-        Return True if map has been redrawn, False if no map is given
+        :return: True if map has been redrawn, False if no map is given
         """
         tlist = self.FindWindowById(self.layerPage[self.selLayer]['data'])
         if selectedOnly:
@@ -1698,12 +1704,12 @@ class DbMgrBrowsePage(DbMgrNotebookBase):
         return self.qlayer
 
     def OnDataReload(self, event):
-        """!Reload tlist of records"""
+        """Reload tlist of records"""
         self.OnApplySqlStatement(None)
         self.listOfSQLStatements = []
 
     def OnDataSelectAll(self, event):
-        """!Select all items"""
+        """Select all items"""
         tlist = self.FindWindowById(self.layerPage[self.selLayer]['data'])
         item = -1
 
@@ -1716,7 +1722,7 @@ class DbMgrBrowsePage(DbMgrNotebookBase):
         event.Skip()
 
     def OnDataSelectNone(self, event):
-        """!Deselect items"""
+        """Deselect items"""
         tlist = self.FindWindowById(self.layerPage[self.selLayer]['data'])
         item = -1
 
@@ -1730,7 +1736,7 @@ class DbMgrBrowsePage(DbMgrNotebookBase):
 
 
     def OnDataDrawSelected(self, event):
-        """!Reload table description"""
+        """Reload table description"""
         self._drawSelected(zoom = False)
         event.Skip()
 
@@ -1739,7 +1745,7 @@ class DbMgrBrowsePage(DbMgrNotebookBase):
         event.Skip()
  
     def OnExtractSelected(self, event):
-        """!Extract vector objects selected in attribute browse window
+        """Extract vector objects selected in attribute browse window
         to new vector map
         """
         tlist = self.FindWindowById(self.layerPage[self.selLayer]['data'])
@@ -1773,7 +1779,7 @@ class DbMgrBrowsePage(DbMgrNotebookBase):
             dlg.Destroy()
             
     def OnDeleteSelected(self, event):
-        """!Delete vector objects selected in attribute browse window
+        """Delete vector objects selected in attribute browse window
         (attribures and geometry)
         """
         tlist = self.FindWindowById(self.layerPage[self.selLayer]['data'])
@@ -1809,7 +1815,7 @@ class DbMgrBrowsePage(DbMgrNotebookBase):
             self.mapdisplay.MapWindow.UpdateMap(render = True, renderVector = True)
      
     def OnApplySqlStatement(self, event):
-        """!Apply simple/advanced sql statement"""
+        """Apply simple/advanced sql statement"""
         keyColumn = -1 # index of key column
         listWin = self.FindWindowById(self.layerPage[self.selLayer]['data'])
         sql = None
@@ -1886,7 +1892,7 @@ class DbMgrBrowsePage(DbMgrNotebookBase):
                 self.mapdisplay.MapWindow.UpdateMap(render=False) # TODO: replace by signals
 
     def OnBuilder(self,event):
-        """!SQL Builder button pressed -> show the SQLBuilder dialog"""
+        """SQL Builder button pressed -> show the SQLBuilder dialog"""
         if not self.builder:
             self.builder = SQLBuilderSelect(parent = self, id = wx.ID_ANY, 
                                             vectmap = self.dbMgrData['vectName'],
@@ -1910,10 +1916,10 @@ class DbMgrBrowsePage(DbMgrNotebookBase):
             self.builder = None
 
     def ValidateSelectStatement(self, statement):
-        """!Validate SQL select statement
+        """Validate SQL select statement
 
-        @return (columns, where)
-        @return None on error
+        :return: (columns, where)
+        :return: None on error
         """
         if statement[0:7].lower() != 'select ':
             return None
@@ -1949,15 +1955,15 @@ class DbMgrBrowsePage(DbMgrNotebookBase):
         return (cols, where)
 
     def LoadData(self, layer, columns = None, where = None, sql = None):
-        """!Load data into list
+        """Load data into list
 
-        @param layer layer number
-        @param columns list of columns for output
-        @param where where statement
-        @param sql full sql statement
+        :param int layer: layer number
+        :param list columns: list of columns for output
+        :param str where: where statement
+        :param str sql: full sql statement
 
-        @return id of key column 
-        @return -1 if key column is not displayed
+        :return: id of key column 
+        :return: -1 if key column is not displayed
         """
         listWin = self.FindWindowById(self.layerPage[layer]['data'])
         return listWin.LoadData(layer, columns, where, sql)
@@ -1970,11 +1976,12 @@ class DbMgrBrowsePage(DbMgrNotebookBase):
 
 class DbMgrTablesPage(DbMgrNotebookBase):   
     def __init__(self, parent, parentDbMgrBase, onlyLayer = -1):
-        """!Page for managing tables
+        """Page for managing tables
 
-        @param parent GUI parent
-        @param parentDbMgrBase instance of DbMgrBase class
-        @param onlyLayer create only tab of given layer, if -1 creates tabs of all layers 
+        :param parent: GUI parent
+        :param parentDbMgrBase: instance of DbMgrBase class
+        :param onlyLayer: create only tab of given layer, if -1
+                          creates tabs of all layers 
         """
 
         DbMgrNotebookBase.__init__(self, parent = parent,
@@ -1990,13 +1997,13 @@ class DbMgrTablesPage(DbMgrNotebookBase):
             self.selLayer = self.layers[0]
 
     def AddLayer(self, layer, pos = -1):
-        """!Adds tab which represents table 
+        """Adds tab which represents table 
 
-        @param layer vector map layer connected to table
-        @param pos position of tab, if -1 it is added to end
+        :param layer: vector map layer connected to table
+        :param pos: position of tab, if -1 it is added to end
 
-        @return True if layer was added 
-        @return False if layer was not added - layer has been already added or does not exist 
+        :return: True if layer was added 
+        :return: False if layer was not added - layer has been already added or does not exist 
         """
         if layer in self.layers or \
             layer not in self.parentDbMgrBase.GetVectorLayers():
@@ -2165,7 +2172,7 @@ class DbMgrTablesPage(DbMgrNotebookBase):
         return True
 
     def _createTableDesc(self, parent, table):
-        """!Create list with table description"""
+        """Create list with table description"""
         tlist = TableListCtrl(parent = parent, id = wx.ID_ANY,
                              table = self.dbMgrData['mapDBInfo'].tables[table],
                              columns = self.dbMgrData['mapDBInfo'].GetColumns(table))
@@ -2177,7 +2184,7 @@ class DbMgrTablesPage(DbMgrNotebookBase):
         return tlist
 
     def OnTableChangeType(self, event):
-        """!Data type for new column changed. Enable or disable
+        """Data type for new column changed. Enable or disable
         data length widget"""
         win = self.FindWindowById(self.layerPage[self.selLayer]['addColLength'])
         if event.GetString() == "varchar":
@@ -2186,7 +2193,7 @@ class DbMgrTablesPage(DbMgrNotebookBase):
             win.Enable(False)
 
     def OnTableRenameColumnName(self, event):
-        """!Editing column name to be added to the table"""
+        """Editing column name to be added to the table"""
         btn  = self.FindWindowById(self.layerPage[self.selLayer]['renameColButton'])
         col  = self.FindWindowById(self.layerPage[self.selLayer]['renameCol'])
         colTo = self.FindWindowById(self.layerPage[self.selLayer]['renameColTo'])
@@ -2198,7 +2205,7 @@ class DbMgrTablesPage(DbMgrNotebookBase):
         event.Skip()
 
     def OnTableAddColumnName(self, event):
-        """!Editing column name to be added to the table"""
+        """Editing column name to be added to the table"""
         btn = self.FindWindowById(self.layerPage[self.selLayer]['addColButton'])
         if len(event.GetString()) > 0:
             btn.Enable(True)
@@ -2208,7 +2215,7 @@ class DbMgrTablesPage(DbMgrNotebookBase):
         event.Skip()
 
     def OnTableItemChange(self, event):
-        """!Rename column in the table"""
+        """Rename column in the table"""
         tlist   = self.FindWindowById(self.layerPage[self.selLayer]['tableData'])
         name   = self.FindWindowById(self.layerPage[self.selLayer]['renameCol']).GetValue()
         nameTo = self.FindWindowById(self.layerPage[self.selLayer]['renameColTo']).GetValue()
@@ -2257,7 +2264,7 @@ class DbMgrTablesPage(DbMgrNotebookBase):
         event.Skip()
 
     def OnTableRightUp(self, event):
-        """!Table description area, context menu"""
+        """Table description area, context menu"""
         if not hasattr(self, "popupTableID"):
             self.popupTableID1 = wx.NewId()
             self.popupTableID2 = wx.NewId()
@@ -2283,7 +2290,7 @@ class DbMgrTablesPage(DbMgrNotebookBase):
         menu.Destroy()
 
     def OnTableItemDelete(self, event):
-        """!Delete selected item(s) from the list"""
+        """Delete selected item(s) from the list"""
         tlist = self.FindWindowById(self.layerPage[self.selLayer]['tableData'])
         
         item = tlist.GetFirstSelected()
@@ -2328,7 +2335,7 @@ class DbMgrTablesPage(DbMgrNotebookBase):
         event.Skip()
 
     def OnTableItemDeleteAll(self, event):
-        """!Delete all items from the list"""
+        """Delete all items from the list"""
         table     = self.dbMgrData['mapDBInfo'].layers[self.selLayer]['table']
         cols      = self.dbMgrData['mapDBInfo'].GetColumns(table)
         keyColumn = self.dbMgrData['mapDBInfo'].layers[self.selLayer]['key']
@@ -2364,12 +2371,12 @@ class DbMgrTablesPage(DbMgrNotebookBase):
         event.Skip()
 
     def OnTableReload(self, event = None):
-        """!Reload table description"""
+        """Reload table description"""
         self.FindWindowById(self.layerPage[self.selLayer]['tableData']).Populate(update = True)
         self.listOfCommands = []
 
     def OnTableItemAdd(self, event):
-        """!Add new column to the table"""
+        """Add new column to the table"""
         name = self.FindWindowById(self.layerPage[self.selLayer]['addColName']).GetValue()
                 
         ctype = self.FindWindowById(self.layerPage[self.selLayer]['addColType']). \
@@ -2410,7 +2417,7 @@ class DbMgrTablesPage(DbMgrNotebookBase):
 
 class DbMgrLayersPage(wx.Panel):
     def __init__(self, parent, parentDbMgrBase):
-        """!Create layer manage page"""
+        """Create layer manage page"""
         self.parentDbMgrBase = parentDbMgrBase
         self.dbMgrData = self.parentDbMgrBase.dbMgrData
 
@@ -2472,7 +2479,7 @@ class DbMgrLayersPage(wx.Panel):
         self.SetSizer(panelSizer)
 
     def _createLayerDesc(self, parent):
-        """!Create list of linked layers"""
+        """Create list of linked layers"""
         tlist = LayerListCtrl(parent = parent, id = wx.ID_ANY,
                              layers = self.dbMgrData['mapDBInfo'].layers)
         
@@ -2515,13 +2522,13 @@ class DbMgrLayersPage(wx.Panel):
         self.manageLayerBook.OnChangeLayer(event = None)
 
     def OnLayerRightUp(self, event):
-        """!Layer description area, context menu"""
+        """Layer description area, context menu"""
         pass
 
 class TableListCtrl(wx.ListCtrl,
                     listmix.ListCtrlAutoWidthMixin):
     #                    listmix.TextEditMixin):
-    """!Table description list"""
+    """Table description list"""
 
     def __init__(self, parent, id, table, columns, pos = wx.DefaultPosition,
                  size = wx.DefaultSize):
@@ -2537,12 +2544,12 @@ class TableListCtrl(wx.ListCtrl,
         # listmix.TextEditMixin.__init__(self)
 
     def Update(self, table, columns):
-        """!Update column description"""
+        """Update column description"""
         self.table   = table
         self.columns = columns
 
     def Populate(self, update = False):
-        """!Populate the list"""
+        """Populate the list"""
         itemData = {} # requested by sorter
 
         if not update:
@@ -2576,7 +2583,7 @@ class LayerListCtrl(wx.ListCtrl,
                     listmix.ListCtrlAutoWidthMixin):
                     # listmix.ColumnSorterMixin):
                     # listmix.TextEditMixin):
-    """!Layer description list"""
+    """Layer description list"""
 
     def __init__(self, parent, id, layers,
                  pos = wx.DefaultPosition,
@@ -2592,11 +2599,11 @@ class LayerListCtrl(wx.ListCtrl,
         # listmix.TextEditMixin.__init__(self)
 
     def Update(self, layers):
-        """!Update description"""
+        """Update description"""
         self.layers = layers
 
     def Populate(self, update = False):
-        """!Populate the list"""
+        """Populate the list"""
         itemData = {} # requested by sorter
 
         if not update:
@@ -2638,7 +2645,7 @@ class LayerListCtrl(wx.ListCtrl,
         return itemData
 
 class LayerBook(wx.Notebook):
-    """!Manage layers (add, delete, modify)"""
+    """Manage layers (add, delete, modify)"""
     def __init__(self, parent, id,
                  parentDialog,
                  style = wx.BK_DEFAULT):
@@ -2694,7 +2701,7 @@ class LayerBook(wx.Notebook):
         self._createModifyPage()
 
     def _createAddPage(self):
-        """!Add new layer"""
+        """Add new layer"""
         self.addPanel = wx.Panel(parent = self, id = wx.ID_ANY)
         self.AddPage(page = self.addPanel, text = _("Add layer"))
         
@@ -2888,7 +2895,7 @@ class LayerBook(wx.Notebook):
         pageSizer.Fit(self.addPanel)
         
     def _createDeletePage(self):
-        """!Delete layer"""
+        """Delete layer"""
         self.deletePanel = wx.Panel(parent = self, id = wx.ID_ANY)
         self.AddPage(page = self.deletePanel, text = _("Remove layer"))
 
@@ -2955,7 +2962,7 @@ class LayerBook(wx.Notebook):
         self.deletePanel.SetSizer(pageSizer)
 
     def _createModifyPage(self):
-        """!Modify layer"""
+        """Modify layer"""
         self.modifyPanel = wx.Panel(parent = self, id = wx.ID_ANY)
         self.AddPage(page = self.modifyPanel, text = _("Modify layer"))
 
@@ -3065,7 +3072,7 @@ class LayerBook(wx.Notebook):
         self.modifyPanel.SetSizer(pageSizer)
 
     def _getTables(self, driver, database):
-        """!Get list of tables for given driver and database"""
+        """Get list of tables for given driver and database"""
         tables = []
 
         ret = RunCommand('db.tables',
@@ -3088,7 +3095,7 @@ class LayerBook(wx.Notebook):
         return tables
 
     def _getColumns(self, driver, database, table):
-        """!Get list of column of given table"""
+        """Get list of column of given table"""
         columns = []
 
         ret = RunCommand('db.columns',
@@ -3108,7 +3115,7 @@ class LayerBook(wx.Notebook):
         return columns
 
     def OnDriverChanged(self, event):
-        """!Driver selection changed, update list of tables"""
+        """Driver selection changed, update list of tables"""
         driver = event.GetString()
         database = self.addLayerWidgets['database'][1].GetValue()
 
@@ -3125,11 +3132,11 @@ class LayerBook(wx.Notebook):
         event.Skip()
 
     def OnDatabaseChanged(self, event):
-        """!Database selection changed, update list of tables"""
+        """Database selection changed, update list of tables"""
         event.Skip()
 
     def OnTableChanged(self, event):
-        """!Table name changed, update list of columns"""
+        """Table name changed, update list of columns"""
         driver   = self.addLayerWidgets['driver'][1].GetStringSelection()
         database = self.addLayerWidgets['database'][1].GetValue()
         table    = event.GetString()
@@ -3142,7 +3149,7 @@ class LayerBook(wx.Notebook):
         event.Skip()
 
     def OnSetDefault(self, event):
-        """!Set default values"""
+        """Set default values"""
         driver   = self.addLayerWidgets['driver'][1]
         database = self.addLayerWidgets['database'][1]
         table    = self.addLayerWidgets['table'][1]
@@ -3166,7 +3173,7 @@ class LayerBook(wx.Notebook):
         event.Skip()
 
     def OnCreateTable(self, event):
-        """!Create new table (name and key column given)"""
+        """Create new table (name and key column given)"""
         driver   = self.addLayerWidgets['driver'][1].GetStringSelection()
         database = self.addLayerWidgets['database'][1].GetValue()
         table    = self.tableWidgets['table'][1].GetValue()
@@ -3208,7 +3215,7 @@ class LayerBook(wx.Notebook):
         event.Skip()
 
     def OnAddLayer(self, event):
-        """!Add new layer to vector map"""
+        """Add new layer to vector map"""
         layer    = int(self.addLayerWidgets['layer'][1].GetValue())
         layerWin = self.addLayerWidgets['layer'][1]
         driver   = self.addLayerWidgets['driver'][1].GetStringSelection()
@@ -3261,7 +3268,7 @@ class LayerBook(wx.Notebook):
                 self.modifyLayerWidgets[label][1].Enable()
             
     def OnDeleteLayer(self, event):
-        """!Delete layer"""
+        """Delete layer"""
         try:
             layer = int(self.deleteLayer.GetValue())
         except:
@@ -3307,7 +3314,7 @@ class LayerBook(wx.Notebook):
         event.Skip()
 
     def OnChangeLayer(self, event):
-        """!Layer number of layer to be deleted is changed"""
+        """Layer number of layer to be deleted is changed"""
         try:
             layer = int(event.GetString())
         except:
@@ -3333,7 +3340,7 @@ class LayerBook(wx.Notebook):
             event.Skip()
 
     def OnModifyLayer(self, event):
-        """!Modify layer connection settings"""
+        """Modify layer connection settings"""
 
         layer = int(self.modifyLayerWidgets['layer'][1].GetStringSelection())
 

+ 42 - 42
gui/wxpython/dbmgr/dialogs.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package dbmgr.dialogs
 
 @brief DBM-related dialogs
@@ -37,21 +37,21 @@ class DisplayAttributesDialog(wx.Dialog):
                  style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER,
                  pos = wx.DefaultPosition,
                  action = "add", ignoreError = False):
-        """!Standard dialog used to add/update/display attributes linked
+        """Standard dialog used to add/update/display attributes linked
         to the vector map.
         
         Attribute data can be selected based on layer and category number
         or coordinates.
         
-        @param parent
-        @param map vector map
-        @param query query coordinates and distance (used for v.edit)
-        @param cats {layer: cats}
-        @param line feature id (requested for cats)
-        @param style
-        @param pos
-        @param action (add, update, display)
-        @param ignoreError True to ignore errors
+        :param parent:
+        :param map: vector map
+        :param query: query coordinates and distance (used for v.edit)
+        :param cats: {layer: cats}
+        :param line: feature id (requested for cats)
+        :param style:
+        :param pos:
+        :param action: (add, update, display)
+        :param ignoreError: True to ignore errors
         """
         self.parent = parent # mapdisplay.BufferedWindow
         self.map    = map
@@ -175,19 +175,19 @@ class DisplayAttributesDialog(wx.Dialog):
             ### self.mapDBInfo = None
         
     def OnSQLStatement(self, event):
-        """!Update SQL statement"""
+        """Update SQL statement"""
         pass
 
     def IsFound(self):
-        """!Check for status
+        """Check for status
 
-        @return True on attributes found
-        @return False attributes not found
+        :return: True on attributes found
+        :return: False attributes not found
         """
         return bool(self.mapDBInfo and self.notebook.GetPageCount() > 0)
     
     def GetSQLString(self, updateValues = False):
-        """!Create SQL statement string based on self.sqlStatement
+        """Create SQL statement string based on self.sqlStatement
 
         Show error message when invalid values are entered.
         
@@ -279,7 +279,7 @@ class DisplayAttributesDialog(wx.Dialog):
         return sqlCommands
 
     def OnReset(self, event = None):
-        """!Reset form"""
+        """Reset form"""
         for layer in self.mapDBInfo.layers.keys():
             table = self.mapDBInfo.layers[layer]["table"]
             key = self.mapDBInfo.layers[layer]["key"]
@@ -299,7 +299,7 @@ class DisplayAttributesDialog(wx.Dialog):
                         self.FindWindowById(id).SetValue(str(value))
 
     def OnClose(self, event):
-        """!Closes dialog and removes query layer.
+        """Closes dialog and removes query layer.
         """
         frame = self.parent.parent
         frame.dialogs['attributes'] = None
@@ -314,7 +314,7 @@ class DisplayAttributesDialog(wx.Dialog):
         self.Destroy()
 
     def OnSubmit(self, event):
-        """!Submit records"""
+        """Submit records"""
         layer = 1
         close = True
         enc = UserSettings.Get(group = 'atm', key = 'encoding', subkey = 'value')
@@ -350,9 +350,9 @@ class DisplayAttributesDialog(wx.Dialog):
         self.UpdateDialog(cats = self.cats, fid = self.fid)
         
     def GetCats(self):
-        """!Get id of selected vector object or 'None' if nothing selected
+        """Get id of selected vector object or 'None' if nothing selected
 
-        @param id if true return ids otherwise cats
+        :param id: if true return ids otherwise cats
         """
         if self.fid < 0:
             return None
@@ -360,21 +360,21 @@ class DisplayAttributesDialog(wx.Dialog):
         return self.cats[self.fid]
 
     def GetFid(self):
-        """!Get selected feature id"""
+        """Get selected feature id"""
         return self.fid
     
     def UpdateDialog(self, map = None, query = None, cats = None, fid = -1,
                      action = None):
-        """!Update dialog
+        """Update dialog
         
-        @param map name of vector map
-        @param query
-        @param cats
-        @param fid feature id
-        @param action add, update, display or None
+        :param map: name of vector map
+        :param query:
+        :param cats:
+        :param fid: feature id
+        :param action: add, update, display or None
         
-        @return True if updated
-        @return False
+        :return: True if updated
+        :return: False
         """
         if action:
             self.action = action
@@ -557,10 +557,10 @@ class DisplayAttributesDialog(wx.Dialog):
         return True
 
     def SetColumnValue(self, layer, column, value):
-        """!Set attrbute value
+        """Set attrbute value
 
-        @param column column name
-        @param value value
+        :param column: column name
+        :param value: value
         """
         table = self.mapDBInfo.GetTable(layer)
         columns = self.mapDBInfo.GetTableDesc(table)
@@ -573,11 +573,11 @@ class DisplayAttributesDialog(wx.Dialog):
 class ModifyTableRecord(wx.Dialog):
     def __init__(self, parent, title, data, keyEditable = (-1, True),
                  id = wx.ID_ANY, style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER):
-        """!Dialog for inserting/updating table record
+        """Dialog for inserting/updating table record
         
-        @param data a list: [(column, value)]
-        @param KeyEditable (id, editable?) indicates if textarea for key column
-        is editable(True) or not
+        :param data: a list: [(column, value)]
+        :param keyEditable: (id, editable?) indicates if textarea for
+                            key column is editable(True) or not
         """
         # parent -> VDigitWindow
         wx.Dialog.__init__(self, parent, id, title, style = style)
@@ -639,7 +639,7 @@ class ModifyTableRecord(wx.Dialog):
         self._layout()
         
     def _layout(self):
-        """!Do layout"""
+        """Do layout"""
         sizer = wx.BoxSizer(wx.VERTICAL)
         
         # data area
@@ -692,7 +692,7 @@ class ModifyTableRecord(wx.Dialog):
         self.Layout()
         
     def GetValues(self, columns = None):
-        """!Return list of values (casted to string).
+        """Return list of values (casted to string).
         
         If columns is given (list), return only values of given columns.
         """
@@ -712,7 +712,7 @@ class ModifyTableRecord(wx.Dialog):
 class AddColumnDialog(wx.Dialog):
     def __init__(self, parent, title, id = wx.ID_ANY,
                  style = wx.DEFAULT_DIALOG_STYLE  | wx.RESIZE_BORDER):
-        """!Dialog for adding column into table
+        """Dialog for adding column into table
         """
         wx.Dialog.__init__(self, parent, id, title, style = style)
         
@@ -786,7 +786,7 @@ class AddColumnDialog(wx.Dialog):
         self.Fit()
 
     def GetData(self):
-        """!Get inserted data from dialog's widgets"""
+        """Get inserted data from dialog's widgets"""
         values = {}
         values['name'] = self.data['addColName'].GetValue()
         values['ctype'] = self.data['addColType'].GetStringSelection()
@@ -795,7 +795,7 @@ class AddColumnDialog(wx.Dialog):
         return values
   
     def OnTableChangeType(self, event):
-        """!Data type for new column changed. Enable or disable
+        """Data type for new column changed. Enable or disable
         data length widget"""
         if event.GetString() == "varchar":
             self.data['addColLength'].Enable(True)

+ 15 - 15
gui/wxpython/dbmgr/manager.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package dbmgr.manager
 
 @brief GRASS Attribute Table Manager
@@ -41,16 +41,16 @@ class AttributeManager(wx.Frame, DbMgrBase):
     def __init__(self, parent, id = wx.ID_ANY,
                  title = None, vectorName = None, item = None, log = None,
                  selection = None, **kwargs):
-        """!GRASS Attribute Table Manager window
-
-        @param parent parent window
-        @param id window id
-        @param title window title or None for default title
-        @param vetorName name of vector map
-        @param item item from Layer Tree
-        @param log log window
-        @param selection name of page to be selected
-        @param kwagrs other wx.Frame's arguments
+        """GRASS Attribute Table Manager window
+
+        :param parent: parent window
+        :param id: window id
+        :param title: window title or None for default title
+        :param vectorName: name of vector map
+        :param item: item from Layer Tree
+        :param log: log window
+        :param selection: name of page to be selected
+        :param kwagrs: other wx.Frame's arguments
         """
         self.parent = parent
         try:
@@ -136,7 +136,7 @@ class AttributeManager(wx.Frame, DbMgrBase):
         self.SetMinSize(self.GetSize())
     
     def _layout(self):
-        """!Do layout"""
+        """Do layout"""
         # frame body
         mainSizer = wx.BoxSizer(wx.VERTICAL)
 
@@ -156,7 +156,7 @@ class AttributeManager(wx.Frame, DbMgrBase):
         self.Layout()
   
     def OnCloseWindow(self, event):
-        """!Cancel button pressed"""
+        """Cancel button pressed"""
         if self.parent and self.parent.GetName() == 'LayerManager':
             # deregister ATM
             self.parent.dialogs['atm'].remove(self)
@@ -172,7 +172,7 @@ class AttributeManager(wx.Frame, DbMgrBase):
             self.pages['browse'].OnDataReload(event) # TODO replace by signal
         
     def OnPageChanged(self, event):
-        """!On page in ATM is changed"""
+        """On page in ATM is changed"""
         try:
             if self.pages["browse"]:
                 selPage = self.pages["browse"].selLayer
@@ -199,7 +199,7 @@ class AttributeManager(wx.Frame, DbMgrBase):
         pass
 
     def UpdateDialog(self, layer):
-        """!Updates dialog layout for given layer"""
+        """Updates dialog layout for given layer"""
         DbMgrBase.UpdateDialog(self, layer = layer)
         # set current page selection
         self.notebook.SetSelectionByName('layers') 

+ 25 - 25
gui/wxpython/dbmgr/sqlbuilder.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package dbmgr.sqlbuilder
 
 @brief GRASS SQL Select/Update Builder
@@ -39,7 +39,7 @@ from dbmgr.vinfo import CreateDbInfoDesc, VectorDBInfo, GetUnicodeValue
 import grass.script as grass
 
 class SQLBuilder(wx.Frame):
-    """!SQLBuider class
+    """SQLBuider class
     Base class for classes, which builds SQL statements.
     """
     def __init__(self, parent, title, vectmap, modeChoices, id = wx.ID_ANY,
@@ -75,7 +75,7 @@ class SQLBuilder(wx.Frame):
         self._doLayout(modeChoices)
 
     def _doLayout(self, modeChoices):
-        """!Do dialog layout"""
+        """Do dialog layout"""
         
         self.pagesizer = wx.BoxSizer(wx.VERTICAL)
 
@@ -284,7 +284,7 @@ class SQLBuilder(wx.Frame):
         self.CenterOnParent()
    
     def OnUniqueValues(self, event, justsample = False):
-        """!Get unique values"""
+        """Get unique values"""
         vals = []
         try:
             idx = self.list_columns.GetSelections()[0]
@@ -316,11 +316,11 @@ class SQLBuilder(wx.Frame):
             i += 1
         
     def OnSampleValues(self, event):
-        """!Get sample values"""
+        """Get sample values"""
         self.OnUniqueValues(None, True)
 
     def OnAddColumn(self, event):
-        """!Add column name to the query"""
+        """Add column name to the query"""
         idx = self.list_columns.GetSelections()
         for i in idx:
             column = self.list_columns.GetString(i)
@@ -331,7 +331,7 @@ class SQLBuilder(wx.Frame):
             self.btn_unique.Enable(True)
         
     def OnAddValue(self, event):
-        """!Add value"""
+        """Add value"""
         selection = self.list_values.GetSelections()
         if not selection:
             event.Skip()
@@ -367,7 +367,7 @@ class SQLBuilder(wx.Frame):
             self.list_values.SetSelection(found)
             
     def OnAddMark(self, event):
-        """!Add mark"""
+        """Add mark"""
         mark = None
         if self.btn_logicpanel and \
            self.btn_logicpanel.IsShown():
@@ -384,7 +384,7 @@ class SQLBuilder(wx.Frame):
         self._add(element = 'mark', value = mark)
 
     def GetSQLStatement(self):
-        """!Return SQL statement"""
+        """Return SQL statement"""
         return self.text_sql.GetValue().strip().replace("\n"," ")
         
     def OnClose(self, event):
@@ -392,7 +392,7 @@ class SQLBuilder(wx.Frame):
         event.Skip()
  
 class SQLBuilderSelect(SQLBuilder):
-    """!Class for building SELECT SQL statement"""
+    """Class for building SELECT SQL statement"""
     def __init__(self, parent, vectmap, id = wx.ID_ANY,
                  layer = 1, evtHandler = None):
 
@@ -410,7 +410,7 @@ class SQLBuilderSelect(SQLBuilder):
 
 
     def _doLayout(self, modeChoices):
-        """!Do dialog layout"""
+        """Do dialog layout"""
 
         SQLBuilder._doLayout(self, modeChoices)
 
@@ -440,11 +440,11 @@ class SQLBuilderSelect(SQLBuilder):
         event.Skip()
 
     def OnClear(self, event):
-        """!Clear button pressed"""
+        """Clear button pressed"""
         self.text_sql.SetValue("SELECT * FROM %s" % self.tablename)
 
     def OnMode(self, event):
-        """!Adjusts builder for chosen mode"""
+        """Adjusts builder for chosen mode"""
         if self.mode.GetSelection() == 0:
             self.valuespanel.Hide()
             self.btn_logicpanel.Hide()
@@ -461,7 +461,7 @@ class SQLBuilderSelect(SQLBuilder):
             self.btn_verify.Enable(False)
             
     def OnVerify(self, event):
-        """!Verify button pressed"""
+        """Verify button pressed"""
         ret, msg = RunCommand('db.select',
                               getErrorMsg = True,
                               table = self.tablename,
@@ -478,9 +478,9 @@ class SQLBuilderSelect(SQLBuilder):
             self.statusbar.SetStatusText(_("SQL statement is valid"), 0)
 
     def _add(self, element, value):
-        """!Add element to the query
+        """Add element to the query
 
-        @param element element to add (column, value)
+        :param element: element to add (column, value)
         """
         sqlstr = self.text_sql.GetValue()
         curspos = self.text_sql.GetInsertionPoint()
@@ -524,18 +524,18 @@ class SQLBuilderSelect(SQLBuilder):
         self.text_sql.SetInsertionPoint(curspos)
 
     def CloseOnApply(self):
-        """!Return True if the dialog will be close on apply"""
+        """Return True if the dialog will be close on apply"""
         return self.close_onapply.IsChecked()
 
     def OnClose(self, event):
-        """!Close button pressed"""
+        """Close button pressed"""
         if self.evtHandler:
             self.evtHandler(event = 'close')
     
         SQLBuilder.OnClose(self, event)
 
 class SQLBuilderUpdate(SQLBuilder):
-    """!Class for building UPDATE SQL statement"""
+    """Class for building UPDATE SQL statement"""
     def __init__(self, parent, vectmap, id = wx.ID_ANY,
                  layer = 1, column = None):
 
@@ -557,7 +557,7 @@ class SQLBuilderUpdate(SQLBuilder):
             self.sqlApplied.connect(parent.Update)
 
     def _doLayout(self, modeChoices):
-        """!Do dialog layout"""
+        """Do dialog layout"""
 
         SQLBuilder._doLayout(self, modeChoices)
 
@@ -641,11 +641,11 @@ class SQLBuilderUpdate(SQLBuilder):
         self.sqlApplied.emit()
 
     def OnClear(self, event):
-        """!Clear button pressed"""
+        """Clear button pressed"""
         self.text_sql.SetValue(self.initText)
 
     def OnMode(self, event):
-        """!Adjusts builder for chosen mode"""
+        """Adjusts builder for chosen mode"""
         if self.mode.GetSelection() == 0:
             self.valuespanel.Hide()
             self.btn_logicpanel.Hide()
@@ -665,7 +665,7 @@ class SQLBuilderUpdate(SQLBuilder):
 
 
     def OnAddFunc(self, event):
-        """!Add function to the query"""
+        """Add function to the query"""
 
         if self.driver == 'dbf':
             GMessage(parent = self,
@@ -679,9 +679,9 @@ class SQLBuilderUpdate(SQLBuilder):
         
 
     def _add(self, element, value):
-        """!Add element to the query
+        """Add element to the query
 
-        @param element element to add (column, value)
+        :param element: element to add (column, value)
         """
         sqlstr = self.text_sql.GetValue()
         curspos = self.text_sql.GetInsertionPoint()

+ 8 - 8
gui/wxpython/dbmgr/vinfo.py

@@ -26,11 +26,11 @@ from core.utils import _
 import grass.script as grass
 
 def GetUnicodeValue(value):
-    """!Get unicode value
+    """Get unicode value
 
-    @param value value to be recoded
+    :param value: value to be recoded
 
-    @return unicode value
+    :return: unicode value
     """
     if type(value) == types.UnicodeType:
         return value
@@ -44,7 +44,7 @@ def GetUnicodeValue(value):
     return unicode(str(value), enc, errors = 'replace')
 
 def CreateDbInfoDesc(panel, mapDBInfo, layer):
-    """!Create database connection information content"""
+    """Create database connection information content"""
     infoFlexSizer = wx.FlexGridSizer (cols = 2, hgap = 1, vgap = 1)
     infoFlexSizer.AddGrowableCol(1)
     
@@ -68,13 +68,13 @@ def CreateDbInfoDesc(panel, mapDBInfo, layer):
     return infoFlexSizer
         
 class VectorDBInfo(VectorDBInfoBase):
-    """!Class providing information about attribute tables
+    """Class providing information about attribute tables
     linked to the vector map"""
     def __init__(self, map):
         VectorDBInfoBase.__init__(self, map)
         
     def GetColumns(self, table):
-        """!Return list of columns names (based on their index)"""
+        """Return list of columns names (based on their index)"""
         try:
             names = [''] * len(self.tables[table].keys())
         except KeyError:
@@ -86,7 +86,7 @@ class VectorDBInfo(VectorDBInfoBase):
         return names
 
     def SelectByPoint(self, queryCoords, qdist):
-        """!Get attributes by coordinates (all available layers)
+        """Get attributes by coordinates (all available layers)
 
         Return line id or None if no line is found"""
         line = None
@@ -130,7 +130,7 @@ class VectorDBInfo(VectorDBInfoBase):
         return ret
     
     def SelectFromTable(self, layer, cols = '*', where = None):
-        """!Select records from the table
+        """Select records from the table
 
         Return number of selected records, -1 on error
         """

+ 5 - 4
gui/wxpython/docs/wxGUI.html

@@ -650,14 +650,15 @@ wxGUI Tutorial</a>.
 
 <h2>AUTHORS</h2>
 
-Martin Landa, <a href="http://www.fbk.eu">FBK-irst</a> (2007-2008), Trento, Italy, and <a href="http://www.cvut.cz">Czech Technical University in Prague</a>, Czech Republic<br>
+Martin Landa, FBK-irst (2007-2008), Trento, Italy, and Czech Technical University in Prague, Czech Republic<br>
 Michael Barton, Arizona State University, USA<br>
 Daniel Calvelo Aros<br>
 Jachym Cepicky<br>
 Markus Metz, Germany<br>
-Anna Kratochvilova, <a href="http://www.cvut.cz">Czech Technical University in Prague</a>, Czech Republic<br>
-Vaclav Petras, <a href="http://www.cvut.cz">Czech Technical University in Prague</a>, Czech Republic<br>
-Stepan Turek, <a href="http://www.cvut.cz">Czech Technical University in Prague</a>, Czech Republic<br><br>
+Anna Kratochvilova, Czech Technical University in Prague, Czech Republic<br>
+Vaclav Petras, Czech Technical University in Prague, Czech Republic<br>
+Stepan Turek, Czech Technical University in Prague, Czech Republic<br>
+Tereza Fiedlerova, Czech Technical University in Prague, Czech Republic<br><br>
 
 Icons created by <a href="http://robert.szczepanek.pl">Robert Szczepanek</a>, Poland (<a href="https://svn.osgeo.org/osgeo/graphics/trunk/toolbar-icons/24x24/">SVN</a>)
 

+ 53 - 16
lib/python/pygrass/docs/Makefile

@@ -6,22 +6,37 @@ include $(MODULE_TOPDIR)/include/Make/Rules.make
 
 # You can set these variables from the command line.
 SPHINXOPTS    =
-ifneq (@(type sphinx-build2 > /dev/null),)
-SPHINXBUILD   = sphinx-build2
+
+APIDOC := $(shell which sphinx-apidoc2)
+ifdef APIDOC
+SPHINXAPIDOC = sphinx-apidoc2
+else
+APIDOC := $(shell which sphinx-apidoc)
+ifdef APIDOC
+SPHINXAPIDOC = sphinx-apidoc
+endif
+endif
+
+BUILD := $(shell which sphinx-build2)
+ifdef BUILD
+SPHINXBUILD = sphinx-build2
+else
+BUILD := $(shell which sphinx-build)
+ifdef BUILD
+SPHINXBUILD = sphinx-build
 endif
-ifneq (@(type sphinx-build > /dev/null),)
-SPHINXBUILD   = sphinx-build
 endif
+
 PAPER         =
 BUILDDIR      = _build
-BUILDDIR_HTML = $(HTMLDIR)/pygrass
+BUILDDIR_HTML = $(HTMLDIR)/wxgui
 
 MYGISBASE = $(GISBASE)
 
 # Internal variables.
 PAPEROPT_a4     = -D latex_paper_size=a4
 PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) -c . src/
 # the i18n builder cannot share the environment and doctrees with the others
 I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
 
@@ -29,7 +44,8 @@ I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
 
 .DEFAULT_GOAL := help
 
-help:
+
+wxguihelp:
 	@echo "Please use \`make <target>' where <target> is one of"
 	@echo "  html       to make standalone HTML files"
 	@echo "  dirhtml    to make HTML files named index.html in directories"
@@ -40,49 +56,70 @@ help:
 	@echo "  man        to make manual pages"
 	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
 
-clean:
+wxguiclean:
 	-rm -rf $(BUILDDIR)/*
+	-rm -rf src/a*.rst
+	-rm -rf src/c*.rst
+	-rm -rf src/d*.rst
+	-rm -rf src/g*.rst
+	-rm -rf src/ic*.rst
+	-rm -rf src/is*.rst
+	-rm -rf src/l*.rst
+	-rm -rf src/m*.rst
+	-rm -rf src/n*.rst
+	-rm -rf src/p*.rst
+	-rm -rf src/r*.rst
+	-rm -rf src/t*.rst
+	-rm -rf src/v*.rst
+	-rm -rf src/web_services.rst
+	-rm -rf src/wxgui.rst
+	-rm -rf src/wxplot.rst
 	-rm -f _templates/layout.html
 
-html:
+wxguiapidoc:
+	@echo $(SPHINXAPIDOC)
+	@echo $(SPHINXBUILD)
+	$(call run_grass,$(SPHINXAPIDOC) -T -f -o src/ ../../ ../../*/g.gui.*.py)
+
+wxguihtml:
 	$(call run_grass,$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR_HTML))
 	@echo
 	@echo "Build finished. The HTML pages are in $(BUILDDIR_HTML)"
 
-dirhtml:
+wxguidirhtml:
 	$(call run_grass,$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR_HTML))
 	@echo
 	@echo "Build finished. The HTML pages are in $(BUILDDIR_HTML)"
 
-singlehtml:
+wxguisinglehtml:
 	$(call run_grass,$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR_HTML))
 	@echo
 	@echo "Build finished. The HTML page is in $(BUILDDIR_HTML)"
 
-epub:
+wxguiepub:
 	$(call run_grass,$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub)
 	@echo
 	@echo "Build finished. The epub file is in $(BUILDDIR)/epub/"
 
-latex:
+wxguilatex:
 	$(call run_grass,$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex)
 	@echo
 	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
 	@echo "Run \`make' in that directory to run these through (pdf)latex" \
 	      "(use \`make latexpdf' here to do that automatically)."
 
-latexpdf:
+wxguilatexpdf:
 	$(call run_grass,$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex)
 	@echo "Running LaTeX files through pdflatex..."
 	$(MAKE) -C $(BUILDDIR)/latex all-pdf
 	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex/"
 
-man:
+wxguiman:
 	$(call run_grass,$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(MANDIR))
 	@echo
 	@echo "Build finished. The manual pages are in $(MANDIR)/"
 
-doctest:
+wxguidoctest:
 	$(call run_grass,$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest)
 	@echo "Testing of doctests in the sources finished, look at the " \
 	      "results in $(BUILDDIR)/doctest/output.txt."

lib/python/pygrass/docs/_static/pygrass.css → gui/wxpython/docs/wxgui_sphinx/_static/pygrass.css


+ 1 - 1
lib/python/pygrass/docs/_templates/layout.html.template

@@ -4,6 +4,6 @@
 {% endblock %}
 
 {% block header %}
-<img src="../grass_logo.png" alt="GRASS logo">
+<img src="../grass_logo.png" alt="GRASS GIS logo">
 <hr class="header">
 {% endblock %}

+ 9 - 0
gui/wxpython/docs/wxgui_sphinx/_templates/oholosidebar.html

@@ -0,0 +1,9 @@
+<p width="210px">
+<iframe src='http://www.ohloh.net/p/3666/widgets/project_factoids_stats.html' scrolling='no' marginHeight=0 marginWidth=0 style='height: 160px; width: 210px; border: none;'></iframe>
+</p>
+<p width="210px">
+<iframe src='http://www.ohloh.net/p/3666/widgets/project_languages.html' scrolling='no' marginHeight=0 marginWidth=0 style='height: 160px; width: 210px; border: none;'></iframe>
+</p>
+<p width="210px">
+<iframe src='http://www.ohloh.net/p/3666/widgets/project_cocomo.html' scrolling='no' marginHeight=0 marginWidth=0 style='height: 160px; width: 210px; border: none;'></iframe>
+</p>

+ 80 - 36
lib/python/pygrass/docs/conf.py

@@ -1,9 +1,10 @@
 # -*- coding: utf-8 -*-
 #
-# PyGRASS documentation build configuration file, created by
-# sphinx-quickstart2 on Sat Jun 16 18:53:32 2012.
+# wxGUI documentation build configuration file, created by
+# sphinx-quickstart on Tue Jun  3 09:20:51 2014.
 #
-# This file is execfile()d with the current directory set to its containing dir.
+# This file is execfile()d with the current directory set to its
+# containing dir.
 #
 # Note that not all possible configuration values are present in this
 # autogenerated file.
@@ -46,10 +47,20 @@ with open("_templates/layout.html", "a+b") as f:
 # If your documentation needs a minimal Sphinx version, state it here.
 #needs_sphinx = '1.0'
 
-# Add any Sphinx extension module names here, as strings. They can be extensions
-# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.mathjax', 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode']
-
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
+# ones.
+extensions = [
+    'sphinx.ext.autodoc',
+    'sphinx.ext.doctest',
+    'sphinx.ext.todo',
+    'sphinx.ext.coverage',
+    'sphinx.ext.mathjax',
+    'sphinx.ext.ifconfig',
+    'sphinx.ext.viewcode',
+    'sphinx.ext.graphviz',
+]
+todo_include_todos = True
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
 
@@ -63,17 +74,17 @@ source_suffix = '.rst'
 master_doc = 'index'
 
 # General information about the project.
-project = u'PyGRASS'
-copyright = u'2012-2014, Pietro Zambelli'
+project = u'wxGUI'
+copyright = u'2014, GRASS Development Team'
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
 # built documents.
 #
 # The short X.Y version.
-#version = '0.2'
+#version = '0.1'
 # The full version, including alpha/beta/rc tags.
-#release = 'beta'
+#release = '0.1'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
@@ -89,7 +100,8 @@ language = 'python'
 # directories to ignore when looking for source files.
 exclude_patterns = ['_build']
 
-# The reST default role (used for this markup: `text`) to use for all documents.
+# The reST default role (used for this markup: `text`) to use for all
+# documents.
 #default_role = None
 
 # If true, '()' will be appended to :func: etc. cross-reference text.
@@ -109,15 +121,11 @@ pygments_style = 'sphinx'
 # A list of ignored prefixes for module index sorting.
 #modindex_common_prefix = []
 
-# If true, doctest flags (comments looking like # doctest: FLAG, ...)
-# at the ends of lines and <BLANKLINE> markers are removed for all code blocks
-# showing interactive Python sessions (i.e. doctests). Default is true.
-trim_doctest_flags = True
+# If true, keep warnings as "system message" paragraphs in the built documents.
+#keep_warnings = False
 
 
-intersphinx_mapping = {'python': ('http://docs.python.org/2.7', None)}
-
-# -- Options for HTML output ---------------------------------------------------
+# -- Options for HTML output ----------------------------------------------
 
 # The theme to use for HTML and HTML Help pages.  See the documentation for
 # a list of builtin themes.
@@ -152,6 +160,11 @@ html_theme = 'traditional'
 # so a file named "default.css" will overwrite the builtin "default.css".
 html_static_path = ['_static']
 
+# Add any extra paths that contain custom files (such as robots.txt or
+# .htaccess) here, relative to this directory. These files are copied
+# directly to the root of the documentation.
+#html_extra_path = []
+
 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
 # using the given strftime format.
 #html_last_updated_fmt = '%b %d, %Y'
@@ -194,10 +207,10 @@ html_show_copyright = True
 #html_file_suffix = None
 
 # Output file base name for HTML help builder.
-htmlhelp_basename = 'PyGrassdoc'
+htmlhelp_basename = 'wxGUIdoc'
 
 
-# -- Options for LaTeX output --------------------------------------------------
+# -- Options for LaTeX output ---------------------------------------------
 
 latex_elements = {
 # The paper size ('letterpaper' or 'a4paper').
@@ -211,10 +224,11 @@ latex_elements = {
 }
 
 # Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title, author, documentclass [howto/manual]).
+# (source start file, target name, title,
+#  author, documentclass [howto, manual, or own class]).
 latex_documents = [
-  ('index', 'PyGrass.tex', u'PyGRASS Documentation',
-   u'Pietro Zambelli', 'manual'),
+  ('index', 'wxGUI.tex', u'wxGUI Documentation',
+   u'GRASS Development Team', 'manual'),
 ]
 
 # The name of an image file (relative to this directory) to place at the top of
@@ -238,27 +252,27 @@ latex_documents = [
 #latex_domain_indices = True
 
 
-# -- Options for manual page output --------------------------------------------
+# -- Options for manual page output ---------------------------------------
 
 # One entry per manual page. List of tuples
 # (source start file, name, description, authors, manual section).
 man_pages = [
-    ('index', 'pygrass', u'PyGRASS Documentation',
-     [u'Pietro Zambelli'], 1)
+    ('index', 'wxgui', u'wxGUI Documentation',
+     [u'GRASS Development Team'], 1)
 ]
 
 # If true, show URL addresses after external links.
 #man_show_urls = False
 
 
-# -- Options for Texinfo output ------------------------------------------------
+# -- Options for Texinfo output -------------------------------------------
 
 # Grouping the document tree into Texinfo files. List of tuples
 # (source start file, target name, title, author,
 #  dir menu entry, description, category)
 texinfo_documents = [
-  ('index', 'PyGRASS', u'PyGRASS Documentation',
-   u'Pietro Zambelli', 'PyGRASS', 'One line description of project.',
+  ('index', 'wxGUI', u'wxGUI Documentation',
+   u'GRASS Development Team', 'wxGUI', 'One line description of project.',
    'Miscellaneous'),
 ]
 
@@ -271,14 +285,26 @@ texinfo_documents = [
 # How to display URL addresses: 'footnote', 'no', or 'inline'.
 #texinfo_show_urls = 'footnote'
 
+# If true, do not generate a @detailmenu in the "Top" node's menu.
+#texinfo_no_detailmenu = False
 
-# -- Options for Epub output ---------------------------------------------------
+
+# -- Options for Epub output ----------------------------------------------
 
 # Bibliographic Dublin Core info.
-epub_title = u'PyGRASS'
-epub_author = u'Pietro Zambelli'
-epub_publisher = u'Pietro Zambelli'
-epub_copyright = u'2012, Pietro Zambelli'
+epub_title = u'wxGUI'
+epub_author = u'GRASS Development Team'
+epub_publisher = u'GRASS Development Team'
+epub_copyright = u'2014, GRASS Development Team'
+
+# The basename for the epub file. It defaults to the project name.
+#epub_basename = u'wxGUI'
+
+# The HTML theme for the epub output. Since the default themes are not optimized
+# for small screen space, using the same theme for HTML and epub output is
+# usually not wise. This defaults to 'epub', a theme designed to save visual
+# space.
+#epub_theme = 'epub'
 
 # The language of the text. It defaults to the language option
 # or en if the language is not set.
@@ -297,6 +323,9 @@ epub_copyright = u'2012, Pietro Zambelli'
 # A tuple containing the cover image and cover page html template filenames.
 #epub_cover = ()
 
+# A sequence of (type, uri, title) tuples for the guide element of content.opf.
+#epub_guide = ()
+
 # HTML files that should be inserted before the pages created by sphinx.
 # The format is a list of tuples containing the path and title.
 #epub_pre_files = []
@@ -306,10 +335,25 @@ epub_copyright = u'2012, Pietro Zambelli'
 #epub_post_files = []
 
 # A list of files that should not be packed into the epub file.
-#epub_exclude_files = []
+epub_exclude_files = ['search.html']
 
 # The depth of the table of contents in toc.ncx.
 #epub_tocdepth = 3
 
 # Allow duplicate toc entries.
 #epub_tocdup = True
+
+# Choose between 'default' and 'includehidden'.
+#epub_tocscope = 'default'
+
+# Fix unsupported image types using the PIL.
+#epub_fix_images = False
+
+# Scale large images.
+#epub_max_image_width = 0
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+#epub_show_urls = 'inline'
+
+# If false, no index is generated.
+#epub_use_index = True

+ 55 - 3
lib/python/pygrass/docs/make.bat

@@ -3,7 +3,7 @@
 REM Command file for Sphinx documentation
 
 if "%SPHINXBUILD%" == "" (
-	set SPHINXBUILD=sphinx-build2
+	set SPHINXBUILD=sphinx-build
 )
 set BUILDDIR=_build
 set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
@@ -33,6 +33,8 @@ if "%1" == "help" (
 	echo.  texinfo    to make Texinfo files
 	echo.  gettext    to make PO message catalogs
 	echo.  changes    to make an overview over all changed/added/deprecated items
+	echo.  xml        to make Docutils-native XML files
+	echo.  pseudoxml  to make pseudoxml-XML files for display purposes
 	echo.  linkcheck  to check all external links for integrity
 	echo.  doctest    to run all doctests embedded in the documentation if enabled
 	goto end
@@ -44,6 +46,20 @@ if "%1" == "clean" (
 	goto end
 )
 
+
+%SPHINXBUILD% 2> nul
+if errorlevel 9009 (
+	echo.
+	echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
+	echo.installed, then set the SPHINXBUILD environment variable to point
+	echo.to the full path of the 'sphinx-build' executable. Alternatively you
+	echo.may add the Sphinx directory to PATH.
+	echo.
+	echo.If you don't have Sphinx installed, grab it from
+	echo.http://sphinx-doc.org/
+	exit /b 1
+)
+
 if "%1" == "html" (
 	%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
 	if errorlevel 1 exit /b 1
@@ -99,9 +115,9 @@ if "%1" == "qthelp" (
 	echo.
 	echo.Build finished; now you can run "qcollectiongenerator" with the ^
 .qhcp project file in %BUILDDIR%/qthelp, like this:
-	echo.^> qcollectiongenerator %BUILDDIR%\qthelp\PyGrass.qhcp
+	echo.^> qcollectiongenerator %BUILDDIR%\qthelp\wxGUI.qhcp
 	echo.To view the help file:
-	echo.^> assistant -collectionFile %BUILDDIR%\qthelp\PyGrass.ghc
+	echo.^> assistant -collectionFile %BUILDDIR%\qthelp\wxGUI.ghc
 	goto end
 )
 
@@ -129,6 +145,26 @@ if "%1" == "latex" (
 	goto end
 )
 
+if "%1" == "latexpdf" (
+	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
+	cd %BUILDDIR%/latex
+	make all-pdf
+	cd %BUILDDIR%/..
+	echo.
+	echo.Build finished; the PDF files are in %BUILDDIR%/latex.
+	goto end
+)
+
+if "%1" == "latexpdfja" (
+	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
+	cd %BUILDDIR%/latex
+	make all-pdf-ja
+	cd %BUILDDIR%/..
+	echo.
+	echo.Build finished; the PDF files are in %BUILDDIR%/latex.
+	goto end
+)
+
 if "%1" == "text" (
 	%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
 	if errorlevel 1 exit /b 1
@@ -187,4 +223,20 @@ results in %BUILDDIR%/doctest/output.txt.
 	goto end
 )
 
+if "%1" == "xml" (
+	%SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The XML files are in %BUILDDIR%/xml.
+	goto end
+)
+
+if "%1" == "pseudoxml" (
+	%SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
+	goto end
+)
+
 :end

+ 27 - 0
gui/wxpython/docs/wxgui_sphinx/src/index.rst

@@ -0,0 +1,27 @@
+wxGUI documentation
+===================
+
+This is documentation of GRASS wxGUI which is a GRASS GIS GUI
+implemented in Python and `wxPython <http://wxpython.org>`_.
+The documentation is intended to be
+used by GRASS GIS developers only because the documented API is
+not guaranteed to be stable. If you are thinking about doing some
+development using this API, please contact other developers at
+`grass-dev <http://lists.osgeo.org/listinfo/grass-dev>`_ mailing list.
+
+
+.. toctree::
+  :maxdepth: 2
+
+  wxgui_libraries
+  wxgui_tools
+  wxgui_toolboxes
+
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+

+ 23 - 0
gui/wxpython/docs/wxgui_sphinx/src/wxgui_libraries.rst

@@ -0,0 +1,23 @@
+Libraries
+==================
+
+.. toctree::
+  :maxdepth: 2
+
+  core
+  gis_set
+  gis_set_error
+  gui_core
+  icons
+  iscatt
+  lmgr
+  location_wizard
+  mapdisp
+  mapwin
+  menustrings
+  modules
+  nviz
+  vnet
+  web_services
+  wxgui
+  wxplot

+ 402 - 0
gui/wxpython/docs/wxgui_sphinx/src/wxgui_toolboxes.rst

@@ -0,0 +1,402 @@
+WxGUI Toolboxes
+===============
+
+Introduction
+------------
+
+wxGUI toolboxes enables GUI customization and organization of menu (and other
+views) according to user needs.
+
+XML files are used for code generation and in case of toolboxes enables
+wxGUI (menu) customization.
+
+Currently, all the files described here are related to the menus which are
+generated from these files. The most of the files described here are
+the part of implementation of toolboxes in wxGUI.
+
+Each XML file has a DTD file which can by used for validation. XSD files are
+not provided (but this can change in the future). Some file types can occur
+multiple times, some occur only once.
+
+Note that in XML context, the term *tag* partially overlaps with the term
+*element*. Element emphasizes the XML structure, XML object model and
+content of these objects. Tag emphasizes the markup and the name of the element.
+
+
+Files overview
+--------------
+
+Files related to toolboxes
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+GRASS source code contains these XML files:
+
+* ``gui/wxpython/xml/main_menu.xml``
+* ``gui/wxpython/xml/toolboxes.xml``
+* ``gui/wxpython/xml/wxgui_items.xml``
+
+
+GRASS distribution contains these XML files:
+
+* ``etc/gui/wxpython/xml/main_menu.xml``
+* ``etc/gui/wxpython/xml/toolboxes.xml``
+* ``etc/gui/wxpython/xml/wxgui_items.xml``
+* ``etc/gui/wxpython/xml/module_items.xml`` (generated during compilation)
+* ``etc/gui/wxpython/xml/menudata.xml`` (generated during compilation)
+
+
+GRASS directory (``.grass7``) in user home directory
+(i.e., ``$HOME`` on Unix) contains these XML files:
+
+* ``toolboxes/main_menu.xml`` (created by user)
+* ``toolboxes/toolboxes.xml`` (created by user)
+* ``toolboxes/menudata.xml`` (generated on wxGUI startup)
+
+
+.. graphviz::
+
+    digraph toolboxes {
+        graph [rankdir="LR"];
+        node [shape="record", style="rounded"];
+
+        menudata [label="menudata.xml in distribution", shape="note", URL="#menudata-file"];
+        umenudata [label="menudata.xml in user home", shape="note", URL="#menudata-file"];
+        toolboxes [label="toolboxes.xml in distribution", shape="note", URL="#toolboxes-file"];
+        utoolboxes [label="toolboxes.xml in user home", shape="note", URL="#toolboxes-file"];
+        main_menu [label="main_menu.xml in distribution", shape="note", URL="#main-menu-file"];
+        umain_menu [label="main_menu.xml in user home", shape="note", URL="#main-menu-file"];
+
+        wxgui_items [label="wxgui_items.xml in distribution", shape="note", URL="#wxgui-items-file"];
+        module_items [label="module_items.xml in distribution", shape="note", URL="#module-items-file"];
+
+        menustrings [label="menustrings.py\n(used for translations)", shape="note"];
+
+        module_items -> menudata;
+        wxgui_items -> menudata;
+        main_menu -> menudata;
+        toolboxes -> menudata;
+
+        module_items -> umenudata;
+        wxgui_items -> umenudata;
+        toolboxes -> umenudata;
+        main_menu -> umenudata;
+        umain_menu -> umenudata;
+        utoolboxes -> umenudata;
+
+        menudata -> menustrings;
+
+        // guimenu [label="Main menu in wxGUI", shape="box3d"];
+        // menustrings -> guimenu;
+        // menudata -> guimenu;
+        // umenudata -> guimenu;
+    }
+
+
+Other files
+^^^^^^^^^^^
+
+GRASS source code contains these XML files:
+
+* ``gui/wxpython/xml/menudata_gmodeler.xml``
+* ``gui/wxpython/xml/menudata_psmap.xml``
+
+In GRASS distribution these XML files are in the ``etc/gui/wxpython/xml``
+directory.
+
+
+Generation of files and menu
+----------------------------
+
+As noted in the section \ref toolboxesFilesOverview, there are files in the
+GRASS distribution and in the user home directory (particularly in
+``.grass7/tooboxes`` subdirectory).
+
+When user doesn't have any ``toolboxes.xml`` or ``main_menu.xml`` files in the
+home directory, file ``menudata.xml`` included in the distribution is used to
+build a menu.
+
+When ``toolboxes.xml`` or ``main_menu.xml`` file (in user home directory) is newer
+than ``menudata.xml`` in user home directory or ``menudata.xml`` does not exists
+in user home directory, the ``menudata.xml`` is generated when GUI starts.
+
+When ``menudata.xml`` in user home directory is fresh enough,
+it is used to create a menu.
+
+When ``toolboxes.xml`` or ``main_menu.xml`` file is not in user home directory
+but ``menudata.xml`` is, the file is re-generated (each time the GUI starts).
+So, if you just have your own ``main_menu.xml``, it is better to create also
+a ``toolboxes.xml`` file with no toolboxes (note that you still need to create
+a valid XML toolbox file).
+Similarly, if you have only the ``toolboxes.xml`` file it
+is better to copy the ``main_menu.xml`` file from distribution into your home
+directory.
+
+When reading the main_menu file, user toolboxes are expanded first and then
+toolboxes from distribution are expanded.
+
+
+Toolboxes file
+--------------
+
+This file contains definition of toolboxes. A toolbox contains references
+(links) to other items, namely ``<module-items>``, ``<wxgui-items>``
+and other toolboxes using tag ``<subtoolbox>``. Tag ``<separator>`` is
+used when the view supports some kind of visual separators to group parts
+of the toolbox (or menu).
+
+Items are referenced using ``name`` attribute. In case of ``<module-items>``,
+``<wxgui-items>`` also subelements can be added to create new items or to
+replace subelements values from item definition.
+
+.. graphviz::
+
+    graph toolboxes {
+        graph [rankdir="LR"];
+        node [shape="record", style="rounded"];
+
+        // ∞ causes Doxygen warning but it's harmless for dot and html output
+
+        toolboxes -- toolbox [label="1..∞"];
+
+        toolbox -- label;
+        toolbox -- items [label="1..∞"];
+
+        items -- "module-item" [label="0..1"];
+        items -- "wxgui-item" [label="0..1"];
+        items -- subtoolbox [label="0..1"];
+        items -- separator [label="0..1"];
+
+        milabel [label="label"];
+
+        "module-item" -- milabel;
+        "module-item" -- module [label="0..1"];
+        "module-item" -- description [label="0..1"];
+        "module-item" -- keywords [label="0..1"];
+
+        wilabel [label="label"];
+        widescription [label="description"];
+        wikeywords [label="keywords"];
+
+        "wxgui-item" -- wilabel [label="0..1"];
+        "wxgui-item" -- handler [label="0..1"];
+        "wxgui-item" -- "related-module" [label="0..1"];
+        "wxgui-item" -- command [label="0..1"];
+        "wxgui-item" -- widescription [label="0..1"];
+        "wxgui-item" -- wikeywords [label="0..1"];
+        "wxgui-item" -- shortcut [label="0..1"];
+        "wxgui-item" -- "wx-id" [label="0..1"];
+    }
+
+
+
+Main menu file
+--------------
+
+File has a layout similar to the \ref toolboxesFile but contains only one
+toolbox (``<toolbox>``) which can contain only subtoolboxes
+(``<subtoolbox>`` elements) and one special
+element ``<user-toolboxes-list>`` which will be replaced by a menu with the list
+of toolboxes in the user toolbox file.
+
+
+Modules items file
+------------------
+
+The file contains information obtained from modules' interface descriptions.
+The structure of one ``module-item`` is the same as in the \ref toolboxesFile
+but some subelements are mandatory.
+
+File contained in distribution is generated during compilation from available
+modules using the script ``gui/wxpython/tools/build_modules_xml.py``.
+
+Element ``<module>`` is the name of the executable, e.g. ``r.info``.
+
+Element ``<label>`` is currently not present. It represents the short label in
+menu and it is added in toolboxes.
+
+Element ``<description>`` is created from module's description (or if
+it exists, label concatenated with description).
+
+Element ``<keywords>`` is created from module's keywords.
+
+
+wxGUI items file
+----------------
+
+The file contains definitions of wxGUI actions which can be accessed for
+example, from menu.
+The structure of one ``wxgui-item`` is the same as in \ref toolboxesFile
+but some subelements are mandatory.
+
+
+Menudata file
+-------------
+
+Historically, menudata.xml file was in the source codes and was partially
+maintained by the script ``gui/wxpython/tools/update_menudata.py``
+which updated the description and keywords (based on module's
+label or description, and keywords).
+Other items (menu structure, menu item labels and non-module only items) were
+edited in the menudata.xml file directly.
+
+Currently, the file is generated during compilation or at startup. It serves
+as an intermediate layer between all toolboxes XMLs and GUI menu tree
+generation.
+
+
+How to write a custom toolbox
+-----------------------------
+
+To create a new toolbox use ``<toolbox>`` tag:
+
+.. code-block:: xml
+
+    <toolbox name="MyRaster">
+      <label>My &amp;raster</label>
+      <items>
+        <!-- ... -->
+      </items>
+    </toolbox>
+
+To create a new item which represents a module use ``<module-item>`` tag:
+
+.. code-block:: xml
+
+    <module-item name="r.buffer">
+      <label>Buffer rasters</label>
+    </module-item>
+
+This works for modules contained in distribution. For modules from addons or
+some your modules which are on path use ``<module-item>`` tag together with
+``<module>`` tag:
+
+.. code-block:: xml
+
+    <module-item name="r.agent">
+      <label>Buffer rasters</label>
+      <module>r.agent</module>
+    </module-item>
+
+The name of a module is duplicated in the XML but anyway, try to keep ``name``
+attribute and ``module`` element in sync.
+
+To create a new item which triggers some wxGUI action defined in distribution
+use ``<wxgui-item>`` tag:
+
+.. code-block:: xml
+
+    <wxgui-item name="RasterMapCalculator"/>
+
+Note that now it is not possible to create custom wxGUI items.
+
+To include an existing toolbox use ``<subtoolbox>`` tag:
+
+.. code-block:: xml
+
+    <subtoolbox name="NeighborhoodAnalysis"/>
+
+To create a submenu in your new menu (toolbox), you need to create a new toolbox
+and include this toolbox.
+
+To create your custom main menu create a file main_menu.xml in your user home
+directory, in ``.grass7/toolboxes`` subdirectory. Directory ``.grass7`` may be
+hidden directory on your system. The XML file should contain the definition of
+only one toolbox. The name attribute and label element are not used but should
+be filled for documentation purposes and future compatibility.
+
+If you want to base your toolbox or main menu on existing toolbox or main menu
+copy the part of existing XML file from GRASS GIS distribution (installation)
+directory or GRASS GIS source code. If you want to include some existing
+toolboxes or wxGUI items defined in GRASS GIS you need to look to these files
+too and find the proper ``name`` attributes.
+
+
+Example
+^^^^^^^
+
+Files should be placed in user home directory in ``.grass7/toolboxes``
+subdirectory, e.g. ``/home/john/.grass7/toolboxes``.
+
+toolboxes.xml
+"""""""""""""
+
+.. code-block:: xml
+
+    <?xml version="1.0" encoding="UTF-8"?>
+    <!DOCTYPE toolboxes SYSTEM "toolboxes.dtd">
+    <toolboxes>
+      <toolbox name="MyRaster">
+        <label>My &amp;raster</label>
+        <items>
+          <module-item name="r.buffer">
+            <label>Buffer rasters</label>
+          </module-item>
+          <module-item name="r.mask">
+            <label>Mask</label>
+          </module-item>
+          <separator/>
+          <wxgui-item name="RasterMapCalculator"/>
+          <subtoolbox name="NeighborhoodAnalysis"/>
+          <subtoolbox name="ReportAndStatistics"/>
+        </items>
+      </toolbox>
+    </toolboxes>
+
+
+main_menu.xml
+"""""""""""""
+
+.. code-block:: xml
+
+    <?xml version="1.0" encoding="UTF-8"?>
+    <!DOCTYPE toolbox SYSTEM "main_menu.dtd">
+    <toolbox name="MyCustomMainMenu">
+      <label>MyCustomMainMenu</label>
+      <items>
+        <subtoolbox name="File"/>
+        <subtoolbox name="Settings"/>
+        <subtoolbox name="MyRaster"/>
+        <subtoolbox name="Imagery"/>
+        <subtoolbox name="Help"/>
+      </items>
+    </toolbox>
+
+
+Validation
+^^^^^^^^^^
+
+You should validate your XML before running wxGUI, e.g. using ``xmllint``
+(no output means that document is valid)::
+
+    xmllint --noout --dtdvalid toolboxes.dtd toolboxes.xml
+
+You can find ``toolboxes.dtd`` and ``main_menu.dtd`` in your GRASS GIS directory,
+in ``etc/gui/wxpython/xml`` subdirectory. Depending on the validator,
+you might need to add DTD file to the drectory with the XML file.
+
+If you will provide an invalid, not well formed or empty file loading of
+toolboxes will obviously fail.
+
+
+Labels
+^^^^^^
+
+The label shortly describes the toolbox or the action which will happen after
+running an item. The label can be a command such as *"Create table"*
+or the general name such as *"Table management"*.
+You should add label to each toolbox you create and to each item you create.
+However, if you are just using (and thus referencing) existing items
+(or toolboxes), you don't need to include labels (so you can use just empty
+tags only with the name attribute).
+
+Important items in menu usually have a automatically assigned shortcut which
+depends on their label. This shortcut is assigned to ``Alt+Letter``
+(on most platforms) where letter is a letter after an ampersand (``&``) in the
+item label and  in the user interface the letter is underlined.
+Note that in XML you cannot write ``&`` but you have to write ``&amp;``.
+This concept is not related to the standard shortcut assigned to the item
+according to the shortcut in the XML file.
+
+Don't be confused with the label which is set for the module in the source code.
+These labels play different role, they must be short and usually
+with the wording of a command.

+ 16 - 0
gui/wxpython/docs/wxgui_sphinx/src/wxgui_tools.rst

@@ -0,0 +1,16 @@
+Tools
+===========
+
+.. toctree::
+  :maxdepth: 2
+
+  animation
+  dbmgr
+  gcp
+  gmodeler
+  iclass
+  mapswipe
+  psmap
+  rlisetup
+  timeline
+  vdigit

+ 3 - 2
gui/wxpython/gcp/g.gui.gcp.py

@@ -45,9 +45,10 @@ from core.utils import GuiModuleMain
 from gcp.manager import GCPWizard
 
 def main():
-    """!Sets the GRASS display driver
+    """Sets the GRASS display driver
 
-    @todo use command line options as an alternative to wizard
+    .. todo::
+        use command line options as an alternative to wizard
     """
     driver = UserSettings.Get(group='display', key='driver', subkey='type')
     if driver == 'png':

+ 58 - 57
gui/wxpython/gcp/manager.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package gcp.manager
 
 @brief Georectification module for GRASS GIS. Includes ground control
@@ -240,14 +240,14 @@ class GCPWizard(object):
             self.Cleanup()
                             
     def SetSrcEnv(self, location, mapset):
-        """!Create environment to use for location and mapset
+        """Create environment to use for location and mapset
         that are the source of the file(s) to georectify
 
-        @param location source location
-        @param mapset source mapset
+        :param location: source location
+        :param mapset: source mapset
 
-        @return False on error
-        @return True on success
+        :return: False on error
+        :return: True on success
         """
         
         self.newlocation = location
@@ -293,13 +293,13 @@ class GCPWizard(object):
         return True
         
     def OnGLMFocus(self, event):
-        """!Layer Manager focus"""
+        """Layer Manager focus"""
         # self.SwitchEnv('target')
         
         event.Skip()
 
     def Cleanup(self):
-        """!Return to current location and mapset"""
+        """Return to current location and mapset"""
         # here was also the cleaning of gcpmanagement from layer manager
         # which is no longer needed
 
@@ -363,7 +363,7 @@ class LocationPage(TitledPage):
         # self.Bind(wx.EVT_CLOSE, self.parent.Cleanup)
 
     def OnMaptype(self,event):
-        """!Change map type"""
+        """Change map type"""
         global maptype
 
         if event.GetInt() == 0:
@@ -372,7 +372,7 @@ class LocationPage(TitledPage):
             maptype = 'vector'
         
     def OnLocation(self, event):
-        """!Sets source location for map(s) to georectify"""
+        """Sets source location for map(s) to georectify"""
         self.xylocation = event.GetString()
         
         #create a list of valid mapsets
@@ -394,7 +394,7 @@ class LocationPage(TitledPage):
             wx.FindWindowById(wx.ID_FORWARD).Enable(True)
 
     def OnMapset(self, event):
-        """!Sets source mapset for map(s) to georectify"""
+        """Sets source mapset for map(s) to georectify"""
         if self.xylocation == '':
             GMessage(_('You must select a valid location '
                        'before selecting a mapset'),
@@ -500,7 +500,7 @@ class GroupPage(TitledPage):
         self.xygroup = event.GetString()
         
     def OnMkGroup(self, event):
-        """!Create new group in source location/mapset"""
+        """Create new group in source location/mapset"""
         dlg = GroupDialog(parent = self, defaultGroup = self.xygroup)
         dlg.DisableSubgroupEdit()
         dlg.ShowModal()
@@ -515,7 +515,7 @@ class GroupPage(TitledPage):
         self.Update()
         
     def OnVGroup(self, event):
-        """!Add vector maps to group"""
+        """Add vector maps to group"""
         dlg = VectGroup(parent = self,
                         id = wx.ID_ANY,
                         grassdb = self.grassdatabase,
@@ -659,7 +659,7 @@ class DispMapPage(TitledPage):
         self.Bind(wx.EVT_CLOSE, self.parent.Cleanup)
 
     def OnSrcSelection(self, event):
-        """!Source map to display selected"""
+        """Source map to display selected"""
         global src_map
         global maptype
 
@@ -684,13 +684,13 @@ class DispMapPage(TitledPage):
             pass
 
     def OnTgtRastSelection(self, event):
-        """!Source map to display selected"""
+        """Source map to display selected"""
         global tgt_map
 
         tgt_map['raster'] = self.tgtrastselection.GetValue()
 
     def OnTgtVectSelection(self,event):
-        """!Source map to display selected"""
+        """Source map to display selected"""
         global tgt_map
 
         tgt_map['vector'] = self.tgtvectselection.GetValue()
@@ -779,7 +779,7 @@ class DispMapPage(TitledPage):
             wx.FindWindowById(wx.ID_FORWARD).Enable(True)
 
 class GCP(MapFrame, ColumnSorterMixin):
-    """!
+    """
     Manages ground control points for georectifying. Calculates RMS statistics.
     Calls i.rectify or v.rectify to georectify map.
     """
@@ -956,13 +956,13 @@ class GCP(MapFrame, ColumnSorterMixin):
         self.SetSettings()
 
     def __del__(self):
-        """!Disable GCP manager mode"""
+        """Disable GCP manager mode"""
         # leaving the method here but was used only to delete gcpmanagement
         # from layer manager which is now not needed
         pass
         
     def CreateGCPList(self):
-        """!Create GCP List Control"""
+        """Create GCP List Control"""
 
         return GCPList(parent=self, gcp=self)
 
@@ -1089,7 +1089,7 @@ class GCP(MapFrame, ColumnSorterMixin):
         self.mapcoordlist[key] = [key, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
 
     def SetSettings(self):
-        """!Sets settings for drawing of GCP's.
+        """Sets settings for drawing of GCP's.
         """
         self.highest_only = UserSettings.Get(group='gcpman', key='rms', subkey='highestonly')
         self.show_unused =  UserSettings.Get(group='gcpman', key='symbol', subkey='unused')
@@ -1122,7 +1122,7 @@ class GCP(MapFrame, ColumnSorterMixin):
         self.pointsToDrawTgt.SetPropertyVal("text", copy(textProp))
         
     def SetGCPSatus(self, item, itemIndex):
-        """!Before GCP is drawn, decides it's colour and whether it
+        """Before GCP is drawn, decides it's colour and whether it
         will be drawed.
         """
         key = self.list.GetItemData(itemIndex)
@@ -1155,7 +1155,7 @@ class GCP(MapFrame, ColumnSorterMixin):
         item.SetPropertyVal('penName', wxPen)
 
     def SetGCPData(self, coordtype, coord, mapdisp=None, confirm=False):
-        """!Inserts coordinates from file, mouse click on map, or
+        """Inserts coordinates from file, mouse click on map, or
         after editing into selected item of GCP list and checks it for
         use.
         """
@@ -1211,7 +1211,7 @@ class GCP(MapFrame, ColumnSorterMixin):
         # self.list.ResizeColumns()
         
     def SaveGCPs(self, event):
-        """!Make a POINTS file or save GCP coordinates to existing
+        """Make a POINTS file or save GCP coordinates to existing
         POINTS file
         """
         self.GCPcount = 0
@@ -1313,7 +1313,7 @@ class GCP(MapFrame, ColumnSorterMixin):
             self.RMSError(self.xygroup, self.gr_order)
 
     def ReloadGCPs(self, event):
-        """!Reload data from file"""
+        """Reload data from file"""
 
         # use backup
         shutil.copy(self.file['points_bak'], self.file['points'])
@@ -1472,7 +1472,7 @@ class GCP(MapFrame, ColumnSorterMixin):
         self.grwiz.SwitchEnv('target')
 
     def OnGeorectDone(self, **kargs):
-        """!Print final message"""
+        """Print final message"""
         global maptype
         if maptype == 'raster':
             return
@@ -1488,7 +1488,7 @@ class GCP(MapFrame, ColumnSorterMixin):
 
          
     def OnSettings(self, event):
-        """!GCP Manager settings"""
+        """GCP Manager settings"""
         dlg = GrSettingsDialog(parent=self, giface=self._giface,
                                id=wx.ID_ANY, title=_('GCP Manager settings'))
 
@@ -1499,7 +1499,7 @@ class GCP(MapFrame, ColumnSorterMixin):
 
     def UpdateColours(self, srcrender=False, srcrenderVector=False,
                             tgtrender=False, tgtrenderVector=False):
-        """!update colours"""
+        """update colours"""
         highest_fwd_err = 0.0
         self.highest_key = 0
         highest_idx = 0
@@ -1533,7 +1533,7 @@ class GCP(MapFrame, ColumnSorterMixin):
             targetMapWin.UpdateMap(render=tgtrender, renderVector=tgtrenderVector)
 
     def OnQuit(self, event):
-        """!Quit georectifier"""
+        """Quit georectifier"""
         ret = wx.MessageBox(parent=self,
                       caption=_("Quit GCP Manager"),
                       message=_('Save ground control points?'),
@@ -1768,7 +1768,7 @@ class GCP(MapFrame, ColumnSorterMixin):
         return newreg
 
     def OnHelp(self, event):
-        """!Show GCP Manager manual page"""
+        """Show GCP Manager manual page"""
         self._giface.Help(entry='wxGUI.gcp')
 
     def OnUpdateActive(self, event):
@@ -1795,7 +1795,7 @@ class GCP(MapFrame, ColumnSorterMixin):
         self.StatusbarUpdate()
 
     def AdjustMap(self, newreg):
-        """!Adjust map window to new extents
+        """Adjust map window to new extents
         """
 
         # adjust map window
@@ -1834,7 +1834,7 @@ class GCP(MapFrame, ColumnSorterMixin):
         self.StatusbarUpdate()
 
     def OnZoomToSource(self, event):
-        """!Set target map window to match extents of source map window
+        """Set target map window to match extents of source map window
         """
 
         if not self.MapWindow == self.TgtMapWindow:
@@ -1848,7 +1848,7 @@ class GCP(MapFrame, ColumnSorterMixin):
             self.AdjustMap(newreg)
 
     def OnZoomToTarget(self, event):
-        """!Set source map window to match extents of target map window
+        """Set source map window to match extents of target map window
         """
 
         if not self.MapWindow == self.SrcMapWindow:
@@ -1862,7 +1862,7 @@ class GCP(MapFrame, ColumnSorterMixin):
             self.AdjustMap(newreg)
 
     def OnZoomMenuGCP(self, event):
-        """!Popup Zoom menu
+        """Popup Zoom menu
         """
         point = wx.GetMousePosition()
         zoommenu = wx.Menu()
@@ -1882,14 +1882,14 @@ class GCP(MapFrame, ColumnSorterMixin):
         zoommenu.Destroy()
         
     def OnSize(self, event):
-        """!Adjust Map Windows after GCP Map Display has been resized
+        """Adjust Map Windows after GCP Map Display has been resized
         """
         # re-render image on idle
         self.resize = time.clock()
         super(MapFrame, self).OnSize(event)
 
     def OnIdle(self, event):
-        """!GCP Map Display resized, adjust Map Windows
+        """GCP Map Display resized, adjust Map Windows
         """
         if self.GetMapToolbar():
             if self.resize and self.resize + 0.2 < time.clock():
@@ -1974,7 +1974,7 @@ class GCPList(wx.ListCtrl,
                 idx_col += 1
 
     def LoadData(self):
-        """!Load data into list"""
+        """Load data into list"""
         self.DeleteAllItems()
 
         self.render = False
@@ -1998,7 +1998,7 @@ class GCPList(wx.ListCtrl,
         self.EnsureVisible(self.selected)
 
     def OnCheckItem(self, index, flag):
-        """!Item is checked/unchecked"""
+        """Item is checked/unchecked"""
 
         if self.render:
             # redraw points
@@ -2039,7 +2039,7 @@ class GCPList(wx.ListCtrl,
         return self.selected
 
     def DeleteGCPItem(self):
-        """!Deletes selected item in GCP list.
+        """Deletes selected item in GCP list.
         """
         if self.selected == wx.NOT_FOUND:
             return
@@ -2057,7 +2057,7 @@ class GCPList(wx.ListCtrl,
         return key
         
     def ResizeColumns(self):
-        """!Resize columns"""
+        """Resize columns"""
         minWidth = [90, 120]
         for i in range(self.GetColumnCount()):
             self.SetColumnWidth(i, wx.LIST_AUTOSIZE)
@@ -2068,11 +2068,11 @@ class GCPList(wx.ListCtrl,
         self.SendSizeEvent()
 
     def GetSelected(self):
-        """!Get index of selected item"""
+        """Get index of selected item"""
         return self.selected
 
     def OnItemSelected(self, event):
-        """!Item selected
+        """Item selected
         """
         if self.render and self.selected != event.GetIndex():
             self.selected = event.GetIndex()
@@ -2130,7 +2130,7 @@ class GCPList(wx.ListCtrl,
                     self.gcp.UpdateColours()
                     
     def OnColClick(self, event):
-        """!ListCtrl forgets selected item..."""
+        """ListCtrl forgets selected item..."""
         self.selected = self.FindItemData(-1, self.selectedkey)
         self.SetItemState(self.selected,
                           wx.LIST_STATE_SELECTED,
@@ -2139,9 +2139,10 @@ class GCPList(wx.ListCtrl,
         event.Skip()
 
 class VectGroup(wx.Dialog):
-    """!Dialog to create a vector group (VREF file) for georectifying
+    """Dialog to create a vector group (VREF file) for georectifying
 
-    @todo Replace by g.group
+    .. todo::
+        Replace by g.group
     """
     def __init__(self, parent, id, grassdb, location, mapset, group,
                  style=wx.DEFAULT_DIALOG_STYLE):
@@ -2251,7 +2252,7 @@ class VectGroup(wx.Dialog):
         self.Layout()
         
     def MakeVGroup(self):
-        """!Create VREF file"""
+        """Create VREF file"""
         vgrouplist = []
         for item in range(self.listMap.GetCount()):
             if not self.listMap.IsChecked(item):
@@ -2269,7 +2270,7 @@ class EditGCP(wx.Dialog):
     def __init__(self, parent, data, gcpno, id=wx.ID_ANY,
                  title=_("Edit GCP"),
                  style=wx.DEFAULT_DIALOG_STYLE):
-        """!Dialog for editing GPC and map coordinates in list control"""
+        """Dialog for editing GPC and map coordinates in list control"""
 
         wx.Dialog.__init__(self, parent, id, title=title, style=style)
 
@@ -2345,7 +2346,7 @@ class EditGCP(wx.Dialog):
         sizer.Fit(self)
 
     def GetValues(self, columns=None):
-        """!Return list of values (as strings).
+        """Return list of values (as strings).
         """
         valuelist = []
         try:
@@ -2426,7 +2427,7 @@ class GrSettingsDialog(wx.Dialog):
         mainSizer.Fit(self)
         
     def __CreateSymbologyPage(self, notebook):
-        """!Create notebook page with symbology settings"""
+        """Create notebook page with symbology settings"""
 
         panel = wx.Panel(parent=notebook, id=wx.ID_ANY)
         notebook.AddPage(page=panel, text=_("Symbology"))
@@ -2626,7 +2627,7 @@ class GrSettingsDialog(wx.Dialog):
         return panel
 
     def __CreateRectificationPage(self, notebook):
-        """!Create notebook page with symbology settings"""
+        """Create notebook page with symbology settings"""
 
         panel = wx.Panel(parent=notebook, id=wx.ID_ANY)
         notebook.AddPage(page=panel, text=_("Rectification"))
@@ -2680,7 +2681,7 @@ class GrSettingsDialog(wx.Dialog):
         return panel
 
     def OnHighlight(self, event):
-        """!Checkbox 'highlighthighest' checked/unchecked"""
+        """Checkbox 'highlighthighest' checked/unchecked"""
         if self.highlighthighest.IsChecked():
             self.parent.highest_only = True
             self.rmsWin.Disable()
@@ -2689,7 +2690,7 @@ class GrSettingsDialog(wx.Dialog):
             self.rmsWin.Enable()
 
     def OnSDFactor(self,event):
-        """!New factor for RMS threshold = M + SD * factor"""
+        """New factor for RMS threshold = M + SD * factor"""
         try:
             self.sdfactor = float(self.rmsWin.GetValue())
         except ValueError:
@@ -2703,7 +2704,7 @@ class GrSettingsDialog(wx.Dialog):
                              'Too many points might be highlighted'))
         
     def OnSrcSelection(self,event):
-        """!Source map to display selected"""
+        """Source map to display selected"""
         global src_map
 
         tmp_map = self.srcselection.GetValue()
@@ -2712,13 +2713,13 @@ class GrSettingsDialog(wx.Dialog):
             self.new_src_map = tmp_map
 
     def OnTgtRastSelection(self,event):
-        """!Target map to display selected"""
+        """Target map to display selected"""
         global tgt_map
 
         self.new_tgt_map['raster'] = self.tgtrastselection.GetValue()
 
     def OnTgtVectSelection(self,event):
-        """!Target map to display selected"""
+        """Target map to display selected"""
         global tgt_map
 
         self.new_tgt_map['vector'] = self.tgtvectselection.GetValue()
@@ -2840,7 +2841,7 @@ class GrSettingsDialog(wx.Dialog):
         self.parent.SetSettings()        
 
     def OnSave(self, event):
-        """!Button 'Save' pressed"""
+        """Button 'Save' pressed"""
         self.UpdateSettings()
         fileSettings = {}
         UserSettings.ReadSettingsFile(settings=fileSettings)
@@ -2850,10 +2851,10 @@ class GrSettingsDialog(wx.Dialog):
         #self.Close()
 
     def OnApply(self, event):
-        """!Button 'Apply' pressed"""
+        """Button 'Apply' pressed"""
         self.UpdateSettings()
         #self.Close()
 
     def OnClose(self, event):
-        """!Button 'Cancel' pressed"""
+        """Button 'Cancel' pressed"""
         self.Close()

+ 24 - 24
gui/wxpython/gcp/mapdisplay.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package gcp.mapdisplay
 
 @brief Display to manage ground control points with two toolbars, one
@@ -41,22 +41,22 @@ import gcp.statusbar as sbgcp
 cmdfilename = None
 
 class MapFrame(SingleMapFrame):
-    """!Main frame for map display window. Drawing takes place in
+    """Main frame for map display window. Drawing takes place in
     child double buffered drawing window.
     """
     def __init__(self, parent, giface,
                  title=_("GRASS GIS Manage Ground Control Points"),
                  toolbars=["gcpdisp"], Map=None, auimgr=None,
                  name='GCPMapWindow', **kwargs):
-        """!Main map display window with toolbars, statusbar and
+        """Main map display window with toolbars, statusbar and
         DrawWindow
 
-        @param giface GRASS interface instance
-        @param title window title
-        @param toolbars array of activated toolbars, e.g. ['map', 'digit']
-        @param Map instance of render.Map
-        @param auimgs AUI manager
-        @param kwargs wx.Frame attribures
+        :param giface: GRASS interface instance
+        :param title: window title
+        :param toolbars: array of activated toolbars, e.g. ['map', 'digit']
+        :param map: instance of render.Map
+        :param auimgs: AUI manager
+        :param kwargs: wx.Frame attribures
         """
         
         SingleMapFrame.__init__(self, parent = parent, giface = giface, title = title,
@@ -230,7 +230,7 @@ class MapFrame(SingleMapFrame):
         mapWindow.mouseMoving.connect(self.CoordinatesChanged)
 
     def AddToolbar(self, name):
-        """!Add defined toolbar to the window
+        """Add defined toolbar to the window
         
         Currently known toolbars are:
          - 'map'     - basic map toolbar
@@ -302,12 +302,12 @@ class MapFrame(SingleMapFrame):
         event.Skip()
 
     def OnDraw(self, event):
-        """!Re-display current map composition
+        """Re-display current map composition
         """
         self.MapWindow.UpdateMap(render = False)
         
     def OnRender(self, event):
-        """!Re-render map composition (each map layer)
+        """Re-render map composition (each map layer)
         """
         # FIXME: remove qlayer code or use RemoveQueryLayer() now in mapdisp.frame
         # delete tmp map layers (queries)
@@ -323,8 +323,8 @@ class MapFrame(SingleMapFrame):
         self.StatusbarUpdate()
 
     def OnPointer(self, event):
-        """!Pointer button clicked
-        """        
+        """Pointer button clicked
+        """      
         self.SrcMapWindow.SetModePointer()
         self.TgtMapWindow.SetModePointer()
         # change the default cursor
@@ -360,7 +360,7 @@ class MapFrame(SingleMapFrame):
         win.EraseMap()
 
     def SaveToFile(self, event):
-        """!Save map to image
+        """Save map to image
         """
         img = self.MapWindow.img
         if not img:
@@ -427,30 +427,30 @@ class MapFrame(SingleMapFrame):
         printmenu.Destroy()
 
     def OnZoomToRaster(self, event):
-        """!
+        """
         Set display extents to match selected raster map (ignore NULLs)
         """
         self.MapWindow.ZoomToMap(ignoreNulls = True)
         
     def OnZoomToSaved(self, event):
-        """!Set display geometry to match extents in
+        """Set display geometry to match extents in
         saved region file
         """
         self.MapWindow.SetRegion(zoomOnly=True)
         
     def OnDisplayToWind(self, event):
-        """!Set computational region (WIND file) to match display
+        """Set computational region (WIND file) to match display
         extents
         """
         self.MapWindow.DisplayToWind()
  
     def SaveDisplayRegion(self, event):
-        """!Save display extents to named region file.
+        """Save display extents to named region file.
         """
         self.MapWindow.SaveDisplayRegion()
         
     def OnZoomMenu(self, event):
-        """!Popup Zoom menu
+        """Popup Zoom menu
         """
         point = wx.GetMousePosition()
         zoommenu = wx.Menu()
@@ -483,14 +483,14 @@ class MapFrame(SingleMapFrame):
         
         
     def IsStandalone(self):
-        """!Check if Map display is standalone"""
+        """Check if Map display is standalone"""
         # we do not know and we do not care, so always False
         return True
     
     def GetLayerManager(self):
-        """!Get reference to Layer Manager
+        """Get reference to Layer Manager
 
-        @return always None
+        :return: always None
         """
         return None
 
@@ -504,7 +504,7 @@ class MapFrame(SingleMapFrame):
         return self.show_target
         
     def GetMapToolbar(self):
-        """!Returns toolbar with zooming tools"""
+        """Returns toolbar with zooming tools"""
         return self.toolbars['gcpdisp']
 
     def _setActiveMapWindow(self, mapWindow):

+ 4 - 4
gui/wxpython/gcp/statusbar.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package gcp.statusbar
 
 @brief Classes for statusbar management in GCP Manager
@@ -25,7 +25,7 @@ from mapdisp.statusbar import SbItem, SbTextItem
 
 
 class SbGoToGCP(SbItem):
-    """!SpinCtrl to select GCP to focus on
+    """SpinCtrl to select GCP to focus on
 
     Requires MapFrame.GetSrcWindow, MapFrame.GetTgtWindow,
     MapFrame.GetListCtrl, MapFrame.GetMapCoordList.
@@ -43,7 +43,7 @@ class SbGoToGCP(SbItem):
         self.widget.Bind(wx.EVT_SPINCTRL, self.OnGoToGCP)
 
     def OnGoToGCP(self, event):
-        """!Zooms to given GCP."""
+        """Zooms to given GCP."""
         gcpNumber = self.GetValue()
         mapCoords = self.mapFrame.GetMapCoordList()
 
@@ -108,7 +108,7 @@ class SbGoToGCP(SbItem):
 
 
 class SbRMSError(SbTextItem):
-    """!Shows RMS error.
+    """Shows RMS error.
 
     Requires MapFrame.GetFwdError, MapFrame.GetBkwError.
     """

+ 6 - 6
gui/wxpython/gcp/toolbars.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package gcp.toolbars
 
 @brief Georectification module - toolbars
@@ -27,9 +27,9 @@ from icons.icon import MetaIcon
 
 
 class GCPManToolbar(BaseToolbar):
-    """!Toolbar for managing ground control points
+    """Toolbar for managing ground control points
 
-    @param parent reference to GCP widget
+    :param parent: reference to GCP widget
     """
     def __init__(self, parent):
         BaseToolbar.__init__(self, parent)
@@ -76,10 +76,10 @@ class GCPManToolbar(BaseToolbar):
                                     )
     
 class GCPDisplayToolbar(BaseToolbar):
-    """!GCP Display toolbar
+    """GCP Display toolbar
     """
     def __init__(self, parent, toolSwitcher):
-        """!GCP Display toolbar constructor
+        """GCP Display toolbar constructor
         """
         BaseToolbar.__init__(self, parent, toolSwitcher)
         
@@ -106,7 +106,7 @@ class GCPDisplayToolbar(BaseToolbar):
         self.EnableTool(self.zoomback, False)
         
     def _toolbarData(self):
-        """!Toolbar data"""
+        """Toolbar data"""
         icons = {
             'gcpSet'    : MetaIcon(img = 'gcp-create',
                                    label = _('Update GCP coordinates'),

+ 25 - 25
gui/wxpython/gis_set.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package gis_set
 
 GRASS start-up screen.
@@ -46,7 +46,7 @@ from gui_core.widgets import GenericValidator
 sys.stderr = codecs.getwriter('utf8')(sys.stderr)
 
 class GRASSStartup(wx.Frame):
-    """!GRASS start-up screen"""
+    """GRASS start-up screen"""
     def __init__(self, parent = None, id = wx.ID_ANY, style = wx.DEFAULT_FRAME_STYLE):
 
         #
@@ -203,7 +203,7 @@ class GRASSStartup(wx.Frame):
         self.Bind(wx.EVT_CLOSE,               self.OnCloseWindow)
         
     def _set_properties(self):
-        """!Set frame properties"""
+        """Set frame properties"""
         self.SetTitle(_("Welcome to GRASS GIS"))
         self.SetIcon(wx.Icon(os.path.join(globalvar.ICONDIR, "grass.ico"),
                              wx.BITMAP_TYPE_ICO))
@@ -394,7 +394,7 @@ class GRASSStartup(wx.Frame):
         self.Layout()
 
     def _readGisRC(self):
-        """!Read variables from $HOME/.grass7/rc file
+        """Read variables from $HOME/.grass7/rc file
         """
         grassrc = {}
         
@@ -438,7 +438,7 @@ class GRASSStartup(wx.Frame):
         self.lmessage.SetLabel("")
 
     def GetRCValue(self, value):
-        """!Return GRASS variable (read from GISRC)
+        """Return GRASS variable (read from GISRC)
         """
         if self.grassrc.has_key(value):
             return self.grassrc[value]
@@ -446,7 +446,7 @@ class GRASSStartup(wx.Frame):
             return None
         
     def OnWizard(self, event):
-        """!Location wizard started"""
+        """Location wizard started"""
         from location_wizard.wizard import LocationWizard
         gWizard = LocationWizard(parent = self,
                                  grassdatabase = self.tgisdbase.GetValue())
@@ -487,7 +487,7 @@ class GRASSStartup(wx.Frame):
                 self.CreateNewMapset(mapsetName)
 
     def SetDefaultRegion(self, location):
-        """!Asks to set default region."""
+        """Asks to set default region."""
         caption = _("Location <%s> created") % location
         message = _("Do you want to set the default "
                     "region extents and resolution now?")
@@ -507,7 +507,7 @@ class GRASSStartup(wx.Frame):
             dlg.Destroy()
 
     def ImportFile(self, filePath):
-        """!Tries to import file as vector or raster.
+        """Tries to import file as vector or raster.
 
         If successfull sets default region from imported map.
         """
@@ -546,7 +546,7 @@ class GRASSStartup(wx.Frame):
                 RunCommand('g.region', flags = 's', parent = self, **args)
         
     def OnManageLoc(self, event):
-        """!Location management choice control handler
+        """Location management choice control handler
         """
         sel = event.GetSelection()
         if sel ==  0:
@@ -561,7 +561,7 @@ class GRASSStartup(wx.Frame):
         event.Skip()
         
     def RenameMapset(self):
-        """!Rename selected mapset
+        """Rename selected mapset
         """
         location = self.listOfLocations[self.lblocations.GetSelection()]
         mapset   = self.listOfMapsets[self.lbmapsets.GetSelection()]
@@ -603,7 +603,7 @@ class GRASSStartup(wx.Frame):
         dlg.Destroy()
 
     def RenameLocation(self):
-        """!Rename selected location
+        """Rename selected location
         """
         location = self.listOfLocations[self.lblocations.GetSelection()]
 
@@ -640,7 +640,7 @@ class GRASSStartup(wx.Frame):
         dlg.Destroy()
 
     def DeleteMapset(self):
-        """!Delete selected mapset
+        """Delete selected mapset
         """
         location = self.listOfLocations[self.lblocations.GetSelection()]
         mapset   = self.listOfMapsets[self.lbmapsets.GetSelection()]
@@ -695,7 +695,7 @@ class GRASSStartup(wx.Frame):
         dlg.Destroy()
 
     def UpdateLocations(self, dbase):
-        """!Update list of locations"""
+        """Update list of locations"""
         try:
             self.listOfLocations = GetListOfLocations(dbase)
         except UnicodeEncodeError:
@@ -717,7 +717,7 @@ class GRASSStartup(wx.Frame):
         return self.listOfLocations
 
     def UpdateMapsets(self, location):
-        """!Update list of mapsets"""
+        """Update list of mapsets"""
         self.FormerMapsetSelection = wx.NOT_FOUND # for non-selectable item
         
         self.listOfMapsetsSelectable = list()
@@ -762,7 +762,7 @@ class GRASSStartup(wx.Frame):
         return self.listOfMapsets
 
     def OnSelectLocation(self, event):
-        """!Location selected"""
+        """Location selected"""
         if event:
             self.lblocations.SetSelection(event.GetIndex())
             
@@ -804,7 +804,7 @@ class GRASSStartup(wx.Frame):
             self.manageloc.Enable(False)
         
     def OnSelectMapset(self, event):
-        """!Mapset selected"""
+        """Mapset selected"""
         self.lbmapsets.SetSelection(event.GetIndex())
 
         if event.GetText() not in self.listOfMapsetsSelectable:
@@ -814,7 +814,7 @@ class GRASSStartup(wx.Frame):
             event.Skip()
 
     def OnSetDatabase(self, event):
-        """!Database set"""
+        """Database set"""
         gisdbase = self.tgisdbase.GetValue()
         self._hideMessage()
         if not os.path.exists(gisdbase):
@@ -844,7 +844,7 @@ class GRASSStartup(wx.Frame):
         dlg.Destroy()
 
     def OnCreateMapset(self, event):
-        """!Create new mapset"""
+        """Create new mapset"""
         dlg = TextEntryDialog(parent = self,
                               message = _('Enter name for new mapset:'),
                               caption = _('Create new mapset'),
@@ -950,7 +950,7 @@ class GRASSStartup(wx.Frame):
                    set = "MAPSET=%s" % mapset)
 
     def _getDefaultMapsetName(self):
-        """!Returns default name for mapset."""
+        """Returns default name for mapset."""
         try:
             defaultName = getpass.getuser()
             defaultName.encode('ascii') # raise error if not ascii (not valid mapset name)
@@ -975,7 +975,7 @@ class GRASSStartup(wx.Frame):
         RunCommand('g.manual', entry = 'helptext')
 
     def OnCloseWindow(self, event):
-        """!Close window event"""
+        """Close window event"""
         event.Skip()
         sys.exit(2)
 
@@ -987,7 +987,7 @@ class GRASSStartup(wx.Frame):
 
 
 class GListBox(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin):
-    """!Use wx.ListCtrl instead of wx.ListBox, different style for
+    """Use wx.ListCtrl instead of wx.ListBox, different style for
     non-selectable items (e.g. mapsets with denied permission)"""
     def __init__(self, parent, id, size,
                  choices, disabled = []):
@@ -1004,10 +1004,10 @@ class GListBox(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin):
         self._LoadData(choices, disabled)
         
     def _LoadData(self, choices, disabled = []):
-        """!Load data into list
+        """Load data into list
         
-        @param choices list of item
-        @param disabled list of indeces of non-selectable items
+        :param choices: list of item
+        :param disabled: list of indeces of non-selectable items
         """
         idx = 0
         for item in choices:
@@ -1036,7 +1036,7 @@ class GListBox(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin):
         return self.selected
         
 class StartUp(wx.App):
-    """!Start-up application"""
+    """Start-up application"""
 
     def OnInit(self):
         if not globalvar.CheckWxVersion([2, 9]):

+ 1 - 1
gui/wxpython/gis_set_error.py

@@ -1,4 +1,4 @@
-"""!
+""" 
 @package gis_set_error
 
 GRASS start-up screen error message.

+ 65 - 65
gui/wxpython/gmodeler/dialogs.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package gmodeler.dialogs
 
 @brief wxGUI Graphical Modeler - dialogs
@@ -43,7 +43,7 @@ from lmgr.menudata        import LayerManagerMenuData
 from grass.script import task as gtask
 
 class ModelDataDialog(SimpleDialog):
-    """!Data item properties dialog"""
+    """Data item properties dialog"""
     def __init__(self, parent, shape, title = _("Data properties")):
         self.parent = parent
         self.shape = shape
@@ -83,7 +83,7 @@ class ModelDataDialog(SimpleDialog):
         return label, etype
     
     def _layout(self):
-        """!Do layout"""
+        """Do layout"""
         if self.etype:
             self.dataSizer.Add(item = wx.StaticText(parent = self.panel, id = wx.ID_ANY,
                                                     label = _("Type of element:")),
@@ -100,18 +100,18 @@ class ModelDataDialog(SimpleDialog):
         self.sizer.Fit(self)
 
     def GetType(self):
-        """!Get element type"""
+        """Get element type"""
         if not self.etype:
             return
         return self.element.tcp.GetType()
 
     def OnType(self, event):
-        """!Select element type"""
+        """Select element type"""
         evalue = self.typeSelect.GetValue(event.GetString())
         self.element.SetType(evalue)
 
     def OnOK(self, event):
-        """!Ok pressed"""
+        """Ok pressed"""
         self.shape.SetValue(self.element.GetValue())
         if self.etype:
             elem = self.GetType()
@@ -130,7 +130,7 @@ class ModelDataDialog(SimpleDialog):
             self.Destroy()
     
     def OnCancel(self, event):
-        """!Cancel pressed"""
+        """Cancel pressed"""
         self.shape.SetPropDialog(None)
         if self.IsModal():
             event.Skip()
@@ -140,12 +140,12 @@ class ModelDataDialog(SimpleDialog):
 class ModelSearchDialog(wx.Dialog):
     def __init__(self, parent, title = _("Add GRASS command to the model"),
                  style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER, **kwargs):
-        """!Graphical modeler module search window
+        """Graphical modeler module search window
         
-        @param parent parent window
-        @param id window id
-        @param title window title
-        @param kwargs wx.Dialogs' arguments
+        :param parent: parent window
+        :param id: window id
+        :param title: window title
+        :param kwargs: wx.Dialogs' arguments
         """
         self.parent = parent
         
@@ -226,7 +226,7 @@ class ModelSearchDialog(wx.Dialog):
         self.Layout()
 
     def GetPanel(self):
-        """!Get dialog panel"""
+        """Get dialog panel"""
         return self.panel
 
     def _getCmd(self):
@@ -241,11 +241,11 @@ class ModelSearchDialog(wx.Dialog):
         return cmd
 
     def GetCmd(self):
-        """!Get command"""
+        """Get command"""
         return self._command
 
     def GetLabel(self):
-        """!Get label and comment"""
+        """Get label and comment"""
         return self.label.GetValue(), self.comment.GetValue()
     
     def ValidateCmd(self, cmd):
@@ -263,13 +263,13 @@ class ModelSearchDialog(wx.Dialog):
         return True
 
     def OnCommand(self, cmd):
-        """!Command in prompt confirmed"""
+        """Command in prompt confirmed"""
         if self.ValidateCmd(cmd):
             self._command = cmd
             self.EndModal(wx.ID_OK)
 
     def OnOk(self, event):
-        """!Button 'OK' pressed"""
+        """Button 'OK' pressed"""
         cmd = self._getCmd()
         if self.ValidateCmd(cmd):
             self._command = cmd
@@ -280,7 +280,7 @@ class ModelSearchDialog(wx.Dialog):
         self.Hide()
         
     def Reset(self):
-        """!Reset dialog"""
+        """Reset dialog"""
         self.search.Reset()
         self.label.SetValue('')
         self.comment.SetValue('')
@@ -288,7 +288,7 @@ class ModelSearchDialog(wx.Dialog):
         self.cmd_prompt.SetFocus()
 
 class ModelRelationDialog(wx.Dialog):
-    """!Relation properties dialog"""
+    """Relation properties dialog"""
     def __init__(self, parent, shape, id = wx.ID_ANY, title = _("Relation properties"),
                  style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER, **kwargs):
         self.parent = parent
@@ -372,7 +372,7 @@ class ModelRelationDialog(wx.Dialog):
                       border = 5)
             
     def _getOptions(self):
-        """!Get relevant options"""
+        """Get relevant options"""
         items = []
         fromShape = self.shape.GetFrom()
         if not isinstance(fromShape, ModelData):
@@ -402,22 +402,22 @@ class ModelRelationDialog(wx.Dialog):
         return items
     
     def GetOption(self):
-        """!Get selected option"""
+        """Get selected option"""
         return self.option.GetStringSelection()
     
     def IsValid(self):
-        """!Check if relation is valid"""
+        """Check if relation is valid"""
         return self.valid
     
     def OnOption(self, event):
-        """!Set option"""
+        """Set option"""
         if event.GetString():
             self.btnOk.Enable()
         else:
             self.btnOk.Enable(False)
 
 class ModelItemDialog(wx.Dialog):
-    """!Abstract item properties dialog"""
+    """Abstract item properties dialog"""
     def __init__(self, parent, shape, title, id = wx.ID_ANY,
                  style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER, **kwargs):
         self.parent = parent
@@ -445,15 +445,15 @@ class ModelItemDialog(wx.Dialog):
         self.btnOk.SetDefault()
         
     def _layout(self):
-        """!Do layout (virtual method)"""
+        """Do layout (virtual method)"""
         pass
     
     def GetCondition(self):
-        """!Get loop condition"""
+        """Get loop condition"""
         return self.condText.GetValue()
 
 class ModelLoopDialog(ModelItemDialog):
-    """!Loop properties dialog"""
+    """Loop properties dialog"""
     def __init__(self, parent, shape, id = wx.ID_ANY, title = _("Loop properties"),
                  style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER, **kwargs):
         ModelItemDialog.__init__(self, parent, shape, title,
@@ -472,7 +472,7 @@ class ModelLoopDialog(ModelItemDialog):
         self.SetSize((500, 400))
         
     def _layout(self):
-        """!Do layout"""
+        """Do layout"""
         sizer = wx.BoxSizer(wx.VERTICAL)
         
         condSizer = wx.StaticBoxSizer(self.condBox, wx.HORIZONTAL)
@@ -503,11 +503,11 @@ class ModelLoopDialog(ModelItemDialog):
         self.Layout()
         
     def GetItems(self):
-        """!Get list of selected actions"""
+        """Get list of selected actions"""
         return self.itemList.GetItems()
 
     def OnSeries(self, event):
-        """!Define map series as condition"""
+        """Define map series as condition"""
         dialog = MapLayersDialogForModeler(parent = self, title = _("Define series of maps"))
         if dialog.ShowModal() != wx.ID_OK:
             dialog.Destroy()
@@ -522,7 +522,7 @@ class ModelLoopDialog(ModelItemDialog):
         dialog.Destroy()
 
 class ModelConditionDialog(ModelItemDialog):
-    """!Condition properties dialog"""
+    """Condition properties dialog"""
     def __init__(self, parent, shape, id = wx.ID_ANY, title = _("If-else properties"),
                  style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER, **kwargs):
         ModelItemDialog.__init__(self, parent, shape, title,
@@ -547,7 +547,7 @@ class ModelConditionDialog(ModelItemDialog):
         self.SetSize((500, 400))
         
     def _layout(self):
-        """!Do layout"""
+        """Do layout"""
         sizer = wx.BoxSizer(wx.VERTICAL)
         
         condSizer = wx.StaticBoxSizer(self.condBox, wx.VERTICAL)
@@ -581,7 +581,7 @@ class ModelConditionDialog(ModelItemDialog):
         self.Layout()
 
     def OnCheckItemIf(self, index, flag):
-        """!Item in if-block checked/unchecked"""
+        """Item in if-block checked/unchecked"""
         if flag is False:
             return
         
@@ -590,7 +590,7 @@ class ModelConditionDialog(ModelItemDialog):
             self.itemListElse.CheckItemById(aId, False)
             
     def OnCheckItemElse(self, index, flag):
-        """!Item in else-block checked/unchecked"""
+        """Item in else-block checked/unchecked"""
         if flag is False:
             return
         
@@ -599,7 +599,7 @@ class ModelConditionDialog(ModelItemDialog):
             self.itemListIf.CheckItemById(aId, False)
         
     def GetItems(self):
-        """!Get items"""
+        """Get items"""
         return { 'if'   : self.itemListIf.GetItems(),
                  'else' : self.itemListElse.GetItems() }
 
@@ -609,7 +609,7 @@ class ModelListCtrl(wx.ListCtrl,
     def __init__(self, parent, columns, frame, id = wx.ID_ANY, columnsNotEditable = [],
                  style = wx.LC_REPORT | wx.BORDER_NONE |
                  wx.LC_HRULES | wx.LC_VRULES, **kwargs):
-        """!List of model variables"""
+        """List of model variables"""
         self.parent = parent
         self.columns = columns
         self.shape = None
@@ -636,7 +636,7 @@ class ModelListCtrl(wx.ListCtrl,
         self.Bind(wx.EVT_RIGHT_UP, self.OnRightUp)            #wxGTK
                 
     def OnBeginEdit(self, event):
-        """!Editing of item started"""
+        """Editing of item started"""
         if self.columnNotEditable and event.m_col in self.columnNotEditable:
             event.Veto()
             self.SetItemState(event.m_itemIndex,
@@ -645,30 +645,30 @@ class ModelListCtrl(wx.ListCtrl,
             event.Allow()
 
     def OnEndEdit(self, event):
-        """!Finish editing of item"""
+        """Finish editing of item"""
         pass
     
     def GetListCtrl(self):
-        """!Used by ColumnSorterMixin"""
+        """Used by ColumnSorterMixin"""
         return self
     
     def OnColClick(self, event):
-        """!Click on column header (order by)"""
+        """Click on column header (order by)"""
         event.Skip()
 
 class VariableListCtrl(ModelListCtrl):
     def __init__(self, parent, columns, **kwargs):
-        """!List of model variables"""
+        """List of model variables"""
         ModelListCtrl.__init__(self, parent, columns, **kwargs)
 
         self.SetColumnWidth(2, 200) # default value
 
     def GetData(self):
-        """!Get list data"""
+        """Get list data"""
         return self.itemDataMap
     
     def Populate(self, data):
-        """!Populate the list"""
+        """Populate the list"""
         self.itemDataMap = dict()
         i = 0
         for name, values in data.iteritems():
@@ -690,10 +690,10 @@ class VariableListCtrl(ModelListCtrl):
             i += 1
         
     def Append(self, name, vtype, value, desc):
-        """!Append new item to the list
+        """Append new item to the list
 
-        @return None on success
-        @return error string
+        :return: None on success
+        :return: error string
         """
         for iname, ivtype, ivalue, idesc in self.itemDataMap.itervalues():
             if iname == name:
@@ -713,7 +713,7 @@ class VariableListCtrl(ModelListCtrl):
         return None
 
     def OnRemove(self, event):
-        """!Remove selected variable(s) from the model"""
+        """Remove selected variable(s) from the model"""
         item = self.GetFirstSelected()
         while item != -1:
             self.DeleteItem(item)
@@ -724,7 +724,7 @@ class VariableListCtrl(ModelListCtrl):
         event.Skip()
         
     def OnRemoveAll(self, event):
-        """!Remove all variable(s) from the model"""
+        """Remove all variable(s) from the model"""
         dlg = wx.MessageBox(parent=self,
                             message=_("Do you want to delete all variables from "
                                       "the model?"),
@@ -739,7 +739,7 @@ class VariableListCtrl(ModelListCtrl):
         self.parent.UpdateModelVariables()
         
     def OnEndEdit(self, event):
-        """!Finish editing of item"""
+        """Finish editing of item"""
         itemIndex = event.GetIndex()
         columnIndex = event.GetColumn()
         nameOld = self.GetItem(itemIndex, 0).GetText()
@@ -752,11 +752,11 @@ class VariableListCtrl(ModelListCtrl):
         self.parent.UpdateModelVariables()
 
     def OnReload(self, event):
-        """!Reload list of variables"""
+        """Reload list of variables"""
         self.Populate(self.parent.parent.GetModel().GetVariables())
 
     def OnRightUp(self, event):
-        """!Mouse right button up"""
+        """Mouse right button up"""
         if not hasattr(self, "popupID1"):
             self.popupID1 = wx.NewId()
             self.popupID2 = wx.NewId()
@@ -781,7 +781,7 @@ class VariableListCtrl(ModelListCtrl):
 
 class ItemListCtrl(ModelListCtrl):
     def __init__(self, parent, columns, frame, disablePopup = False, **kwargs):
-        """!List of model actions"""
+        """List of model actions"""
         self.disablePopup = disablePopup
 
         ModelListCtrl.__init__(self, parent, columns, frame, **kwargs)
@@ -792,11 +792,11 @@ class ItemListCtrl(ModelListCtrl):
         self.SetColumnWidth(2, 65)
         
     def GetData(self):
-        """!Get list data"""
+        """Get list data"""
         return self.itemDataMap
     
     def Populate(self, data):
-        """!Populate the list"""
+        """Populate the list"""
         self.itemDataMap = dict()
         self.itemIdMap = list()
         
@@ -864,7 +864,7 @@ class ItemListCtrl(ModelListCtrl):
                 i += 1
                 
     def OnRemove(self, event):
-        """!Remove selected action(s) from the model"""
+        """Remove selected action(s) from the model"""
         model = self.frame.GetModel()
         canvas = self.frame.GetCanvas()
         
@@ -888,7 +888,7 @@ class ItemListCtrl(ModelListCtrl):
         event.Skip()
     
     def OnEndEdit(self, event):
-        """!Finish editing of item"""
+        """Finish editing of item"""
         itemIndex = event.GetIndex()
         columnIndex = event.GetColumn()
         self.itemDataMap[itemIndex][columnIndex] = event.GetText()
@@ -901,11 +901,11 @@ class ItemListCtrl(ModelListCtrl):
         self.frame.ModelChanged()
 
     def OnReload(self, event = None):
-        """!Reload list of actions"""
+        """Reload list of actions"""
         self.Populate(self.frame.GetModel().GetItems(objType=ModelAction))
 
     def OnRightUp(self, event):
-        """!Mouse right button up"""
+        """Mouse right button up"""
         if self.disablePopup:
             return
         
@@ -928,10 +928,10 @@ class ItemListCtrl(ModelListCtrl):
         menu.Destroy()
     
     def MoveItems(self, items, up):
-        """!Move items in the list
+        """Move items in the list
 
-        @param items list of items to move
-        @param up True to move up otherwise down
+        :param items: list of items to move
+        :param up: True to move up otherwise down
         """
         if len(items) < 1:
             return
@@ -980,11 +980,11 @@ class ItemCheckListCtrl(ItemListCtrl, listmix.CheckListCtrlMixin):
         self.shape  = shape
         
     def OnBeginEdit(self, event):
-        """!Disable editing"""
+        """Disable editing"""
         event.Veto()
         
     def OnCheckItem(self, index, flag):
-        """!Item checked/unchecked"""
+        """Item checked/unchecked"""
         name = self.GetLabel()
         if name == 'IfBlockList' and self.window:
             self.window.OnCheckItemIf(index, flag)
@@ -992,7 +992,7 @@ class ItemCheckListCtrl(ItemListCtrl, listmix.CheckListCtrlMixin):
             self.window.OnCheckItemElse(index, flag)
         
     def GetItems(self):
-        """!Get list of selected actions"""
+        """Get list of selected actions"""
         ids = { 'checked'   : list(),
                 'unchecked' : list() }
         
@@ -1006,7 +1006,7 @@ class ItemCheckListCtrl(ItemListCtrl, listmix.CheckListCtrlMixin):
         return ids
 
     def CheckItemById(self, aId, flag):
-        """!Check/uncheck given item by id"""
+        """Check/uncheck given item by id"""
         for i in range(self.GetItemCount()):
             iId = int(self.GetItem(i, 0).GetText())
             if iId == aId:

+ 112 - 106
gui/wxpython/gmodeler/frame.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package gmodeler.frame
 
 @brief wxGUI Graphical Modeler for creating, editing, and managing models
@@ -61,13 +61,13 @@ from grass.script import core as grass
 class ModelFrame(wx.Frame):
     def __init__(self, parent, giface, id = wx.ID_ANY,
                  title = _("GRASS GIS Graphical Modeler"), **kwargs):
-        """!Graphical modeler main window
+        """Graphical modeler main window
         
-        @param parent parent window
-        @param id window id
-        @param title window title
+        :param parent: parent window
+        :param id: window id
+        :param title: window title
 
-        @param kwargs wx.Frames' arguments
+        :param kwargs: wx.Frames' arguments
         """
         self.parent = parent
         self._giface = giface
@@ -146,7 +146,7 @@ class ModelFrame(wx.Frame):
             self.goutput.SetSashPosition(int(self.GetSize()[1] * .75))
         
     def _layout(self):
-        """!Do layout"""
+        """Do layout"""
         sizer = wx.BoxSizer(wx.VERTICAL)
 
         sizer.Add(item = self.notebook, proportion = 1,
@@ -159,7 +159,7 @@ class ModelFrame(wx.Frame):
         self.Layout()
 
     def _addEvent(self, item):
-        """!Add event to item"""
+        """Add event to item"""
         evthandler = ModelEvtHandler(self.statusbar,
                                      self)
         evthandler.SetShape(item)
@@ -167,19 +167,19 @@ class ModelFrame(wx.Frame):
         item.SetEventHandler(evthandler)
 
     def _randomShift(self):
-        """!Returns random value to shift layout"""
+        """Returns random value to shift layout"""
         return random.randint(-self.randomness, self.randomness)
 
     def GetCanvas(self):
-        """!Get canvas"""
+        """Get canvas"""
         return self.canvas
     
     def GetModel(self):
-        """!Get model"""
+        """Get model"""
         return self.model
     
     def ModelChanged(self, changed = True):
-        """!Update window title"""
+        """Update window title"""
         self.modelChanged = changed
         
         if self.modelFile:
@@ -191,7 +191,7 @@ class ModelFrame(wx.Frame):
             self.SetTitle(self.baseTitle)
 
     def OnPageChanged(self, event):
-        """!Page in notebook changed"""
+        """Page in notebook changed"""
         page = event.GetSelection()
         if page == self.notebook.GetPageIndexByName('python'):
             if self.pythonPanel.IsEmpty():
@@ -205,22 +205,22 @@ class ModelFrame(wx.Frame):
         event.Skip()
 
     def OnVariables(self, event):
-        """!Switch to variables page"""
+        """Switch to variables page"""
         self.notebook.SetSelectionByName('variables')
         
     def OnRemoveItem(self, event):
-        """!Remove shape
+        """Remove shape
         """
         self.GetCanvas().RemoveSelected()
         
     def OnCanvasRefresh(self, event):
-        """!Refresh canvas"""
+        """Refresh canvas"""
         self.SetStatusText(_("Redrawing model..."), 0)
         self.GetCanvas().Refresh()
         self.SetStatusText("", 0)
 
     def OnCmdRun(self, event):
-        """!Run command"""
+        """Run command"""
         try:
             action = self.GetModel().GetItems()[event.pid]
             if hasattr(action, "task"):
@@ -229,7 +229,7 @@ class ModelFrame(wx.Frame):
             pass
         
     def OnCmdPrepare(self, event):
-        """!Prepare for running command"""
+        """Prepare for running command"""
         if not event.userData:
             return
         
@@ -237,7 +237,7 @@ class ModelFrame(wx.Frame):
                         params = event.userData['params'])
         
     def OnCmdDone(self, event):
-        """!Command done (or aborted)"""
+        """Command done (or aborted)"""
         self.goutput.GetProgressBar().SetValue(0)
         try:
             action = self.GetModel().GetItems()[event.pid]
@@ -247,7 +247,7 @@ class ModelFrame(wx.Frame):
             pass
 
     def OnCloseWindow(self, event):
-        """!Close window"""
+        """Close window"""
         if self.modelChanged and \
                 UserSettings.Get(group='manager', key='askOnQuit', subkey='enabled'):
             if self.modelFile:
@@ -276,12 +276,12 @@ class ModelFrame(wx.Frame):
         self.Destroy()
 
     def OnSize(self, event):
-        """!Window resized, save to the model"""
+        """Window resized, save to the model"""
         self.ModelChanged()
         event.Skip()
         
     def OnPreferences(self, event):
-        """!Open preferences dialog"""
+        """Open preferences dialog"""
         dlg = PreferencesDialog(parent = self, giface = self._giface)
         dlg.CenterOnParent()
         
@@ -289,11 +289,11 @@ class ModelFrame(wx.Frame):
         self.canvas.Refresh()
         
     def OnHelp(self, event):
-        """!Show help"""
+        """Show help"""
         self._giface.Help(entry = 'wxGUI.gmodeler')
 
     def OnModelProperties(self, event):
-        """!Model properties dialog"""
+        """Model properties dialog"""
         dlg = PropertiesDialog(parent = self)
         dlg.CentreOnParent()
         properties = self.model.GetProperties()
@@ -308,7 +308,7 @@ class ModelFrame(wx.Frame):
         dlg.Destroy()
         
     def OnDeleteData(self, event):
-        """!Delete intermediate data"""
+        """Delete intermediate data"""
         rast, vect, rast3d, msg = self.model.GetIntermediateData()
         
         if not rast and not vect and not rast3d:
@@ -326,11 +326,14 @@ class ModelFrame(wx.Frame):
             dlg.Destroy()
             
             if rast:
-                self._gconsole.RunCmd(['g.remove', '-f', 'type=rast', 'name=%s' %','.join(rast)])
+                self._gconsole.RunCmd(['g.remove', '-f', 'type=rast',
+                                       'name=%s' %','.join(rast)])
             if rast3d:
-                self._gconsole.RunCmd(['g.remove', '-f', 'type=rast3d', 'name=%s' %','.join(rast3d)])
+                self._gconsole.RunCmd(['g.remove', '-f', 'type=rast3d',
+                                       'name=%s' %','.join(rast3d)])
             if vect:
-                self._gconsole.RunCmd(['g.remove', '-f', 'type=vect', 'name=%s' %','.join(vect)])
+                self._gconsole.RunCmd(['g.remove', '-f', 'type=vect',
+                                       'name=%s' %','.join(vect)])
             
             self.SetStatusText(_("%d maps deleted from current mapset") % \
                                  int(len(rast) + len(rast3d) + len(vect)))
@@ -339,7 +342,7 @@ class ModelFrame(wx.Frame):
         dlg.Destroy()
                 
     def OnModelNew(self, event):
-        """!Create new model"""
+        """Create new model"""
         Debug.msg(4, "ModelFrame.OnModelNew():")
         
         # ask user to save current model
@@ -375,9 +378,9 @@ class ModelFrame(wx.Frame):
         self.SetTitle(self.baseTitle)
         
     def GetModelFile(self, ext=True):
-        """!Get model file
+        """Get model file
 
-        @param ext False to avoid extension
+        :param bool ext: False to avoid extension
         """
         if not self.modelFile:
             return ''
@@ -386,7 +389,7 @@ class ModelFrame(wx.Frame):
         return os.path.splitext(self.modelFile)[0]
     
     def OnModelOpen(self, event):
-        """!Load model from file"""
+        """Load model from file"""
         filename = ''
         dlg = wx.FileDialog(parent = self, message=_("Choose model file"),
                             defaultDir = os.getcwd(),
@@ -411,7 +414,7 @@ class ModelFrame(wx.Frame):
                                  'actions' : self.model.GetNumItems(actionOnly = True) }, 0)
         
     def OnModelSave(self, event = None):
-        """!Save model to file"""
+        """Save model to file"""
         if self.modelFile and self.modelChanged:
             dlg = wx.MessageDialog(self, message=_("Model file <%s> already exists. "
                                                    "Do you want to overwrite this file?") % \
@@ -429,7 +432,7 @@ class ModelFrame(wx.Frame):
             self.OnModelSaveAs(None)
         
     def OnModelSaveAs(self, event):
-        """!Create model to file as"""
+        """Create model to file as"""
         filename = ''
         dlg = wx.FileDialog(parent = self,
                             message = _("Choose file to save current model"),
@@ -466,7 +469,7 @@ class ModelFrame(wx.Frame):
         self.SetStatusText(_('File <%s> saved') % self.modelFile, 0)
 
     def OnModelClose(self, event = None):
-        """!Close model file"""
+        """Close model file"""
         Debug.msg(4, "ModelFrame.OnModelClose(): file=%s" % self.modelFile)
         # ask user to save current model
         if self.modelFile and self.modelChanged:
@@ -497,13 +500,14 @@ class ModelFrame(wx.Frame):
         self.canvas.Refresh()
         
     def OnRunModel(self, event):
-        """!Run entire model"""
+        """Run entire model"""
         self.model.Run(self._gconsole, self.OnDone, parent = self)
         
     def OnDone(self, cmd, returncode):
-        """!Computation finished
+        """Computation finished
 
-        @todo: not called -- must be fixed
+        .. todo::
+            not called -- must be fixed
         """
         self.SetStatusText('', 0)
         # restore original files
@@ -521,7 +525,7 @@ class ModelFrame(wx.Frame):
             del self.model.fileInput
         
     def OnValidateModel(self, event, showMsg = True):
-        """!Validate entire model"""
+        """Validate entire model"""
         if self.model.GetNumItems() < 1:
             GMessage(parent = self, 
                      message = _('Model is empty. Nothing to validate.'))
@@ -540,7 +544,7 @@ class ModelFrame(wx.Frame):
                      message = _('Model is valid.'))
     
     def OnExportImage(self, event):
-        """!Export model to image (default image)
+        """Export model to image (default image)
         """
         xminImg = 0
         xmaxImg = 0
@@ -603,20 +607,21 @@ class ModelFrame(wx.Frame):
         dlg.Destroy()
         
     def OnExportPython(self, event = None, text = None):
-        """!Export model to Python script"""
+        """Export model to Python script"""
         filename = self.pythonPanel.SaveAs(force = True)
         self.SetStatusText(_("Model exported to <%s>") % filename)
 
     def OnDefineRelation(self, event):
-        """!Define relation between data and action items"""
+        """Define relation between data and action items"""
         self.canvas.SetCursor(self.cursors["cross"])
         self.defineRelation = { 'from' : None,
                                 'to'   : None }
         
     def OnDefineLoop(self, event):
-        """!Define new loop in the model
+        """Define new loop in the model
 
-        @todo: move to ModelCanvas?
+        .. todo::
+            move to ModelCanvas?
         """
         self.ModelChanged()
         
@@ -632,9 +637,10 @@ class ModelFrame(wx.Frame):
         self.canvas.Refresh()
         
     def OnDefineCondition(self, event):
-        """!Define new condition in the model
+        """Define new condition in the model
 
-        @todo: move to ModelCanvas?
+        .. todo::
+            move to ModelCanvas?
         """
         self.ModelChanged()
         
@@ -650,7 +656,7 @@ class ModelFrame(wx.Frame):
         self.canvas.Refresh()
     
     def OnAddAction(self, event):
-        """!Add action to model"""
+        """Add action to model"""
         if self.searchDialog is None:
             self.searchDialog = ModelSearchDialog(self)
             self.searchDialog.CentreOnParent()
@@ -706,7 +712,7 @@ class ModelFrame(wx.Frame):
             win.Raise()
         
     def OnAddData(self, event):
-        """!Add data item to model
+        """Add data item to model
         """
         # add action to canvas
         width, height = self.canvas.GetSize()
@@ -733,7 +739,7 @@ class ModelFrame(wx.Frame):
         self.canvas.Refresh()
 
     def OnAddComment(self, event):
-        """!Add comment to the model"""
+        """Add comment to the model"""
         dlg = wx.TextEntryDialog(parent = self, message = _("Comment:"), caption = _("Add comment"),
                                  style = wx.OK | wx.CANCEL | wx.CENTRE | wx.TE_MULTILINE)
         if dlg.ShowModal() == wx.ID_OK:
@@ -759,7 +765,7 @@ class ModelFrame(wx.Frame):
         event.Skip()
 
     def _switchPage(self, notification):
-        """!Manages @c 'output' notebook page according to event notification."""
+        """Manages @c 'output' notebook page according to event notification."""
         if notification == Notification.HIGHLIGHT:
             self.notebook.HighlightPageByName('output')
         if notification == Notification.MAKE_VISIBLE:
@@ -770,11 +776,11 @@ class ModelFrame(wx.Frame):
             self.Raise()
 
     def OnAbout(self, event):
-        """!Display About window"""
+        """Display About window"""
         ShowAboutDialog(prgName=_('wxGUI Graphical Modeler'), startYear='2010')
         
     def GetOptData(self, dcmd, layer, params, propwin):
-        """!Process action data"""
+        """Process action data"""
         if params: # add data items
             width, height = self.canvas.GetSize()
             x = width/2 - 200 + self._randomShift()
@@ -833,9 +839,9 @@ class ModelFrame(wx.Frame):
         self.SetStatusText(layer.GetLog(), 0)
         
     def AddLine(self, rel):
-        """!Add connection between model objects
+        """Add connection between model objects
         
-        @param rel relation
+        :param rel: relation
         """
         fromShape = rel.GetFrom()
         toShape   = rel.GetTo()
@@ -860,7 +866,7 @@ class ModelFrame(wx.Frame):
         rel.Show(True)
         
     def LoadModelFile(self, filename):
-        """!Load model definition stored in GRASS Model XML file (gxm)
+        """Load model definition stored in GRASS Model XML file (gxm)
         """
         try:
             self.model.LoadModel(filename)
@@ -930,10 +936,10 @@ class ModelFrame(wx.Frame):
         self.canvas.Refresh(True)
         
     def WriteModelFile(self, filename):
-        """!Save model to model file, recover original file on error.
+        """Save model to model file, recover original file on error.
         
-        @return True on success
-        @return False on failure
+        :return: True on success
+        :return: False on failure
         """
         self.ModelChanged(False)
         tmpfile = tempfile.TemporaryFile(mode='w+b')
@@ -961,7 +967,7 @@ class ModelFrame(wx.Frame):
         return True
     
     def DefineLoop(self, loop):
-        """!Define loop with given list of items"""
+        """Define loop with given list of items"""
         parent = loop
         items = loop.GetItems(self.GetModel().GetItems())
         if not items:
@@ -1005,7 +1011,7 @@ class ModelFrame(wx.Frame):
         self.canvas.Refresh()
 
     def DefineCondition(self, condition):
-        """!Define if-else statement with given list of items"""
+        """Define if-else statement with given list of items"""
         items = condition.GetItems(self.model.GetItems(objType=ModelAction))
         if not items['if'] and not items['else']:
             return
@@ -1037,7 +1043,7 @@ class ModelFrame(wx.Frame):
         self.canvas.Refresh()
         
 class ModelCanvas(ogl.ShapeCanvas):
-    """!Canvas where model is drawn"""
+    """Canvas where model is drawn"""
     def __init__(self, parent):
         self.parent = parent
         ogl.OGLInitialize()
@@ -1053,7 +1059,7 @@ class ModelCanvas(ogl.ShapeCanvas):
         self.Bind(wx.EVT_LEFT_DOWN,  self.OnLeftDown)
 
     def OnKeyUp(self, event):
-        """!Key pressed"""
+        """Key pressed"""
         kc = event.GetKeyCode()
         if kc == wx.WXK_DELETE:
             self.RemoveSelected()
@@ -1063,7 +1069,7 @@ class ModelCanvas(ogl.ShapeCanvas):
         evt.Skip()
 
     def RemoveSelected(self):
-        """!Remove selected shapes"""
+        """Remove selected shapes"""
         self.parent.ModelChanged()
         
         diagram = self.GetDiagram()
@@ -1071,7 +1077,7 @@ class ModelCanvas(ogl.ShapeCanvas):
         self.RemoveShapes(shapes)
 
     def RemoveShapes(self, shapes):
-        """!Removes shapes"""
+        """Removes shapes"""
         self.parent.ModelChanged()
         diagram = self.GetDiagram()
         for shape in shapes:
@@ -1089,9 +1095,9 @@ class ModelCanvas(ogl.ShapeCanvas):
         self.Refresh()
         
     def GetNewShapePos(self):
-        """!Determine optimal position for newly added object
+        """Determine optimal position for newly added object
 
-        @return x,y
+        :return: x,y
         """
         xNew, yNew = map(lambda x: x / 2, self.GetSize())
         diagram = self.GetDiagram()
@@ -1105,7 +1111,7 @@ class ModelCanvas(ogl.ShapeCanvas):
         return xNew, yNew
 
     def GetShapesSelected(self):
-        """!Get list of selected shapes"""
+        """Get list of selected shapes"""
         selected = list()
         diagram = self.GetDiagram()
         for shape in diagram.GetShapeList():
@@ -1115,7 +1121,7 @@ class ModelCanvas(ogl.ShapeCanvas):
         return selected
 
 class ModelEvtHandler(ogl.ShapeEvtHandler):
-    """!Model event handler class"""
+    """Model event handler class"""
     def __init__(self, log, frame):
         ogl.ShapeEvtHandler.__init__(self)
         self.log = log
@@ -1123,7 +1129,7 @@ class ModelEvtHandler(ogl.ShapeEvtHandler):
         self.x = self.y = None
         
     def OnLeftClick(self, x, y, keys = 0, attachment = 0):
-        """!Left mouse button pressed -> select item & update statusbar"""
+        """Left mouse button pressed -> select item & update statusbar"""
         shape = self.GetShape()
         canvas = shape.GetCanvas()
         dc = wx.ClientDC(canvas)
@@ -1166,11 +1172,11 @@ class ModelEvtHandler(ogl.ShapeEvtHandler):
             self.log.SetStatusText('', 0)
         
     def OnLeftDoubleClick(self, x, y, keys = 0, attachment = 0):
-        """!Left mouse button pressed (double-click) -> show properties"""
+        """Left mouse button pressed (double-click) -> show properties"""
         self.OnProperties()
         
     def OnProperties(self, event = None):
-        """!Show properties dialog"""
+        """Show properties dialog"""
         self.frame.ModelChanged()
         shape = self.GetShape()
         if isinstance(shape, ModelAction):
@@ -1233,13 +1239,13 @@ class ModelEvtHandler(ogl.ShapeEvtHandler):
             dlg.Destroy()
                    
     def OnBeginDragLeft(self, x, y, keys = 0, attachment = 0):
-        """!Drag shape (begining)"""
+        """Drag shape (begining)"""
         self.frame.ModelChanged()
         if self._previousHandler:
             self._previousHandler.OnBeginDragLeft(x, y, keys, attachment)
         
     def OnEndDragLeft(self, x, y, keys = 0, attachment = 0):
-        """!Drag shape (end)"""
+        """Drag shape (end)"""
         if self._previousHandler:
             self._previousHandler.OnEndDragLeft(x, y, keys, attachment)
         
@@ -1260,13 +1266,13 @@ class ModelEvtHandler(ogl.ShapeEvtHandler):
         canvas.Refresh()
 
     def OnEndSize(self, x, y):
-        """!Resize shape"""
+        """Resize shape"""
         self.frame.ModelChanged()
         if self._previousHandler:
             self._previousHandler.OnEndSize(x, y)
         
     def OnRightClick(self, x, y, keys = 0, attachment = 0):
-        """!Right click -> pop-up menu"""
+        """Right click -> pop-up menu"""
         if not hasattr (self, "popupID"):
             self.popupID = dict()
             for key in ('remove', 'enable', 'addPoint',
@@ -1330,11 +1336,11 @@ class ModelEvtHandler(ogl.ShapeEvtHandler):
         popupMenu.Destroy()
 
     def OnDisable(self, event):
-        """!Disable action"""
+        """Disable action"""
         self._onEnable(False)
         
     def OnEnable(self, event):
-        """!Disable action"""
+        """Disable action"""
         self._onEnable(True)
         
     def _onEnable(self, enable):
@@ -1389,7 +1395,7 @@ class ModelEvtHandler(ogl.ShapeEvtHandler):
         canvas.Refresh(False)
         
     def OnAddPoint(self, event):
-        """!Add control point"""
+        """Add control point"""
         shape = self.GetShape()
         shape.InsertLineControlPoint(point = wx.RealPoint(self.x, self.y))
         shape.ResetShapes()
@@ -1398,7 +1404,7 @@ class ModelEvtHandler(ogl.ShapeEvtHandler):
         self.frame.canvas.Refresh()
         
     def OnRemovePoint(self, event):
-        """!Remove control point"""
+        """Remove control point"""
         shape = self.GetShape()
         shape.DeleteLineControlPoint()
         shape.Select(False)
@@ -1407,14 +1413,14 @@ class ModelEvtHandler(ogl.ShapeEvtHandler):
         self.frame.canvas.Refresh()
         
     def OnIntermediate(self, event):
-        """!Mark data as intermediate"""
+        """Mark data as intermediate"""
         self.frame.ModelChanged()
         shape = self.GetShape()
         shape.SetIntermediate(event.IsChecked())
         self.frame.canvas.Refresh()
 
     def OnRemove(self, event):
-        """!Remove shape
+        """Remove shape
         """
         self.frame.GetCanvas().RemoveShapes([self.GetShape()])
         self.frame.itemPanel.Update()
@@ -1422,7 +1428,7 @@ class ModelEvtHandler(ogl.ShapeEvtHandler):
 class VariablePanel(wx.Panel):
     def __init__(self, parent, id = wx.ID_ANY,
                  **kwargs):
-        """!Manage model variables panel
+        """Manage model variables panel
         """
         self.parent = parent
         
@@ -1468,7 +1474,7 @@ class VariablePanel(wx.Panel):
         self._layout()
 
     def _layout(self):
-        """!Layout dialog"""
+        """Layout dialog"""
         listSizer = wx.StaticBoxSizer(self.listBox, wx.VERTICAL)
         listSizer.Add(item = self.list, proportion = 1,
                       flag = wx.EXPAND)
@@ -1519,14 +1525,14 @@ class VariablePanel(wx.Panel):
         mainSizer.Fit(self)
         
     def OnText(self, event):
-        """!Text entered"""
+        """Text entered"""
         if self.name.GetValue():
             self.btnAdd.Enable()
         else:
             self.btnAdd.Enable(False)
     
     def OnAdd(self, event):
-        """!Add new variable to the list"""
+        """Add new variable to the list"""
         msg = self.list.Append(self.name.GetValue(),
                                self.type.GetStringSelection(),
                                self.value.GetValue(),
@@ -1544,7 +1550,7 @@ class VariablePanel(wx.Panel):
             self.UpdateModelVariables()
         
     def UpdateModelVariables(self):
-        """!Update model variables"""
+        """Update model variables"""
         variables = dict()
         for values in self.list.GetData().itervalues():
             name = values[0]
@@ -1558,18 +1564,18 @@ class VariablePanel(wx.Panel):
         self.parent.ModelChanged()
 
     def Update(self):
-        """!Reload list of variables"""
+        """Reload list of variables"""
         self.list.OnReload(None)
         
     def Reset(self):
-        """!Remove all variables"""
+        """Remove all variables"""
         self.list.DeleteAllItems()
         self.parent.GetModel().SetVariables([])
         
 class ItemPanel(wx.Panel):
     def __init__(self, parent, id = wx.ID_ANY,
                  **kwargs):
-        """!Manage model items
+        """Manage model items
         """
         self.parent = parent
         
@@ -1593,7 +1599,7 @@ class ItemPanel(wx.Panel):
         self._layout()
 
     def _layout(self):
-        """!Layout dialog"""
+        """Layout dialog"""
         listSizer = wx.StaticBoxSizer(self.listBox, wx.VERTICAL)
         listSizer.Add(item = self.list, proportion = 1,
                       flag = wx.EXPAND)
@@ -1613,11 +1619,11 @@ class ItemPanel(wx.Panel):
         mainSizer.Fit(self)
         
     def Update(self):
-        """!Reload list of variables"""
+        """Reload list of variables"""
         self.list.OnReload(None)
 
     def _getSelectedItems(self):
-        """!Get list of selected items, indeces start at 0"""
+        """Get list of selected items, indeces start at 0"""
         items = []
         current = -1
         while True:
@@ -1633,7 +1639,7 @@ class ItemPanel(wx.Panel):
         return items
     
     def OnMoveItemsUp(self, event):
-        """!Item moved up, update action ids"""
+        """Item moved up, update action ids"""
         items = self._getSelectedItems()
         if not items:
             return
@@ -1642,7 +1648,7 @@ class ItemPanel(wx.Panel):
         self.parent.ModelChanged()
 
     def OnMoveItemsDown(self, event):
-        """!Item moved up, update action ids"""
+        """Item moved up, update action ids"""
         items = self._getSelectedItems()
         if not items:
             return
@@ -1653,7 +1659,7 @@ class ItemPanel(wx.Panel):
 class PythonPanel(wx.Panel):
     def __init__(self, parent, id = wx.ID_ANY,
                  **kwargs):
-        """!Model as python script
+        """Model as python script
         """
         self.parent = parent
         
@@ -1704,7 +1710,7 @@ class PythonPanel(wx.Panel):
         self.SetSizer(sizer)
 
     def OnRun(self, event):
-        """!Run Python script"""
+        """Run Python script"""
         self.filename = grass.tempfile()
         try:
             fd = open(self.filename, "w")
@@ -1723,14 +1729,14 @@ class PythonPanel(wx.Panel):
         event.Skip()
 
     def OnDone(self, cmd, returncode):
-        """!Python script finished"""
+        """Python script finished"""
         try_remove(self.filename)
         self.filename = None
         
     def SaveAs(self, force = False):
-        """!Save python script to file
+        """Save python script to file
 
-        @return filename
+        :return: filename
         """
         filename = ''
         dlg = wx.FileDialog(parent = self,
@@ -1776,15 +1782,15 @@ class PythonPanel(wx.Panel):
         return filename
     
     def OnSaveAs(self, event):
-        """!Save python script to file"""
+        """Save python script to file"""
         self.SaveAs(force = False)
         event.Skip()
         
     def RefreshScript(self):
-        """!Refresh Python script
+        """Refresh Python script
 
-        @return True on refresh
-        @return False script hasn't been updated
+        :return: True on refresh
+        :return: False script hasn't been updated
         """
         if self.body.modified:
             dlg = wx.MessageDialog(self,
@@ -1810,15 +1816,15 @@ class PythonPanel(wx.Panel):
         return True
     
     def OnRefresh(self, event):
-        """!Refresh Python script"""
+        """Refresh Python script"""
         if self.RefreshScript():
             self.parent.SetStatusText(_('Python script is up-to-date'), 0)
         event.Skip()
         
     def IsModified(self):
-        """!Check if python script has been modified"""
+        """Check if python script has been modified"""
         return self.body.modified
     
     def IsEmpty(self):
-        """!Check if python script is empty"""
+        """Check if python script is empty"""
         return len(self.body.GetText()) == 0

+ 6 - 3
gui/wxpython/gmodeler/giface.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package gmodeler.giface
 
 @brief wxGUI Graphical Modeler GRASS interface
@@ -17,7 +17,7 @@ This program is free software under the GNU General Public License
 from grass.pydispatch.signal import Signal
 
 class GraphicalModelerGrassInterface():
-    """!@implements core::giface::GrassInterface"""
+    """@implements core::giface::GrassInterface"""
     def __init__(self, model):
         self._model = model
     
@@ -31,5 +31,8 @@ class GraphicalModelerGrassInterface():
         return self._model.GetMaps(prompt)
 
     def GetMapDisplay(self):
-        """@todo: implement connection with mapdisplay"""
+        """
+        ..todo::
+            implement connection with mapdisplay
+        """
         return None

+ 1 - 1
gui/wxpython/gmodeler/menudata.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package gmodeler.menudata
 
 @brief wxGUI Graphical Modeler - menu data

File diff suppressed because it is too large
+ 217 - 216
gui/wxpython/gmodeler/model.py


+ 12 - 12
gui/wxpython/gmodeler/preferences.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package gmodeler.preferences
 
 @brief wxGUI Graphical Modeler - preferences
@@ -24,7 +24,7 @@ from core.settings        import UserSettings
 from core.utils import _
 
 class PreferencesDialog(PreferencesBaseDialog):
-    """!User preferences dialog"""
+    """User preferences dialog"""
     def __init__(self, parent, giface, settings = UserSettings,
                  title = _("Modeler settings")):
         
@@ -42,7 +42,7 @@ class PreferencesDialog(PreferencesBaseDialog):
         self.SetSize(self.size)
 
     def _createGeneralPage(self, notebook):
-        """!Create notebook page for action settings"""
+        """Create notebook page for action settings"""
         panel = wx.Panel(parent = notebook, id = wx.ID_ANY)
         notebook.AddPage(page = panel, text = _("General"))
         
@@ -80,7 +80,7 @@ class PreferencesDialog(PreferencesBaseDialog):
         return panel
 
     def _createActionPage(self, notebook):
-        """!Create notebook page for action settings"""
+        """Create notebook page for action settings"""
         panel = wx.Panel(parent = notebook, id = wx.ID_ANY)
         notebook.AddPage(page = panel, text = _("Command"))
         
@@ -199,7 +199,7 @@ class PreferencesDialog(PreferencesBaseDialog):
         return panel
 
     def _createDataPage(self, notebook):
-        """!Create notebook page for data settings"""
+        """Create notebook page for data settings"""
         panel = wx.Panel(parent = notebook, id = wx.ID_ANY)
         notebook.AddPage(page = panel, text = _("Data"))
         
@@ -318,7 +318,7 @@ class PreferencesDialog(PreferencesBaseDialog):
         return panel
 
     def _createLoopPage(self, notebook):
-        """!Create notebook page for loop settings"""
+        """Create notebook page for loop settings"""
         panel = wx.Panel(parent = notebook, id = wx.ID_ANY)
         notebook.AddPage(page = panel, text = _("Loop"))
         
@@ -403,7 +403,7 @@ class PreferencesDialog(PreferencesBaseDialog):
         return panel
 
     def _createCommentPage(self, notebook):
-        """!Create notebook page for comment settings"""
+        """Create notebook page for comment settings"""
         panel = wx.Panel(parent = notebook, id = wx.ID_ANY)
         notebook.AddPage(page = panel, text = _("Comment"))
         
@@ -488,21 +488,21 @@ class PreferencesDialog(PreferencesBaseDialog):
         return panel
 
     def OnApply(self, event):
-        """!Button 'Apply' pressed"""
+        """Button 'Apply' pressed"""
         PreferencesBaseDialog.OnApply(self, event)
         
         self.parent.GetModel().Update()
         self.parent.GetCanvas().Refresh()
 
     def OnSave(self, event):
-        """!Button 'Save' pressed"""
+        """Button 'Save' pressed"""
         PreferencesBaseDialog.OnSave(self, event)
         
         self.parent.GetModel().Update()
         self.parent.GetCanvas().Refresh()
 
 class PropertiesDialog(wx.Dialog):
-    """!Model properties dialog
+    """Model properties dialog
     """
     def __init__(self, parent, id = wx.ID_ANY,
                  title = _('Model properties'),
@@ -600,14 +600,14 @@ class PropertiesDialog(wx.Dialog):
         self.Hide()
         
     def GetValues(self):
-        """!Get values"""
+        """Get values"""
         return { 'name'        : self.name.GetValue(),
                  'description' : self.desc.GetValue(),
                  'author'      : self.author.GetValue(),
                  'overwrite'   : self.overwrite.IsChecked() }
     
     def Init(self, prop):
-        """!Initialize dialog"""
+        """Initialize dialog"""
         self.name.SetValue(prop['name'])
         self.desc.SetValue(prop['description'])
         self.author.SetValue(prop['author'])

+ 3 - 3
gui/wxpython/gmodeler/toolbars.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package gmodeler.toolbars
 
 @brief wxGUI Graphical Modeler toolbars classes
@@ -26,7 +26,7 @@ from gui_core.toolbars import BaseToolbar, BaseIcons
 from icons.icon        import MetaIcon
 
 class ModelerToolbar(BaseToolbar):
-    """!Graphical modeler toolbaro (see gmodeler.py)
+    """Graphical modeler toolbaro (see gmodeler.py)
     """
     def __init__(self, parent):
         BaseToolbar.__init__(self, parent)
@@ -41,7 +41,7 @@ class ModelerToolbar(BaseToolbar):
         self.Realize()
         
     def _toolbarData(self):
-        """!Toolbar data"""
+        """Toolbar data"""
         icons = {
             'new'        : MetaIcon(img = 'create',
                                     label = _('Create new model (Ctrl+N)')),

File diff suppressed because it is too large
+ 188 - 182
gui/wxpython/gui_core/dialogs.py


+ 60 - 51
gui/wxpython/gui_core/forms.py

@@ -29,8 +29,8 @@ Updated to wxPython 2.8 syntax and contrib widgets.  Methods added to
 make it callable by gui.  Method added to automatically re-run with
 pythonw on a Mac.
 
-@todo
- - verify option value types
+.. todo::
+    verify option value types
 
 Copyright(C) 2000-2013 by the GRASS Development Team
 
@@ -97,7 +97,7 @@ from core.giface import Notification
 wxUpdateDialog, EVT_DIALOG_UPDATE = NewEvent()
 
 
-"""!Hide some options in the GUI"""
+"""Hide some options in the GUI"""
 #_blackList = { 'enabled' : False,
 #               'items'   : { 'r.buffer' : {'params' : ['input', 'output'],
 #                                           'flags' : ['z', 'overwrite']}}}
@@ -106,7 +106,7 @@ _blackList = { 'enabled' : False,
 
 
 def text_beautify(someString , width = 70):
-    """!Make really long texts shorter, clean up whitespace and remove
+    """Make really long texts shorter, clean up whitespace and remove
     trailing punctuation.
     """
     if width > 0:
@@ -117,11 +117,11 @@ def text_beautify(someString , width = 70):
         return escape_ampersand(string.strip(utils.normalize_whitespace(someString), ".,;:"))
     
 def escape_ampersand(text):
-    """!Escapes ampersands with additional ampersand for GUI"""
+    """Escapes ampersands with additional ampersand for GUI"""
     return string.replace(text, "&", "&&")
 
 class UpdateThread(Thread):
-    """!Update dialog widgets in the thread"""
+    """Update dialog widgets in the thread"""
     def __init__(self, parent, event, eventId, task):
         Thread.__init__(self)
         
@@ -344,7 +344,7 @@ def UpdateDialog(parent, event, eventId, task):
     return UpdateThread(parent, event, eventId, task)
 
 class UpdateQThread(Thread):
-    """!Update dialog widgets in the thread"""
+    """Update dialog widgets in the thread"""
     requestId = 0
     def __init__(self, parent, requestQ, resultQ, **kwds):
         Thread.__init__(self, **kwds)
@@ -378,7 +378,7 @@ class UpdateQThread(Thread):
                 wx.PostEvent(self.parent, event)
 
 class TaskFrame(wx.Frame):
-    """!This is the Frame containing the dialog for options input.
+    """This is the Frame containing the dialog for options input.
 
     The dialog is organized in a notebook according to the guisections
     defined by each GRASS command.
@@ -621,16 +621,16 @@ class TaskFrame(wx.Frame):
             self.goutput.SetSashPosition(int(self.GetSize()[1] * .75))
         
     def updateValuesHook(self, event = None):
-        """!Update status bar data"""
+        """Update status bar data"""
         self.SetStatusText(' '.join(self.notebookpanel.createCmd(ignoreErrors = True)))
         if event:
             event.Skip()
 
     def OnDone(self, cmd, returncode):
-        """!This function is launched from OnRun() when command is
+        """This function is launched from OnRun() when command is
         finished
 
-        @param returncode command's return code (0 for success)
+        :param returncode: command's return code (0 for success)
         """
 
         if hasattr(self, "btn_cancel"):
@@ -654,10 +654,10 @@ class TaskFrame(wx.Frame):
             wx.FutureCall(2000, self.Close)
 
     def OnMapCreated(self, name, ltype):
-        """!Map created or changed
+        """Map created or changed
 
-        @param name map name
-        @param ltype layer type (prompt value)
+        :param name: map name
+        :param ltype: layer type (prompt value)
         """
         if hasattr(self, "addbox") and self.addbox.IsChecked():
             add = True
@@ -668,13 +668,13 @@ class TaskFrame(wx.Frame):
             self._giface.mapCreated.emit(name=name, ltype=ltype, add=add)
     
     def OnOK(self, event):
-        """!OK button pressed"""
+        """OK button pressed"""
         cmd = self.OnApply(event)
         if cmd is not None and self.get_dcmd is not None:
             self.OnCancel(event)
 
     def OnApply(self, event):
-        """!Apply the command"""
+        """Apply the command"""
         if self._giface and hasattr(self._giface, "_model"):
             cmd = self.createCmd(ignoreErrors = True, ignoreRequired = True)
         else:
@@ -691,7 +691,7 @@ class TaskFrame(wx.Frame):
         return cmd
 
     def OnRun(self, event):
-        """!Run the command"""
+        """Run the command"""
         cmd = self.createCmd()
         
         if not cmd or len(cmd) < 1:
@@ -726,13 +726,13 @@ class TaskFrame(wx.Frame):
             btn.Enable(False)
         
     def OnAbort(self, event):
-        """!Abort running command"""
+        """Abort running command"""
         from core.gconsole import wxCmdAbort
         event = wxCmdAbort(aborted = True)
         wx.PostEvent(self._gconsole, event)
 
     def OnCopy(self, event):
-        """!Copy the command"""
+        """Copy the command"""
         cmddata = wx.TextDataObject()
         # list -> string
         cmdlist = self.createCmd(ignoreErrors = True)
@@ -751,7 +751,7 @@ class TaskFrame(wx.Frame):
                                     (cmdstring))
 
     def OnCancel(self, event):
-        """!Cancel button pressed"""
+        """Cancel button pressed"""
         self.MakeModal(False)
         self.dialogClosing.emit()
         if self.get_dcmd and \
@@ -772,7 +772,7 @@ class TaskFrame(wx.Frame):
             self.Destroy()
 
     def OnHelp(self, event):
-        """!Show manual page (switch to the 'Manual' notebook page)"""
+        """Show manual page (switch to the 'Manual' notebook page)"""
         if self.notebookpanel.notebook.GetPageIndexByName('manual') > -1:
             self.notebookpanel.notebook.SetSelectionByName('manual')
             self.notebookpanel.OnPageChange(None)
@@ -781,12 +781,12 @@ class TaskFrame(wx.Frame):
             event.Skip()
         
     def createCmd(self, ignoreErrors = False, ignoreRequired = False):
-        """!Create command string (python list)"""
+        """Create command string (python list)"""
         return self.notebookpanel.createCmd(ignoreErrors = ignoreErrors,
                                             ignoreRequired = ignoreRequired)
 
 class CmdPanel(wx.Panel):
-    """!A panel containing a notebook dividing in tabs the different
+    """A panel containing a notebook dividing in tabs the different
     guisections of the GRASS cmd.
     """
     def __init__(self, parent, giface, task, id = wx.ID_ANY, frame = None, *args, **kwargs):
@@ -1531,12 +1531,20 @@ class CmdPanel(wx.Panel):
                         ifbb.Bind(wx.EVT_TEXT, self.OnFileText)
                         
                         btnLoad = wx.Button(parent = which_panel, id = wx.ID_ANY, label = _("&Load"))
+                        btnLoad.SetToolTipString(_("Load and edit content of a file"))
                         btnLoad.Bind(wx.EVT_BUTTON, self.OnFileLoad)
                         btnSave = wx.Button(parent = which_panel, id = wx.ID_ANY, label = _("&Save as"))
+                        btnSave.SetToolTipString(_("Save content to a file for further use"))
                         btnSave.Bind(wx.EVT_BUTTON, self.OnFileSave)
                         
-                        which_sizer.Add(item = wx.StaticText(parent = which_panel, id = wx.ID_ANY,
-                                                             label = _('or enter values interactively')),
+                        fileContentLabel = wx.StaticText(parent=which_panel,
+                            id=wx.ID_ANY,
+                            label=_('or enter values directly:'))
+                        fileContentLabel.SetToolTipString(
+                            _("Enter file content directly instead of specifying"
+                              " a file."
+                              " Temporary file will be automatically created."))
+                        which_sizer.Add(item=fileContentLabel,
                                         proportion = 0,
                                         flag = wx.EXPAND | wx.RIGHT | wx.LEFT | wx.BOTTOM, border = 5)
                         which_sizer.Add(item = ifbb, proportion = 1,
@@ -1826,16 +1834,16 @@ class CmdPanel(wx.Panel):
         self.Bind(EVT_DIALOG_UPDATE, self.OnUpdateDialog)
 
     def _getValue(self, p):
-        """!Get value or default value of given parameter
+        """Get value or default value of given parameter
 
-        @param p parameter directory
+        :param p: parameter directory
         """
         if p.get('value', '') !=  '':
             return p['value']
         return p.get('default', '')
         
     def OnFileLoad(self, event):
-        """!Load file to interactive input"""
+        """Load file to interactive input"""
         me = event.GetId()
         win = dict()
         for p in self.task.params:
@@ -1869,7 +1877,7 @@ class CmdPanel(wx.Panel):
         win['text'].SetValue(data)
         
     def OnFileSave(self, event):
-        """!Save interactive input to the file"""
+        """Save interactive input to the file"""
         wId = event.GetId()
         win = {}
         for p in self.task.params:
@@ -1930,7 +1938,7 @@ class CmdPanel(wx.Panel):
             win.SetValue('')
         
     def OnVectorFormat(self, event):
-        """!Change vector format (native / ogr).
+        """Change vector format (native / ogr).
 
         Currently unused.        
         """
@@ -1996,7 +2004,7 @@ class CmdPanel(wx.Panel):
         self.parent.updateValuesHook()
         
     def OnVerbosity(self, event):
-        """!Verbosity level changed"""
+        """Verbosity level changed"""
         verbose = self.FindWindowById(self.task.get_flag('verbose')['wxId'][0])
         quiet = self.FindWindowById(self.task.get_flag('quiet')['wxId'][0])
         if event.IsChecked():
@@ -2039,7 +2047,7 @@ class CmdPanel(wx.Panel):
         event.Skip()
 
     def _switchPage(self, notification):
-        """!Manages @c 'output' notebook page according to event notification."""
+        """Manages @c 'output' notebook page according to event notification."""
         if notification == Notification.HIGHLIGHT:
             self.notebook.HighlightPageByName('output')
         if notification == Notification.MAKE_VISIBLE:
@@ -2083,7 +2091,7 @@ class CmdPanel(wx.Panel):
         self.OnUpdateValues()
 
     def OnUpdateValues(self, event = None):
-        """!If we were part of a richer interface, report back the
+        """If we were part of a richer interface, report back the
         current command being built.
 
         This method should be set by the parent of this panel if
@@ -2093,7 +2101,7 @@ class CmdPanel(wx.Panel):
         pass
 
     def OnCheckBoxMulti(self, event):
-        """!Fill the values as a ','-separated string according to
+        """Fill the values as a ','-separated string according to
         current status of the checkboxes.
         """
         me = event.GetId()
@@ -2127,7 +2135,7 @@ class CmdPanel(wx.Panel):
         event.Skip()
 
     def OnSetValue(self, event):
-        """!Retrieve the widget value and set the task value field
+        """Retrieve the widget value and set the task value field
         accordingly.
 
         Use for widgets that have a proper GetValue() method, i.e. not
@@ -2163,7 +2171,7 @@ class CmdPanel(wx.Panel):
         event.Skip()
         
     def OnSetSymbol(self, event):
-        """!Shows dialog for symbol selection"""
+        """Shows dialog for symbol selection"""
         myId = event.GetId()
         
         for p in self.task.params:
@@ -2186,9 +2194,10 @@ class CmdPanel(wx.Panel):
                 dlg.Destroy()
 
     def OnTimelineTool(self, event):
-        """!Show Timeline Tool with dataset(s) from gselect.
+        """Show Timeline Tool with dataset(s) from gselect.
 
-        TODO: update from gselect automatically        
+        .. todo::
+            update from gselect automatically        
         """
         myId = event.GetId()
 
@@ -2203,7 +2212,7 @@ class CmdPanel(wx.Panel):
                 frame.run(parent=self, datasets=datasets)
 
     def OnUpdateSelection(self, event):
-        """!Update dialog (layers, tables, columns, etc.)
+        """Update dialog (layers, tables, columns, etc.)
         """
         if not hasattr(self.parent, "updateThread"):
             if event:
@@ -2223,11 +2232,11 @@ class CmdPanel(wx.Panel):
                                             self.task)
             
     def createCmd(self, ignoreErrors = False, ignoreRequired = False):
-        """!Produce a command line string (list) or feeding into GRASS.
+        """Produce a command line string (list) or feeding into GRASS.
 
-        @param ignoreErrors True then it will return whatever has been
-        built so far, even though it would not be a correct command
-        for GRASS
+        :param ignoreErrors: True then it will return whatever has been
+                             built so far, even though it would not be
+                             a correct command for GRASS
         """
         try:
             cmd = self.task.get_cmd(ignoreErrors = ignoreErrors,
@@ -2270,7 +2279,7 @@ class CmdPanel(wx.Panel):
 class GUI:
     def __init__(self, parent = None, giface = None, show = True, modal = False,
                  centreOnParent = False, checkError = False):
-        """!Parses GRASS commands when module is imported and used from
+        """Parses GRASS commands when module is imported and used from
         Layer Manager.
         """
         self.parent = parent
@@ -2290,11 +2299,11 @@ class GUI:
             _blackList['enabled'] = False
         
     def GetCmd(self):
-        """!Get validated command"""
+        """Get validated command"""
         return self.cmd
     
     def ParseCommand(self, cmd, completed = None):
-        """!Parse command
+        """Parse command
         
         Note: cmd is given as list
         
@@ -2411,12 +2420,12 @@ class GUI:
             return self.grass_task
     
     def GetCommandInputMapParamKey(self, cmd):
-        """!Get parameter key for input raster/vector map
+        """Get parameter key for input raster/vector map
         
-        @param cmd module name
+        :param cmd: module name
         
-        @return parameter key
-        @return None on failure
+        :return: parameter key
+        :return: None on failure
         """
         # parse the interface decription
         if not self.grass_task:
@@ -2435,7 +2444,7 @@ class GUI:
         return None
 
 class GrassGUIApp(wx.App):
-    """!Stand-alone GRASS command GUI
+    """Stand-alone GRASS command GUI
     """
     def __init__(self, grass_task):
         self.grass_task = grass_task

+ 17 - 16
gui/wxpython/gui_core/ghelp.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package gui_core.ghelp
 
 @brief Help/about window, menu tree, search module tree
@@ -41,7 +41,7 @@ from core.debug       import Debug
 
 
 class AboutWindow(wx.Frame):
-    """!Create custom About Window
+    """Create custom About Window
     """
     def __init__(self, parent, size = (770, 460), 
                  title = _('About GRASS GIS'), **kwargs):
@@ -93,7 +93,7 @@ class AboutWindow(wx.Frame):
         self.Layout()
         
     def _pageInfo(self):
-        """!Info page"""
+        """Info page"""
         # get version and web site
         vInfo = grass.version()
         if not vInfo:
@@ -566,15 +566,16 @@ class AboutWindow(wx.Frame):
         return self.statswin
     
     def OnCloseWindow(self, event):
-        """!Close window"""
+        """Close window"""
         self.Close()
 
 class HelpFrame(wx.Dialog):
-    """!GRASS Quickstart help window
+    """GRASS Quickstart help window
 
     As a base class wx.Dialog is used, because of not working
     close button with wx.Frame when dialog is called from wizard.
-    If parent is None, application TopLevelWindow is used (wxPython standard behaviour).
+    If parent is None, application TopLevelWindow is used (wxPython
+    standard behaviour).
 
     Currently not used (was in location wizard before)
     due to unsolved problems - window sometimes does not respond.
@@ -596,7 +597,7 @@ class HelpFrame(wx.Dialog):
         self.Layout()
 
 class HelpWindow(HtmlWindow):
-    """!This panel holds the text from GRASS docs.
+    """This panel holds the text from GRASS docs.
     
     GISBASE must be set in the environment to find the html docs dir.
     The SYNOPSIS section is skipped, since this Panel is supposed to
@@ -604,7 +605,7 @@ class HelpWindow(HtmlWindow):
     """
     def __init__(self, parent, command, text, skipDescription,
                  **kwargs):
-        """!If command is given, the corresponding HTML help
+        """If command is given, the corresponding HTML help
         file will be presented, with all links pointing to absolute
         paths of local files.
 
@@ -654,7 +655,7 @@ class HelpWindow(HtmlWindow):
         super(HelpWindow, self).OnLinkClicked(linkinfo)
         
     def fillContentsFromFile(self, htmlFile, skipDescription = True):
-        """!Load content from file.
+        """Load content from file.
         
         Currently not used.        
         """
@@ -709,7 +710,7 @@ class HelpPanel(wx.Panel):
         self._layout()
 
     def _layout(self):
-        """!Do layout"""
+        """Do layout"""
         sizer = wx.BoxSizer(wx.VERTICAL)
         btnSizer = wx.BoxSizer(wx.HORIZONTAL)
         
@@ -728,14 +729,14 @@ class HelpPanel(wx.Panel):
         sizer.Fit(self)
 
     def LoadPage(self, path = None):
-        """!Load page"""
+        """Load page"""
         if not path:
             path = self.GetFile()
         self.content.history.append(path)
         self.content.LoadPage(path)
         
     def GetFile(self):
-        """!Get HTML file"""
+        """Get HTML file"""
         fMan = os.path.join(self.content.fspath, self.command + ".html")
         if os.path.isfile(fMan):
             return fMan
@@ -753,7 +754,7 @@ class HelpPanel(wx.Panel):
         return self.content.loaded
 
     def OnHistory(self):
-        """!Update buttons"""
+        """Update buttons"""
         nH = len(self.content.history)
         iH = self.content.historyIdx
         if iH == nH - 1:
@@ -786,10 +787,10 @@ class HelpPanel(wx.Panel):
         event.Skip()
 
 def ShowAboutDialog(prgName, startYear):
-    """!Displays About window.
+    """Displays About window.
 
-    @param prgName name of the program
-    @param startYear the first year of existence of the program
+    :param prgName: name of the program
+    :param startYear: the first year of existence of the program
     """
     info = wx.AboutDialogInfo()
     

+ 51 - 50
gui/wxpython/gui_core/goutput.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package gui_core.goutput
 
 @brief Command output widgets
@@ -43,21 +43,21 @@ GC_PROMPT = 2
 
 
 class GConsoleWindow(wx.SplitterWindow):
-    """!Create and manage output console for commands run by GUI.
+    """Create and manage output console for commands run by GUI.
     """
     def __init__(self, parent, gconsole, menuModel = None, margin = False,
                  style = wx.TAB_TRAVERSAL | wx.FULL_REPAINT_ON_RESIZE,
                  gcstyle = GC_EMPTY,
                  **kwargs):
-        """!
-        @param parent gui parent
-        @param gconsole console logic
-        @param menuModel tree model of modules (from menu)
-        @param margin use margin in output pane (GStc)
-        @param style wx.SplitterWindow style
-        @param gcstyle GConsole style
-        (GC_EMPTY, GC_PROMPT to show command prompt,
-        GC_SEARCH to show search widget)
+        """
+        :param parent: gui parent
+        :param gconsole: console logic
+        :param menuModel: tree model of modules (from menu)
+        :param margin: use margin in output pane (GStc)
+        :param style: wx.SplitterWindow style
+        :param gcstyle: GConsole style
+                        (GC_EMPTY, GC_PROMPT to show command prompt,
+                        GC_SEARCH to show search widget)
         """
         wx.SplitterWindow.__init__(self, parent, id = wx.ID_ANY, style = style, **kwargs)
         self.SetName("GConsole")
@@ -162,7 +162,7 @@ class GConsoleWindow(wx.SplitterWindow):
         self._layout()
         
     def _layout(self):
-        """!Do layout"""
+        """Do layout"""
         self.outputSizer = wx.BoxSizer(wx.VERTICAL)
         progressSizer = wx.BoxSizer(wx.HORIZONTAL)
         btnSizer = wx.BoxSizer(wx.HORIZONTAL)
@@ -249,7 +249,7 @@ class GConsoleWindow(wx.SplitterWindow):
         self.Layout()
 
     def MakeSearchPaneContent(self, pane, model):
-        """!Create search pane"""
+        """Create search pane"""
         border = wx.BoxSizer(wx.VERTICAL)
         
         self.search = SearchModuleWidget(parent = pane,
@@ -264,7 +264,7 @@ class GConsoleWindow(wx.SplitterWindow):
         border.Fit(pane)
         
     def OnSearchPaneChanged(self, event):
-        """!Collapse search module box"""
+        """Collapse search module box"""
         if self.searchPane.IsExpanded():
             self.searchPane.SetLabel(self.infoCollapseLabelCol)
         else:
@@ -274,11 +274,11 @@ class GConsoleWindow(wx.SplitterWindow):
         self.panelOutput.SendSizeEvent()
         
     def GetPanel(self, prompt = True):
-        """!Get panel
+        """Get panel
 
-        @param prompt get prompt / output panel
+        :param prompt: get prompt / output panel
 
-        @return wx.Panel reference
+        :return: wx.Panel reference
         """
         if prompt:
             return self.panelPrompt
@@ -287,15 +287,15 @@ class GConsoleWindow(wx.SplitterWindow):
 
     def WriteLog(self, text, style=None, wrap=None,
                  notification=Notification.HIGHLIGHT):
-        """!Generic method for writing log message in 
+        """Generic method for writing log message in 
         given style. 
 
         Emits contentChanged signal.
 
-        @param line text line
-        @param style text style (see GStc)
-        @param stdout write to stdout or stderr
-        @param notification form of notification
+        :param line: text line
+        :param style: text style (see GStc)
+        :param stdout: write to stdout or stderr
+        :param notification: form of notification
         """
 
         self.cmdOutput.SetStyle()
@@ -330,37 +330,37 @@ class GConsoleWindow(wx.SplitterWindow):
         self.contentChanged.emit(notification=notification)
         
     def WriteCmdLog(self, text, pid=None, notification=Notification.MAKE_VISIBLE):
-        """!Write message in selected style
+        """Write message in selected style
         
-        @param text message to be printed
-        @param pid process pid or None
-        @param switchPage True to switch page
+        :param text: message to be printed
+        :param pid: process pid or None
+        :param switchPage: True to switch page
         """
         if pid:
             text = '(' + str(pid) + ') ' + text
         self.WriteLog(text, style=self.cmdOutput.StyleCommand, notification=notification)
 
     def WriteWarning(self, text):
-        """!Write message in warning style"""
+        """Write message in warning style"""
         self.WriteLog(text, style=self.cmdOutput.StyleWarning, notification=Notification.MAKE_VISIBLE)
 
     def WriteError(self, text):
-        """!Write message in error style"""
+        """Write message in error style"""
         self.WriteLog(text, style=self.cmdOutput.StyleError, notification=Notification.MAKE_VISIBLE)
 
     def OnOutputClear(self, event):
-        """!Clear content of output window"""
+        """Clear content of output window"""
         self.cmdOutput.SetReadOnly(False)
         self.cmdOutput.ClearAll()
         self.cmdOutput.SetReadOnly(True)
         self.progressbar.SetValue(0)
 
     def GetProgressBar(self):
-        """!Return progress bar widget"""
+        """Return progress bar widget"""
         return self.progressbar
 
     def OnOutputSave(self, event):
-        """!Save (selected) text from output window to the file"""
+        """Save (selected) text from output window to the file"""
         text = self.cmdOutput.GetSelectedText()
         if not text:
             text = self.cmdOutput.GetText()
@@ -393,10 +393,10 @@ class GConsoleWindow(wx.SplitterWindow):
         dlg.Destroy()
 
     def SetCopyingOfSelectedText(self, copy):
-        """!Enable or disable copying of selected text in to clipboard.
+        """Enable or disable copying of selected text in to clipboard.
         Effects prompt and output.
         
-        @param copy True for enable, False for disable
+        :param bool copy: True for enable, False for disable
         """
         if copy:
             self.cmdPrompt.Bind(stc.EVT_STC_PAINTED, self.cmdPrompt.OnTextSelectionChanged)
@@ -406,7 +406,7 @@ class GConsoleWindow(wx.SplitterWindow):
             self.cmdOutput.Unbind(stc.EVT_STC_PAINTED)
 
     def OnCmdOutput(self, event):
-        """!Prints command output.
+        """Prints command output.
 
         Emits contentChanged signal.
         """
@@ -421,7 +421,7 @@ class GConsoleWindow(wx.SplitterWindow):
             self.contentChanged.emit(notification=Notification.HIGHLIGHT)
 
     def OnCmdProgress(self, event):
-        """!Update progress message info"""
+        """Update progress message info"""
         self.progressbar.SetValue(event.value)
         event.Skip()
 
@@ -447,7 +447,7 @@ class GConsoleWindow(wx.SplitterWindow):
         del self.cmdFileProtocol
         
     def OnCmdProtocol(self, event = None):
-        """!Save commands into file"""
+        """Save commands into file"""
         if not event.IsChecked():
             # stop capturing commands, save list of commands to the
             # protocol file
@@ -471,13 +471,13 @@ class GConsoleWindow(wx.SplitterWindow):
         event.Skip()
 
     def OnCmdRun(self, event):
-        """!Run command"""
+        """Run command"""
         self.outputSizer.Show(self.panelProgress)
         self.outputSizer.Layout()
         event.Skip()
 
     def OnCmdDone(self, event):
-        """!Command done (or aborted)
+        """Command done (or aborted)
         """
         self.progressbar.SetValue(0) # reset progress bar on '0%'
         wx.CallLater(100, self._hideProgress)
@@ -488,16 +488,16 @@ class GConsoleWindow(wx.SplitterWindow):
         self.outputSizer.Layout()
 
     def ResetFocus(self):
-        """!Reset focus"""
+        """Reset focus"""
         self.cmdPrompt.SetFocus()
         
     def GetPrompt(self):
-        """!Get prompt"""
+        """Get prompt"""
         return self.cmdPrompt
 
 
 class GStc(stc.StyledTextCtrl):
-    """!Styled text control for GRASS stdout and stderr.
+    """Styled text control for GRASS stdout and stderr.
 
     Based on FrameOutErr.py
 
@@ -506,7 +506,7 @@ class GStc(stc.StyledTextCtrl):
     Author:    Jean-Michel Fauth, Switzerland
     Copyright: (c) 2005-2007 Jean-Michel Fauth
     Licence:   GPL
-    """    
+    """  
     def __init__(self, parent, id, margin = False, wrap = None):
         stc.StyledTextCtrl.__init__(self, parent, id)
         self.parent = parent
@@ -549,14 +549,14 @@ class GStc(stc.StyledTextCtrl):
         self.Bind(wx.EVT_WINDOW_DESTROY, self.OnDestroy)
         
     def OnTextSelectionChanged(self, event):
-        """!Copy selected text to clipboard and skip event.
+        """Copy selected text to clipboard and skip event.
         The same function is in TextCtrlAutoComplete class (prompt.py).
         """
         wx.CallAfter(self.Copy)
         event.Skip()
         
     def SetStyle(self):
-        """!Set styles for styled text output windows with type face 
+        """Set styles for styled text output windows with type face 
         and point size selected by user (Courier New 10 is default)"""
         
         typeface = UserSettings.Get(group = 'appearance', key = 'outputfont', subkey = 'type')   
@@ -598,14 +598,14 @@ class GStc(stc.StyledTextCtrl):
         self.StyleSetSpec(self.StyleUnknown, self.StyleUnknownSpec)        
 
     def OnDestroy(self, evt):
-        """!The clipboard contents can be preserved after
+        """The clipboard contents can be preserved after
         the app has exited"""
         
         wx.TheClipboard.Flush()
         evt.Skip()
 
     def AddTextWrapped(self, txt, wrap = None):
-        """!Add string to text area.
+        """Add string to text area.
 
         String is wrapped and linesep is also added to the end
         of the string"""
@@ -647,12 +647,13 @@ class GStc(stc.StyledTextCtrl):
         self.SetReadOnly(True)
 
     def AddStyledMessage(self, message, style = None):
-        """!Add message to text area.
+        """Add message to text area.
 
         Handles messages with progress percentages.
 
-        @param message message to be added
-        @param style style of message, allowed values: 'message', 'warning', 'error' or None
+        :param message: message to be added
+        :param style: style of message, allowed values: 'message',
+                      'warning', 'error' or None
         """
         # message prefix
         if style == 'warning':
@@ -708,7 +709,7 @@ class GStc(stc.StyledTextCtrl):
 
 
 class GConsoleFrame(wx.Frame):
-    """!Standalone GConsole for testing only"""
+    """Standalone GConsole for testing only"""
     def __init__(self, parent, id = wx.ID_ANY, title = "GConsole Test Frame",
                  style = wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL, **kwargs):
         wx.Frame.__init__(self, parent = parent, id = id, title = title, style = style)

File diff suppressed because it is too large
+ 400 - 392
gui/wxpython/gui_core/gselect.py


+ 101 - 96
gui/wxpython/gui_core/mapdisp.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package gui_core.mapdisp
 
 @brief Base classes for Map display window
@@ -34,7 +34,7 @@ from grass.script import core as grass
 
 
 class MapFrameBase(wx.Frame):
-    """!Base class for map display window
+    """Base class for map display window
     
     Derived class must use (create and initialize) \c statusbarManager
     or override
@@ -59,18 +59,19 @@ class MapFrameBase(wx.Frame):
     def __init__(self, parent = None, id = wx.ID_ANY, title = None,
                  style = wx.DEFAULT_FRAME_STYLE,
                  auimgr = None, name = None, **kwargs):
-        """!
+        """
 
-        @warning Use \a auimgr parameter only if you know what you are doing.
-        
-        @param parent gui parent
-        @param id wx id
-        @param title window title
-        @param style \c wx.Frame style
-        @param toolbars array of activated toolbars, e.g. ['map', 'digit']
-        @param auimgr AUI manager (if \c None, wx.aui.AuiManager is used)
-        @param name frame name
-        @param kwargs arguments passed to \c wx.Frame
+        .. warning::
+            Use \a auimgr parameter only if you know what you are doing.
+        
+        :param parent: gui parent
+        :param id: wx id
+        :param title: window title
+        :param style: \c wx.Frame style
+        :param toolbars: array of activated toolbars, e.g. ['map', 'digit']
+        :param auimgr: AUI manager (if \c None, wx.aui.AuiManager is used)
+        :param name: frame name
+        :param kwargs: arguments passed to \c wx.Frame
         """
         
         self.parent     = parent
@@ -107,7 +108,7 @@ class MapFrameBase(wx.Frame):
         self.SetAcceleratorTable(accelTable)
 
     def _initMap(self, Map):
-        """!Initialize map display, set dimensions and map region
+        """Initialize map display, set dimensions and map region
         """
         if not grass.find_program('g.region', '--help'):
             sys.exit(_("GRASS module '%s' not found. Unable to start map "
@@ -122,7 +123,7 @@ class MapFrameBase(wx.Frame):
         self.GetWindow().UnregisterAllHandlers()
 
     def OnSize(self, event):
-        """!Adjust statusbar on changing size"""
+        """Adjust statusbar on changing size"""
         # reposition checkbox in statusbar
         self.StatusbarReposition()
         
@@ -141,22 +142,25 @@ class MapFrameBase(wx.Frame):
         return self._toolSwitcher
 
     def SetProperty(self, name, value):
-        """!Sets property"""
+        """Sets property"""
         self.statusbarManager.SetProperty(name, value)
         
     def GetProperty(self, name):
-        """!Returns property"""
+        """Returns property"""
         return self.statusbarManager.GetProperty(name)
         
     def HasProperty(self, name):
-        """!Checks whether object has property"""
+        """Checks whether object has property"""
         return self.statusbarManager.HasProperty(name)
     
     def GetPPM(self):
-        """! Get pixel per meter
+        """Get pixel per meter
+        
+        .. todo::
+            now computed every time, is it necessary?
         
-        @todo now computed every time, is it necessary?
-        @todo enable user to specify ppm (and store it in UserSettings)
+        .. todo::
+            enable user to specify ppm (and store it in UserSettings)
         """
         # TODO: need to be fixed...
         ### screen X region problem
@@ -183,10 +187,10 @@ class MapFrameBase(wx.Frame):
         return ppm
     
     def SetMapScale(self, value, map = None):
-        """! Set current map scale
+        """Set current map scale
         
-        @param value scale value (n if scale is 1:n)
-        @param map Map instance (if none self.Map is used)
+        :param value: scale value (n if scale is 1:n)
+        :param map: Map instance (if none self.Map is used)
         """
         if not map:
             map = self.Map
@@ -204,9 +208,9 @@ class MapFrameBase(wx.Frame):
                                    region['e'], region['w'])
     
     def GetMapScale(self, map = None):
-        """! Get current map scale
+        """Get current map scale
         
-        @param map Map instance (if none self.Map is used)
+        :param map: Map instance (if none self.Map is used)
         """
         if not map:
             map = self.GetMap()
@@ -230,30 +234,30 @@ class MapFrameBase(wx.Frame):
         return scale
         
     def GetProgressBar(self):
-        """!Returns progress bar
+        """Returns progress bar
         
         Progress bar can be used by other classes.
         """
         return self.statusbarManager.GetProgressBar()
         
     def GetMap(self):
-        """!Returns current map (renderer) instance"""
+        """Returns current map (renderer) instance"""
         raise NotImplementedError("GetMap")
 
     def GetWindow(self):
-        """!Returns current map window"""
+        """Returns current map window"""
         raise NotImplementedError("GetWindow")
 
     def GetWindows(self):
-        """!Returns list of map windows"""
+        """Returns list of map windows"""
         raise NotImplementedError("GetWindows")
         
     def GetMapToolbar(self):
-        """!Returns toolbar with zooming tools"""
+        """Returns toolbar with zooming tools"""
         raise NotImplementedError("GetMapToolbar")
        
     def GetToolbar(self, name):
-        """!Returns toolbar if exists else None.
+        """Returns toolbar if exists else None.
         
         Toolbars dictionary contains currently used toolbars only.
         """
@@ -263,12 +267,12 @@ class MapFrameBase(wx.Frame):
         return None
        
     def StatusbarUpdate(self):
-        """!Update statusbar content"""
+        """Update statusbar content"""
         Debug.msg(5, "MapFrameBase.StatusbarUpdate()")
         self.statusbarManager.Update()
         
     def IsAutoRendered(self):
-        """!Check if auto-rendering is enabled"""
+        """Check if auto-rendering is enabled"""
         # TODO: this is now not the right place to access this attribute
         # TODO: add mapWindowProperties to init parameters
         # and pass the right object in the init of derived class?
@@ -276,7 +280,7 @@ class MapFrameBase(wx.Frame):
         return self.mapWindowProperties.autoRender
         
     def CoordinatesChanged(self):
-        """!Shows current coordinates on statusbar.
+        """Shows current coordinates on statusbar.
         """
         # assuming that the first mode is coordinates
         # probably shold not be here but good solution is not available now
@@ -284,39 +288,39 @@ class MapFrameBase(wx.Frame):
             self.statusbarManager.ShowItem('coordinates')
         
     def StatusbarReposition(self):
-        """!Reposition items in statusbar"""
+        """Reposition items in statusbar"""
         self.statusbarManager.Reposition()
         
     def StatusbarEnableLongHelp(self, enable = True):
-        """!Enable/disable toolbars long help"""
+        """Enable/disable toolbars long help"""
         for toolbar in self.toolbars.itervalues():
             toolbar.EnableLongHelp(enable)
         
     def IsStandalone(self):
-        """!Check if map frame is standalone"""
+        """Check if map frame is standalone"""
         raise NotImplementedError("IsStandalone")
    
     def OnRender(self, event):
-        """!Re-render map composition (each map layer)
+        """Re-render map composition (each map layer)
         """
         raise NotImplementedError("OnRender")
         
     def OnDraw(self, event):
-        """!Re-display current map composition
+        """Re-display current map composition
         """
         self.MapWindow.UpdateMap(render = False)
         
     def OnErase(self, event):
-        """!Erase the canvas
+        """Erase the canvas
         """
         self.MapWindow.EraseMap()
         
     def OnZoomIn(self, event):
-        """!Zoom in the map."""
+        """Zoom in the map."""
         self.MapWindow.SetModeZoomIn()
         
     def OnZoomOut(self, event):
-        """!Zoom out the map."""
+        """Zoom out the map."""
         self.MapWindow.SetModeZoomOut()
 
     def _setUpMapWindow(self, mapWindow):
@@ -331,40 +335,40 @@ class MapFrameBase(wx.Frame):
         mapWindow.mouseMoving.connect(self.CoordinatesChanged)
 
     def OnPointer(self, event):
-        """!Sets mouse mode to pointer."""
+        """Sets mouse mode to pointer."""
         self.MapWindow.SetModePointer()
 
     def OnPan(self, event):
-        """!Panning, set mouse to drag
+        """Panning, set mouse to drag
         """
         self.MapWindow.SetModePan()
 
     def OnZoomBack(self, event):
-        """!Zoom last (previously stored position)
+        """Zoom last (previously stored position)
         """
         self.MapWindow.ZoomBack()
         
     def OnZoomToMap(self, event):
-        """!
+        """
         Set display extents to match selected raster (including NULLs)
         or vector map.
         """
         self.MapWindow.ZoomToMap(layers = self.Map.GetListOfLayers())
     
     def OnZoomToWind(self, event):
-        """!Set display geometry to match computational region
+        """Set display geometry to match computational region
         settings (set with g.region)
         """
         self.MapWindow.ZoomToWind()
         
     def OnZoomToDefault(self, event):
-        """!Set display geometry to match default region settings
+        """Set display geometry to match default region settings
         """
         self.MapWindow.ZoomToDefault()
 
 
 class SingleMapFrame(MapFrameBase):
-    """! Frame with one map window.
+    """Frame with one map window.
     
     It is base class for frames which needs only one map.
     
@@ -378,15 +382,15 @@ class SingleMapFrame(MapFrameBase):
                  style = wx.DEFAULT_FRAME_STYLE,
                  Map = None,
                  auimgr = None, name = None, **kwargs):
-        """!
+        """
         
-        @param parent gui parent
-        @param id wx id
-        @param title window title
-        @param style \c wx.Frame style
-        @param Map instance of render.Map
-        @param name frame name
-        @param kwargs arguments passed to MapFrameBase
+        :param parent: gui parent
+        :param id: wx id
+        :param title: window title
+        :param style: \c wx.Frame style
+        :param map: instance of render.Map
+        :param name: frame name
+        :param kwargs: arguments passed to MapFrameBase
         """
 
         MapFrameBase.__init__(self, parent = parent, id = id, title = title,
@@ -401,19 +405,19 @@ class SingleMapFrame(MapFrameBase):
         self._initMap(Map = self.Map)
         
     def GetMap(self):
-        """!Returns map (renderer) instance"""
+        """Returns map (renderer) instance"""
         return self.Map
 
     def GetWindow(self):
-        """!Returns map window"""
+        """Returns map window"""
         return self.MapWindow
         
     def GetWindows(self):
-        """!Returns list of map windows"""
+        """Returns list of map windows"""
         return [self.MapWindow]
 
     def OnRender(self, event):
-        """!Re-render map composition (each map layer)
+        """Re-render map composition (each map layer)
         """
         self.GetWindow().UpdateMap(render = True, renderVector = True)
         
@@ -422,7 +426,7 @@ class SingleMapFrame(MapFrameBase):
         
 
 class DoubleMapFrame(MapFrameBase):
-    """! Frame with two map windows.
+    """Frame with two map windows.
     
     It is base class for frames which needs two maps.
     There is no primary and secondary map. Both maps are equal.
@@ -437,25 +441,26 @@ class DoubleMapFrame(MapFrameBase):
     @note To access maps use getters only
     (when using class or when writing class itself).
     
-    @todo Use it in GCP manager
-    (probably changes to both DoubleMapFrame and GCP MapFrame will be neccessary).
+    .. todo:
+        Use it in GCP manager (probably changes to both DoubleMapFrame
+        and GCP MapFrame will be neccessary).
     """
     def __init__(self, parent = None, id = wx.ID_ANY, title = None,
                  style = wx.DEFAULT_FRAME_STYLE,
                  firstMap = None, secondMap = None,
                  auimgr = None, name = None, **kwargs):
-        """!
+        """
         
         \a firstMap is set as active (by assign it to \c self.Map).
         Derived class should assging to \c self.MapWindow to make one
         map window current by dafault.
         
-        @param parent gui parent
-        @param id wx id
-        @param title window title
-        @param style \c wx.Frame style
-        @param name frame name
-        @param kwargs arguments passed to MapFrameBase
+        :param parent: gui parent
+        :param id: wx id
+        :param title: window title
+        :param style: \c wx.Frame style
+        :param name: frame name
+        :param kwargs: arguments passed to MapFrameBase
         """
         
         MapFrameBase.__init__(self, parent = parent, id = id, title = title,
@@ -482,25 +487,25 @@ class DoubleMapFrame(MapFrameBase):
         self.GetSecondWindow().UnregisterAllHandlers()
 
     def GetFirstMap(self):
-        """!Returns first Map instance
+        """Returns first Map instance
         """
         return self.firstMap
         
     def GetSecondMap(self):
-        """!Returns second Map instance
+        """Returns second Map instance
         """
         return self.secondMap
         
     def GetFirstWindow(self):
-        """!Get first map window"""
+        """Get first map window"""
         return self.firstMapWindow
     
     def GetSecondWindow(self):
-        """!Get second map window"""
+        """Get second map window"""
         return self.secondMapWindow
     
     def GetMap(self):
-        """!Returns current map (renderer) instance
+        """Returns current map (renderer) instance
         
         @note Use this method to access current map renderer.
         (It is not guarented that current map will be stored in
@@ -509,18 +514,18 @@ class DoubleMapFrame(MapFrameBase):
         return self.Map
     
     def GetWindow(self):
-        """!Returns current map window
+        """Returns current map window
         
-        @see GetMap()
+        :func:`GetMap()`
         """
         return self.MapWindow
     
     def GetWindows(self):
-        """!Return list of all windows"""
+        """Return list of all windows"""
         return [self.firstMapWindow, self.secondMapWindow]
     
     def ActivateFirstMap(self, event = None):
-        """!Make first Map and MapWindow active and (un)bind regions of the two Maps."""
+        """Make first Map and MapWindow active and (un)bind regions of the two Maps."""
         if self.MapWindow == self.firstMapWindow:
             return
 
@@ -534,7 +539,7 @@ class DoubleMapFrame(MapFrameBase):
             self.secondMapWindow.zoomChanged.disconnect(self.OnZoomChangedSecondMap)
 
     def ActivateSecondMap(self, event = None):
-        """!Make second Map and MapWindow active and (un)bind regions of the two Maps."""
+        """Make second Map and MapWindow active and (un)bind regions of the two Maps."""
         if self.MapWindow == self.secondMapWindow:
             return        
 
@@ -547,7 +552,7 @@ class DoubleMapFrame(MapFrameBase):
             self.firstMapWindow.zoomChanged.disconnect(self.OnZoomChangedFirstMap)
 
     def SetBindRegions(self, on):
-        """!Set or unset binding display regions."""
+        """Set or unset binding display regions."""
         self._bindRegions = on
 
         if on:
@@ -562,7 +567,7 @@ class DoubleMapFrame(MapFrameBase):
                 self.secondMapWindow.zoomChanged.disconnect(self.OnZoomChangedSecondMap)
 
     def OnZoomChangedFirstMap(self):
-        """!Display region of the first window (Map) changed.
+        """Display region of the first window (Map) changed.
 
         Synchronize the region of the second map and re-render it.
         This is the default implementation which can be overridden.
@@ -572,7 +577,7 @@ class DoubleMapFrame(MapFrameBase):
         self.Render(mapToRender = self.GetSecondWindow())
 
     def OnZoomChangedSecondMap(self):
-        """!Display region of the second window (Map) changed.
+        """Display region of the second window (Map) changed.
 
         Synchronize the region of the second map and re-render it.
         This is the default implementation which can be overridden.
@@ -582,38 +587,38 @@ class DoubleMapFrame(MapFrameBase):
         self.Render(mapToRender = self.GetFirstWindow())
 
     def OnZoomIn(self, event):
-        """!Zoom in the map."""
+        """Zoom in the map."""
         self.GetFirstWindow().SetModeZoomIn()
         self.GetSecondWindow().SetModeZoomIn()
 
     def OnZoomOut(self, event):
-        """!Zoom out the map."""
+        """Zoom out the map."""
         self.GetFirstWindow().SetModeZoomOut()
         self.GetSecondWindow().SetModeZoomOut()
         
     def OnPan(self, event):
-        """!Panning, set mouse to pan"""
+        """Panning, set mouse to pan"""
         self.GetFirstWindow().SetModePan()
         self.GetSecondWindow().SetModePan()
 
     def OnPointer(self, event):
-        """!Set pointer mode (dragging overlays)"""
+        """Set pointer mode (dragging overlays)"""
         self.GetFirstWindow().SetModePointer()
         self.GetSecondWindow().SetModePointer()
 
     def OnQuery(self, event):
-        """!Set query mode"""
+        """Set query mode"""
         self.GetFirstWindow().SetModeQuery()
         self.GetSecondWindow().SetModeQuery()
 
     def OnRender(self, event):
-        """!Re-render map composition (each map layer)
+        """Re-render map composition (each map layer)
         """
         self.Render(mapToRender = self.GetFirstWindow())
         self.Render(mapToRender = self.GetSecondWindow())
     
     def Render(self, mapToRender):
-        """!Re-render map composition"""
+        """Re-render map composition"""
         mapToRender.UpdateMap(render = True,
                               renderVector = mapToRender == self.GetFirstWindow())
         
@@ -621,23 +626,23 @@ class DoubleMapFrame(MapFrameBase):
         self.StatusbarUpdate()
         
     def OnErase(self, event):
-        """!Erase the canvas
+        """Erase the canvas
         """
         self.Erase(mapToErase = self.GetFirstWindow())
         self.Erase(mapToErase = self.GetSecondWindow())
         
     def Erase(self, mapToErase):
-        """!Erase the canvas
+        """Erase the canvas
         """
         mapToErase.EraseMap()
         
     def OnDraw(self, event):
-        """!Re-display current map composition
+        """Re-display current map composition
         """
         self.Draw(mapToDraw = self.GetFirstWindow())
         self.Draw(mapToDraw = self.GetSecondWindow())
         
     def Draw(self, mapToDraw):
-        """!Re-display current map composition
+        """Re-display current map composition
         """
         mapToDraw.UpdateMap(render = False)

+ 15 - 15
gui/wxpython/gui_core/menu.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package gui_core.menu
 
 @brief Menu classes for wxGUI
@@ -33,7 +33,7 @@ from grass.pydispatch.signal import Signal
 
 class Menu(wx.MenuBar):
     def __init__(self, parent, model):
-        """!Creates menubar"""
+        """Creates menubar"""
         wx.MenuBar.__init__(self)
         self.parent = parent
         self.model = model
@@ -44,7 +44,7 @@ class Menu(wx.MenuBar):
             self.Append(self._createMenu(child), child.label)
         
     def _createMenu(self, node):
-        """!Creates menu"""
+        """Creates menu"""
         menu = wx.Menu()
         for child in node.children:
             if child.children:
@@ -63,7 +63,7 @@ class Menu(wx.MenuBar):
 
     def _createMenuItem(self, menu, label, description, handler, command, keywords,
                         shortcut = '', icon = '', wxId = wx.ID_ANY, kind = wx.ITEM_NORMAL):
-        """!Creates menu items
+        """Creates menu items
         There are three menu styles (menu item text styles).
         1 -- label only, 2 -- label and cmd name, 3 -- cmd name only
         """
@@ -100,13 +100,13 @@ class Menu(wx.MenuBar):
         self.parent.Bind(wx.EVT_MENU, rhandler, menuItem)
         
     def GetData(self):
-        """!Get menu data"""
+        """Get menu data"""
         return self.model
     
     def GetCmd(self):
-        """!Get dictionary of commands (key is id)
+        """Get dictionary of commands (key is id)
 
-        @return dictionary of commands
+        :return: dictionary of commands
         """
         return self.menucmd
         
@@ -125,10 +125,10 @@ class Menu(wx.MenuBar):
         event.Skip()
 
 class SearchModuleWindow(wx.Panel):
-    """!Menu tree and search widget for searching modules.
+    """Menu tree and search widget for searching modules.
     
-        Signal:
-            showNotification - attribute 'message'
+    Signal:
+        showNotification - attribute 'message'
     """
     def __init__(self, parent, model, id = wx.ID_ANY, **kwargs):
         self.parent = parent # LayerManager
@@ -170,7 +170,7 @@ class SearchModuleWindow(wx.Panel):
         self._search.SetFocus()
         
     def _layout(self):
-        """!Do dialog layout"""
+        """Do dialog layout"""
         sizer = wx.BoxSizer(wx.VERTICAL)
         
         # body
@@ -204,9 +204,9 @@ class SearchModuleWindow(wx.Panel):
         self.Layout()
         
     def Run(self, module=None):
-        """!Run selected command.
+        """Run selected command.
         
-        @param module module (represented by tree node)
+        :param module: module (represented by tree node)
         """
         if module is None:
             if not self._tree.GetSelected():
@@ -225,13 +225,13 @@ class SearchModuleWindow(wx.Panel):
             eval(handler)(event=None)
 
     def OnKeyUp(self, event):
-        """!Key or key combination pressed"""
+        """Key or key combination pressed"""
         if event.ControlDown() and \
                 event.GetKeyCode() in (wx.WXK_RETURN, wx.WXK_NUMPAD_ENTER):
             self.Run()
         
     def OnItemSelected(self, node):
-        """!Item selected"""      
+        """Item selected"""    
         data = node.data
         if not data or 'command' not in data:
             return

+ 28 - 27
gui/wxpython/gui_core/preferences.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package gui_core.preferences
 
 @brief User preferences dialog
@@ -53,7 +53,7 @@ from gui_core.widgets import IntegerValidator, ColorTablesComboBox
 from core.debug       import Debug
 
 class PreferencesBaseDialog(wx.Dialog):
-    """!Base preferences dialog"""
+    """Base preferences dialog"""
     def __init__(self, parent, giface, settings, title = _("User settings"),
                  size = (500, 475),
                  style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER):
@@ -99,7 +99,7 @@ class PreferencesBaseDialog(wx.Dialog):
         self._layout()
         
     def _layout(self):
-        """!Layout window"""
+        """Layout window"""
         # sizers
         btnSizer = wx.BoxSizer(wx.HORIZONTAL)
         btnSizer.Add(item = self.btnDefault, proportion = 1,
@@ -121,7 +121,7 @@ class PreferencesBaseDialog(wx.Dialog):
         mainSizer.Fit(self)
         
     def OnDefault(self, event):
-        """!Button 'Set to default' pressed"""
+        """Button 'Set to default' pressed"""
         self.settings.userSettings = copy.deepcopy(self.settings.defaultSettings)
         
         # update widgets
@@ -146,7 +146,7 @@ class PreferencesBaseDialog(wx.Dialog):
                 value = win.SetValue(value)
         
     def OnApply(self, event):
-        """!Button 'Apply' pressed
+        """Button 'Apply' pressed
         Emits signal settingsChanged.
         """
         if self._updateSettings():
@@ -158,11 +158,11 @@ class PreferencesBaseDialog(wx.Dialog):
         self.Hide()
         
     def OnCancel(self, event):
-        """!Button 'Cancel' pressed"""
+        """Button 'Cancel' pressed"""
         self.Close()
     
     def OnSave(self, event):
-        """!Button 'Save' pressed
+        """Button 'Save' pressed
         Emits signal settingsChanged.
         """
         if self._updateSettings():
@@ -181,7 +181,7 @@ class PreferencesBaseDialog(wx.Dialog):
             self.Close()
 
     def _updateSettings(self):
-        """!Update user settings"""
+        """Update user settings"""
         for item in self.winId.keys():
             try:
                 group, key, subkey = item.split(':')
@@ -221,7 +221,7 @@ class PreferencesBaseDialog(wx.Dialog):
 
 
 class PreferencesDialog(PreferencesBaseDialog):
-    """!User preferences dialog"""
+    """User preferences dialog"""
     def __init__(self, parent, giface, title = _("GUI Settings"),
                  settings = UserSettings):
         PreferencesBaseDialog.__init__(self, parent = parent, giface = giface, title = title,
@@ -240,7 +240,7 @@ class PreferencesDialog(PreferencesBaseDialog):
         self.SetSize(self.size)
         
     def _createGeneralPage(self, notebook):
-        """!Create notebook page for general settings"""
+        """Create notebook page for general settings"""
         panel = SP.ScrolledPanel(parent = notebook, id = wx.ID_ANY)
         panel.SetupScrolling(scroll_x = False, scroll_y = True)
         notebook.AddPage(page = panel, text = _("General"))
@@ -366,7 +366,7 @@ class PreferencesDialog(PreferencesBaseDialog):
         return panel
 
     def _createAppearancePage(self, notebook):
-        """!Create notebook page for display settings"""
+        """Create notebook page for display settings"""
         panel = SP.ScrolledPanel(parent = notebook, id = wx.ID_ANY)
         panel.SetupScrolling(scroll_x = False, scroll_y = True)
         notebook.AddPage(page = panel, text = _("Appearance"))
@@ -563,7 +563,7 @@ class PreferencesDialog(PreferencesBaseDialog):
         return panel
     
     def _createDisplayPage(self, notebook):
-        """!Create notebook page for display settings"""
+        """Create notebook page for display settings"""
    
         panel = SP.ScrolledPanel(parent = notebook, id = wx.ID_ANY)
         panel.SetupScrolling(scroll_x = False, scroll_y = True)
@@ -796,7 +796,7 @@ class PreferencesDialog(PreferencesBaseDialog):
         return panel
 
     def _createCmdPage(self, notebook):
-        """!Create notebook page for commad dialog settings"""
+        """Create notebook page for commad dialog settings"""
         panel = SP.ScrolledPanel(parent = notebook, id = wx.ID_ANY)
         panel.SetupScrolling(scroll_x = False, scroll_y = True)
         notebook.AddPage(page = panel, text = _("Modules"))
@@ -876,7 +876,7 @@ class PreferencesDialog(PreferencesBaseDialog):
         return panel
 
     def _createLayersPage(self, notebook):
-        """!Create notebook page for layer settings"""
+        """Create notebook page for layer settings"""
         panel = SP.ScrolledPanel(parent = notebook, id = wx.ID_ANY)
         panel.SetupScrolling(scroll_x = False, scroll_y = True)
         notebook.AddPage(page = panel, text = _("Layers"))
@@ -1047,7 +1047,7 @@ class PreferencesDialog(PreferencesBaseDialog):
         return panel
 
     def _createAttributeManagerPage(self, notebook):
-        """!Create notebook page for 'Attribute Table Manager' settings"""
+        """Create notebook page for 'Attribute Table Manager' settings"""
         panel = SP.ScrolledPanel(parent = notebook, id = wx.ID_ANY)
         panel.SetupScrolling(scroll_x = False, scroll_y = True)
         notebook.AddPage(page = panel, text = _("Attributes"))
@@ -1186,7 +1186,7 @@ class PreferencesDialog(PreferencesBaseDialog):
         return panel
 
     def _createProjectionPage(self, notebook):
-        """!Create notebook page for workspace settings"""
+        """Create notebook page for workspace settings"""
         panel = SP.ScrolledPanel(parent = notebook, id = wx.ID_ANY)
         panel.SetupScrolling(scroll_x = False, scroll_y = True)
         notebook.AddPage(page = panel, text = _("Projection"))
@@ -1362,7 +1362,7 @@ class PreferencesDialog(PreferencesBaseDialog):
         return True
 
     def OnCheckColorTable(self, event):
-        """!Set/unset default color table"""
+        """Set/unset default color table"""
         win = self.FindWindowById(self.winId['rasterLayer:colorTable:selection'])
         if event.IsChecked():
             win.Enable()
@@ -1370,7 +1370,7 @@ class PreferencesDialog(PreferencesBaseDialog):
             win.Enable(False)
         
     def OnLoadEpsgCodes(self, event):
-        """!Load EPSG codes from the file"""
+        """Load EPSG codes from the file"""
         win = self.FindWindowById(self.winId['projection:statusbar:projFile'])
         path = win.GetValue()
         wx.BeginBusyCursor()
@@ -1403,7 +1403,7 @@ class PreferencesDialog(PreferencesBaseDialog):
             win.SetValue(self.epsgCodeDict[code][1].replace('<>', '').strip())
     
     def OnSetEpsgCode(self, event):
-        """!EPSG code selected"""
+        """EPSG code selected"""
         winCode = self.FindWindowById(event.GetId())
         win = self.FindWindowById(self.winId['projection:statusbar:proj4'])
         if not self.epsgCodeDict:
@@ -1497,7 +1497,7 @@ class PreferencesDialog(PreferencesBaseDialog):
         event.Skip()
 
     def OnSetSymbol(self, event):
-        """!Opens symbol dialog"""
+        """Opens symbol dialog"""
         winId = self.winId['vectorLayer:point:symbol']
         label = self.FindWindowById(winId)
         bb = self.FindWindowByName('symbolButton')
@@ -1509,7 +1509,7 @@ class PreferencesDialog(PreferencesBaseDialog):
             bb.SetBitmapLabel(wx.Bitmap(img + '.png'))
 
     def OnEnableWheelZoom(self, event):
-        """!Enable/disable wheel zoom mode control"""
+        """Enable/disable wheel zoom mode control"""
         choiceId = self.winId['display:mouseWheelZoom:selection']
         choice = self.FindWindowById(choiceId)
         if choice.GetSelection() == 2:
@@ -1652,7 +1652,8 @@ class DefaultFontDialog(wx.Dialog):
     
     def GetFonts(self):
         """
-        parses fonts directory or fretypecap file to get a list of fonts for the listbox
+        parses fonts directory or fretypecap file to get a list of fonts
+        for the listbox
         """
         fontlist = []
         env = os.environ.copy()
@@ -1678,7 +1679,7 @@ class DefaultFontDialog(wx.Dialog):
         return fontlist
 
 class MapsetAccess(wx.Dialog):
-    """!Controls setting options and displaying/hiding map overlay
+    """Controls setting options and displaying/hiding map overlay
     decorations
     """
     def __init__(self, parent, id = wx.ID_ANY,
@@ -1743,7 +1744,7 @@ class MapsetAccess(wx.Dialog):
         self.SetMinSize(size)
         
     def GetMapsets(self):
-        """!Get list of checked mapsets"""
+        """Get list of checked mapsets"""
         ms = []
         i = 0
         for mset in self.all_mapsets_ordered:
@@ -1754,7 +1755,7 @@ class MapsetAccess(wx.Dialog):
         return ms
 
 class CheckListMapset(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.CheckListCtrlMixin):
-    """!List of mapset/owner/group"""
+    """List of mapset/owner/group"""
     def __init__(self, parent, log = None):
         self.parent = parent
         
@@ -1767,7 +1768,7 @@ class CheckListMapset(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.Check
         listmix.ListCtrlAutoWidthMixin.__init__(self)
 
     def LoadData(self):
-        """!Load data into list"""
+        """Load data into list"""
         self.InsertColumn(0, _('Mapset'))
         self.InsertColumn(1, _('Owner'))
         ### self.InsertColumn(2, _('Group'))
@@ -1795,7 +1796,7 @@ class CheckListMapset(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.Check
         ### self.SetColumnWidth(col = 1, width = wx.LIST_AUTOSIZE)
         
     def OnCheckItem(self, index, flag):
-        """!Mapset checked/unchecked"""
+        """Mapset checked/unchecked"""
         mapset = self.parent.all_mapsets_ordered[index]
         if mapset == self.parent.curr_mapset:
             self.CheckItem(index, True)

+ 28 - 27
gui/wxpython/gui_core/prompt.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package gui_core.prompt
 
 @brief wxGUI command prompt
@@ -37,7 +37,7 @@ from core.utils import _
 
 
 class GPrompt(object):
-    """!Abstract class for interactive wxGUI prompt
+    """Abstract class for interactive wxGUI prompt
     
     Signal promptRunCmd - emitted to run command from prompt
                         - attribute 'cmd'
@@ -70,7 +70,7 @@ class GPrompt(object):
         self.commands = list()
         
     def _readHistory(self):
-        """!Get list of commands from history file"""
+        """Get list of commands from history file"""
         hist = list()
         env = grass.gisenv()
         try:
@@ -91,7 +91,7 @@ class GPrompt(object):
         return hist
 
     def _getListOfMaps(self):
-        """!Get list of maps"""
+        """Get list of maps"""
         result = dict()
         result['raster'] = grass.list_strings('rast')
         result['vector'] = grass.list_strings('vect')
@@ -99,9 +99,9 @@ class GPrompt(object):
         return result
     
     def _runCmd(self, cmdString):
-        """!Run command
+        """Run command
         
-        @param cmdString command to run (given as a string)
+        :param str cmdString: command to run
         """
         if not cmdString:
             return
@@ -123,16 +123,16 @@ class GPrompt(object):
         self.ShowStatusText('')
         
     def GetCommands(self):
-        """!Get list of launched commands"""
+        """Get list of launched commands"""
         return self.commands
     
     def ClearCommands(self):
-        """!Clear list of commands"""
+        """Clear list of commands"""
         del self.commands[:]
 
 
 class GPromptSTC(GPrompt, wx.stc.StyledTextCtrl):
-    """!Styled wxGUI prompt with autocomplete and calltips"""    
+    """Styled wxGUI prompt with autocomplete and calltips"""  
     def __init__(self, parent, menuModel, margin = False):
         GPrompt.__init__(self, parent = parent, menuModel = menuModel)
         wx.stc.StyledTextCtrl.__init__(self, self.panel, id = wx.ID_ANY)
@@ -187,14 +187,14 @@ class GPromptSTC(GPrompt, wx.stc.StyledTextCtrl):
         self.commandSelected = Signal('GPromptSTC.commandSelected')
         
     def OnTextSelectionChanged(self, event):
-        """!Copy selected text to clipboard and skip event.
+        """Copy selected text to clipboard and skip event.
         The same function is in GStc class (goutput.py).
         """
         wx.CallAfter(self.Copy)
         event.Skip()
         
     def OnItemChanged(self, event):
-        """!Change text in statusbar 
+        """Change text in statusbar 
         if the item selection in the auto-completion list is changed"""
         # list of commands
         if self.toComplete['entity'] == 'command':
@@ -235,7 +235,7 @@ class GPromptSTC(GPrompt, wx.stc.StyledTextCtrl):
             self.ShowStatusText('')
             
     def OnItemSelected(self, event):
-        """!Item selected from the list"""
+        """Item selected from the list"""
         lastWord = self.GetWordLeft()
         # to insert selection correctly if selected word partly matches written text
         match = difflib.SequenceMatcher(None, event.GetText(), lastWord)
@@ -265,7 +265,7 @@ class GPromptSTC(GPrompt, wx.stc.StyledTextCtrl):
                 self.cmdDesc = None
 
     def OnKillFocus(self, event):
-        """!Hides autocomplete"""
+        """Hides autocomplete"""
         # hide autocomplete
         if self.AutoCompActive():
             self.AutoCompCancel()
@@ -280,9 +280,9 @@ class GPromptSTC(GPrompt, wx.stc.StyledTextCtrl):
         self.SetFocus()
 
     def UpdateCmdHistory(self, cmd):
-        """!Update command history
+        """Update command history
         
-        @param cmd command given as a string
+        :param cmd: command given as a string
         """
         # add command to history    
         self.cmdbuffer.append(cmd)
@@ -293,7 +293,7 @@ class GPromptSTC(GPrompt, wx.stc.StyledTextCtrl):
         self.cmdindex = len(self.cmdbuffer)
         
     def EntityToComplete(self):
-        """!Determines which part of command (flags, parameters) should
+        """Determines which part of command (flags, parameters) should
         be completed at current cursor position"""
         entry = self.GetTextLeft()
         toComplete = dict(cmd=None, entity=None)
@@ -348,11 +348,11 @@ class GPromptSTC(GPrompt, wx.stc.StyledTextCtrl):
         return toComplete
     
     def GetWordLeft(self, withDelimiter = False, ignoredDelimiter = None):
-        """!Get word left from current cursor position. The beginning
+        """Get word left from current cursor position. The beginning
         of the word is given by space or chars: .,-= 
         
-        @param withDelimiter returns the word with the initial delimeter
-        @param ignoredDelimiter finds the word ignoring certain delimeter
+        :param withDelimiter: returns the word with the initial delimeter
+        :param ignoredDelimiter: finds the word ignoring certain delimeter
         """
         textLeft = self.GetTextLeft()
         
@@ -369,13 +369,13 @@ class GPromptSTC(GPrompt, wx.stc.StyledTextCtrl):
         return min(parts, key=lambda x: len(x))
          
     def ShowList(self):
-        """!Show sorted auto-completion list if it is not empty"""
+        """Show sorted auto-completion list if it is not empty"""
         if len(self.autoCompList) > 0:
             self.autoCompList.sort()
             self.AutoCompShow(lenEntered = 0, itemList = ' '.join(self.autoCompList))    
 
     def OnKeyPressed(self, event):
-        """!Key pressed capture special treatment for tabulator to show help"""
+        """Key pressed capture special treatment for tabulator to show help"""
         pos = self.GetCurrentPos()
         if event.GetKeyCode() == wx.WXK_TAB:
             # show GRASS command calltips (to hide press 'ESC')
@@ -433,9 +433,10 @@ class GPromptSTC(GPrompt, wx.stc.StyledTextCtrl):
             event.Skip()
 
     def OnChar(self, event):
-        """!Key char capture for autocompletion, calltips, and command history
+        """Key char capture for autocompletion, calltips, and command history
 
-        @todo event.ControlDown() for manual autocomplete
+        .. todo::
+            event.ControlDown() for manual autocomplete
         """
         # keycodes used: "." = 46, "=" = 61, "-" = 45 
         pos = self.GetCurrentPos()
@@ -583,11 +584,11 @@ class GPromptSTC(GPrompt, wx.stc.StyledTextCtrl):
             event.Skip()
 
     def ShowStatusText(self, text):
-        """!Requests showing of notification, e.g. showing in a statusbar."""
+        """Requests showing of notification, e.g. showing in a statusbar."""
         self.showNotification.emit(message=text)
         
     def GetTextLeft(self):
-        """!Returns all text left of the caret"""
+        """Returns all text left of the caret"""
         pos = self.GetCurrentPos()
         self.HomeExtend()
         entry = self.GetSelectedText()
@@ -596,12 +597,12 @@ class GPromptSTC(GPrompt, wx.stc.StyledTextCtrl):
         return entry
     
     def OnDestroy(self, event):
-        """!The clipboard contents can be preserved after
+        """The clipboard contents can be preserved after
         the app has exited"""
         wx.TheClipboard.Flush()
         event.Skip()
 
     def OnCmdErase(self, event):
-        """!Erase command prompt"""
+        """Erase command prompt"""
         self.Home()
         self.DelLineRight()

+ 6 - 5
gui/wxpython/gui_core/pystc.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package gui_core.pystc
 
 @brief Python styled text control widget
@@ -23,11 +23,11 @@ from core.utils import _
 
 
 class PyStc(stc.StyledTextCtrl):
-    """!Styled Python output (see gmodeler::frame::PythonPanel for
+    """Styled Python output (see gmodeler::frame::PythonPanel for
     usage)
 
     Based on StyledTextCtrl_2 from wxPython demo
-    """    
+    """  
     def __init__(self, parent, id = wx.ID_ANY, statusbar = None):
         stc.StyledTextCtrl.__init__(self, parent, id)
         
@@ -126,9 +126,10 @@ class PyStc(stc.StyledTextCtrl):
         self.SetCaretForeground("BLUE")
         
     def OnKeyPressed(self, event):
-        """!Key pressed
+        """Key pressed
         
-        @todo implement code completion (see wxPython demo)
+        .. todo::
+            implement code completion (see wxPython demo)
         """
         if not self.modified:
             self.modified = True

+ 13 - 13
gui/wxpython/gui_core/query.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package gui_core.query
 
 @brief wxGUI query dialog
@@ -91,7 +91,7 @@ class QueryDialog(wx.Dialog):
         self._copyText(text)
 
     def ShowContextMenu(self, node):
-        """!Show context menu.
+        """Show context menu.
         
         Menu for copying distinguishes single and multiple selection.
         """
@@ -134,9 +134,9 @@ class QueryDialog(wx.Dialog):
             self.Unbind(wx.EVT_MENU, id=id)
 
     def _onRedirect(self, redirect):
-        """!Emits instructions to redirect query results.
+        """Emits instructions to redirect query results.
         
-        @param redirect True to start redirecting, False to stop        
+        :param redirect: True to start redirecting, False to stop        
         """
         if redirect:
             self.redirectOutput.emit(output=_("Query results:"), style='cmd')
@@ -157,7 +157,7 @@ class QueryDialog(wx.Dialog):
         return label
 
     def _copyText(self, text):
-        """!Helper function for copying"""
+        """Helper function for copying"""
         if wx.TheClipboard.Open():
             do = wx.TextDataObject()
             do.SetText(text)
@@ -172,12 +172,12 @@ class QueryDialog(wx.Dialog):
 
 
 def QueryTreeBuilder(data, column):
-    """!Builds tree model from query results.
+    """Builds tree model from query results.
 
-    @param data query results as a dictionary
-    @param column column name
+    :param data: query results as a dictionary
+    :param column: column name
 
-    @returns tree model
+    :return: tree model
     """
     def addNode(parent, data, model):
         for k, v in data.iteritems():
@@ -198,10 +198,10 @@ def QueryTreeBuilder(data, column):
 
 
 def printResults(model, valueCol):
-    """!Print all results to string.
+    """Print all results to string.
     
-    @param model results tree model
-    @param valueCol column name with value to be printed
+    :param model: results tree model
+    :param valueCol: column name with value to be printed
     """
     def printTree(node, textList, valueCol, indent=0):
         if node.data.get(valueCol, '') or node.children:
@@ -216,7 +216,7 @@ def printResults(model, valueCol):
 
 
 def PrepareQueryResults(coordinates, result):
-    """!Prepare query results as a Query dialog input.
+    """Prepare query results as a Query dialog input.
 
     Adds coordinates, improves vector results tree structure.
     """

+ 27 - 27
gui/wxpython/gui_core/simplelmgr.py

@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-"""!
+"""
 @package gui_core.simplelmgr
 
 @brief GUI class for simple layer management.
@@ -42,7 +42,7 @@ SIMPLE_LMGR_TB_RIGHT = 128
 
 
 class SimpleLayerManager(wx.Panel):
-    """!Simple layer manager class provides similar functionality to
+    """Simple layer manager class provides similar functionality to
     Layertree, but it's just list, not tree."""
     def __init__(self, parent, layerList,
                  lmgrStyle=SIMPLE_LMGR_RASTER | SIMPLE_LMGR_VECTOR | SIMPLE_LMGR_TB_LEFT,
@@ -110,7 +110,7 @@ class SimpleLayerManager(wx.Panel):
         self._auimgr.Update()
 
     def _selectionChanged(self):
-        """!Selection was changed externally,
+        """Selection was changed externally,
         updates selection info in layers."""
         if self._blockSelectionChanged:
             return
@@ -119,7 +119,7 @@ class SimpleLayerManager(wx.Panel):
             layer.Select(i in selected)
 
     def OnContextMenu(self, event):
-        """!Show context menu.
+        """Show context menu.
 
         So far offers only copying layer list to clipboard
         """
@@ -144,7 +144,7 @@ class SimpleLayerManager(wx.Panel):
         event.Skip()
 
     def _copyText(self, text):
-        """!Helper function for copying
+        """Helper function for copying
 
         TODO: move to utils?        
         """
@@ -155,7 +155,7 @@ class SimpleLayerManager(wx.Panel):
             wx.TheClipboard.Close()
 
     def OnLayerChecked(self, event):
-        """!Layer was (un)checked, update layer's info."""
+        """Layer was (un)checked, update layer's info."""
         checkedIdxs = self._checkList.GetChecked()
         for i, layer in enumerate(self._layerList):
             if i in checkedIdxs and not layer.IsActive():
@@ -168,7 +168,7 @@ class SimpleLayerManager(wx.Panel):
         event.Skip()
 
     def OnAddRaster(self, event):
-        """!Opens d.rast dialog and adds layer.
+        """Opens d.rast dialog and adds layer.
         Dummy layer is added first."""
         cmd = ['d.rast']
         layer = self.AddRaster(name='', cmd=cmd, hidden=True, dialog=None)
@@ -177,7 +177,7 @@ class SimpleLayerManager(wx.Panel):
         event.Skip()
 
     def OnAddVector(self, event):
-        """!Opens d.vect dialog and adds layer.
+        """Opens d.vect dialog and adds layer.
         Dummy layer is added first."""
         cmd = ['d.vect']
 
@@ -187,7 +187,7 @@ class SimpleLayerManager(wx.Panel):
         event.Skip()
 
     def OnAddRast3d(self, event):
-        """!Opens d.rast3d dialog and adds layer.
+        """Opens d.rast3d dialog and adds layer.
         Dummy layer is added first."""
         cmd = ['d.rast3d']
         layer = self.AddRast3d(name='', cmd=cmd, hidden=True, dialog=None)
@@ -196,7 +196,7 @@ class SimpleLayerManager(wx.Panel):
         event.Skip()
 
     def OnAddRGB(self, event):
-        """!Opens d.rgb dialog and adds layer.
+        """Opens d.rgb dialog and adds layer.
         Dummy layer is added first."""
         cmd = ['d.rgb']
         layer = self.AddRGB(name='', cmd=cmd, hidden=True, dialog=None)
@@ -205,7 +205,7 @@ class SimpleLayerManager(wx.Panel):
         event.Skip()
 
     def OnRemove(self, event):
-        """!Removes selected layers from list."""
+        """Removes selected layers from list."""
         layers = self._layerList.GetSelectedLayers(activeOnly=False)
         for layer in layers:
             self.layerRemoved.emit(index=self._layerList.GetLayerIndex(layer), layer=layer)
@@ -215,7 +215,7 @@ class SimpleLayerManager(wx.Panel):
         event.Skip()
 
     def OnLayerUp(self, event):
-        """!Moves selected layers one step up.
+        """Moves selected layers one step up.
 
         Note: not completely correct for multiple layers."""
         layers = self._layerList.GetSelectedLayers()
@@ -231,7 +231,7 @@ class SimpleLayerManager(wx.Panel):
         event.Skip()
 
     def OnLayerDown(self, event):
-        """!Moves selected layers one step down.
+        """Moves selected layers one step down.
 
         Note: not completely correct for multiple layers."""
         layers = self._layerList.GetSelectedLayers()
@@ -255,13 +255,13 @@ class SimpleLayerManager(wx.Panel):
         event.Skip()
 
     def _layerChangeProperties(self, layer):
-        """!Opens new module dialog or recycles it."""
+        """Opens new module dialog or recycles it."""
         GUI(parent=self, giface=None,
             modal=self._modal).ParseCommand(cmd=layer.cmd,
                                             completed=(self.GetOptData, layer, ''))
 
     def OnLayerChangeOpacity(self, event):
-        """!Opacity of a layer is changing."""
+        """Opacity of a layer is changing."""
         layers = self._layerList.GetSelectedLayers()
         if not layers or len(layers) > 1:
             return
@@ -278,14 +278,14 @@ class SimpleLayerManager(wx.Panel):
         event.Skip()
 
     def _setLayerOpacity(self, layer, value):
-        """!Sets layer's opacity.'"""
+        """Sets layer's opacity.'"""
         layer.opacity = value 
         self._update()
         self.opacityChanged.emit(index=self._layerList.GetLayerIndex(layer), layer=layer)
         self.anyChange.emit()
 
     def _update(self):
-        """!Updates checklistbox according to layerList structure."""
+        """Updates checklistbox according to layerList structure."""
         items = []
         active = []
         selected = []
@@ -315,7 +315,7 @@ class SimpleLayerManager(wx.Panel):
                 self._checkList.Deselect(i)
 
     def GetOptData(self, dcmd, layer, params, propwin):
-        """!Handler for module dialogs."""
+        """Handler for module dialogs."""
         if dcmd:
             layer.cmd = dcmd
             layer.selected = True
@@ -340,35 +340,35 @@ class SimpleLayerManager(wx.Panel):
             self.anyChange.emit()
 
     def AddRaster(self, name, cmd, hidden, dialog):
-        """!Ads new raster layer."""
+        """Ads new raster layer."""
         layer = self._layerList.AddNewLayer(name=name, mapType='rast',
                                             active=True,
                                             cmd=cmd, hidden=hidden)
         return layer
 
     def AddRast3d(self, name, cmd, hidden, dialog):
-        """!Ads new raster3d layer."""
+        """Ads new raster3d layer."""
         layer = self._layerList.AddNewLayer(name=name, mapType='rast3d',
                                             active=True,
                                             cmd=cmd, hidden=hidden)
         return layer
 
     def AddVector(self, name, cmd, hidden, dialog):
-        """!Ads new vector layer."""
+        """Ads new vector layer."""
         layer = self._layerList.AddNewLayer(name=name, mapType='vect',
                                             active=True,
                                             cmd=cmd, hidden=hidden)
         return layer
 
     def AddRGB(self, name, cmd, hidden, dialog):
-        """!Ads new vector layer."""
+        """Ads new vector layer."""
         layer = self._layerList.AddNewLayer(name=name, mapType='rgb',
                                             active=True,
                                             cmd=cmd, hidden=hidden)
         return layer
 
     def GetLayerInfo(self, layer, key):
-        """!Just for compatibility, should be removed in the future"""
+        """Just for compatibility, should be removed in the future"""
         value = getattr(layer, key)
         # hack to return empty list, required in OnCancel in forms
         # not sure why it should be empty
@@ -377,18 +377,18 @@ class SimpleLayerManager(wx.Panel):
         return value
 
     def Delete(self, layer):
-        """!Just for compatibility, should be removed in the future"""
+        """Just for compatibility, should be removed in the future"""
         self._layerList.RemoveLayer(layer)
 
 
 class SimpleLmgrToolbar(BaseToolbar):
-    """!Toolbar of simple layer manager.
+    """Toolbar of simple layer manager.
 
     Style of the toolbar can be changed (horizontal,
     vertical, which map types to include).
     """
     def __init__(self, parent, lmgrStyle):
-        """!Toolbar constructor
+        """Toolbar constructor
         """
         self._style = lmgrStyle
         if lmgrStyle & (SIMPLE_LMGR_TB_LEFT | SIMPLE_LMGR_TB_RIGHT):
@@ -403,7 +403,7 @@ class SimpleLmgrToolbar(BaseToolbar):
         self.Realize()
 
     def _toolbarData(self):
-        """!Toolbar data"""
+        """Toolbar data"""
         data = [('edit', icons['edit'],
                  self.parent.OnLayerChangeProperties),
                  ('remove', icons['remove'],

+ 41 - 40
gui/wxpython/gui_core/toolbars.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package gui_core.toolbars
 
 @brief Base classes toolbar widgets
@@ -85,11 +85,11 @@ BaseIcons = {
     }
     
 class BaseToolbar(wx.ToolBar):
-    """!Abstract toolbar class.
+    """Abstract toolbar class.
     
     Following code shows how to create new basic toolbar:
 
-    @code
+    
         class MyToolbar(BaseToolbar):
             def __init__(self, parent):
                 BaseToolbar.__init__(self, parent)
@@ -100,7 +100,7 @@ class BaseToolbar(wx.ToolBar):
                 return self._getToolbarData((("help", Icons["help"],
                                               self.parent.OnHelp),
                                               ))
-    @endcode
+    
     """
     def __init__(self, parent, toolSwitcher=None, style=wx.NO_BORDER|wx.TB_HORIZONTAL):
         self.parent = parent
@@ -115,7 +115,7 @@ class BaseToolbar(wx.ToolBar):
         self.handlers = {}
         
     def InitToolbar(self, toolData):
-        """!Initialize toolbar, add tools to the toolbar
+        """Initialize toolbar, add tools to the toolbar
         """
         for tool in toolData:
             self.CreateTool(*tool)
@@ -123,15 +123,15 @@ class BaseToolbar(wx.ToolBar):
         self._data = toolData
         
     def _toolbarData(self):
-        """!Toolbar data (virtual)"""
+        """Toolbar data (virtual)"""
         return None
     
     def CreateTool(self, label, bitmap, kind,
                    shortHelp, longHelp, handler, pos = -1):
-        """!Add tool to the toolbar
+        """Add tool to the toolbar
         
-        @param pos if -1 add tool, if > 0 insert at given pos
-        @return id of tool
+        :param pos: if -1 add tool, if > 0 insert at given pos
+        :return: id of tool
         """
         bmpDisabled = wx.NullBitmap
         tool = -1
@@ -156,9 +156,9 @@ class BaseToolbar(wx.ToolBar):
         return tool
 
     def EnableLongHelp(self, enable = True):
-        """!Enable/disable long help
+        """Enable/disable long help
         
-        @param enable True for enable otherwise disable
+        :param enable: True for enable otherwise disable
         """
         for tool in self._data:
             if tool[0] == '': # separator
@@ -170,7 +170,7 @@ class BaseToolbar(wx.ToolBar):
                 self.SetToolLongHelp(vars(self)[tool[0]], "")
         
     def OnTool(self, event):
-        """!Tool selected
+        """Tool selected
         """
         if self.toolSwitcher:
             Debug.msg(3, "BaseToolbar.OnTool(): id = %s" % event.GetId())
@@ -184,23 +184,24 @@ class BaseToolbar(wx.ToolBar):
         self.handlers[id](event=None)
 
     def SelectDefault(self):
-        """!Select default tool"""
+        """Select default tool"""
         self.SelectTool(self._default)
         
     def FixSize(self, width):
-        """!Fix toolbar width on Windows
+        """Fix toolbar width on Windows
             
-        @todo Determine why combobox causes problems here
+        .. todo::
+            Determine why combobox causes problems here
         """
         if platform.system() == 'Windows':
             size = self.GetBestSize()
             self.SetSize((size[0] + width, size[1]))
 
     def Enable(self, tool, enable = True):
-        """!Enable/Disable defined tool
+        """Enable/Disable defined tool
         
-        @param tool name
-        @param enable True to enable otherwise disable tool
+        :param tool: name
+        :param enable: True to enable otherwise disable tool
         """
         try:
             id = getattr(self, tool)
@@ -213,9 +214,9 @@ class BaseToolbar(wx.ToolBar):
         self.EnableTool(id, enable)
 
     def EnableAll(self, enable = True):
-        """!Enable/Disable all tools
+        """Enable/Disable all tools
         
-        @param enable True to enable otherwise disable tool
+        :param enable: True to enable otherwise disable tool
         """
         for item in self._toolbarData():
             if not item[0]:
@@ -223,7 +224,7 @@ class BaseToolbar(wx.ToolBar):
             self.Enable(item[0], enable)
         
     def _getToolbarData(self, data):
-        """!Define tool
+        """Define tool
         """
         retData = list()
         for args in data:
@@ -231,7 +232,7 @@ class BaseToolbar(wx.ToolBar):
         return retData
 
     def _defineTool(self, name = None, icon = None, handler = None, item = wx.ITEM_NORMAL, pos = -1):
-        """!Define tool
+        """Define tool
         """
         if name:
             return (name, icon.GetBitmap(),
@@ -240,7 +241,7 @@ class BaseToolbar(wx.ToolBar):
         return ("", "", "", "", "", "") # separator
 
     def _onMenu(self, data):
-        """!Toolbar pop-up menu"""
+        """Toolbar pop-up menu"""
         menu = wx.Menu()
         
         for icon, handler in data:
@@ -253,7 +254,7 @@ class BaseToolbar(wx.ToolBar):
         menu.Destroy()
 
     def CreateSelectionButton(self, tooltip = _("Select graphics tool")):
-        """!Add button to toolbar for selection of graphics drawing mode.
+        """Add button to toolbar for selection of graphics drawing mode.
 
         Button must be custom (not toolbar tool) to set smaller width.
         """
@@ -269,7 +270,7 @@ class BaseToolbar(wx.ToolBar):
         return button
 
 class ToolSwitcher:
-    """!Class handling switching tools in toolbar and custom toggle buttons."""
+    """Class handling switching tools in toolbar and custom toggle buttons."""
     def __init__(self):
         self._groups = defaultdict(lambda: defaultdict(list))
         self._toolsGroups = defaultdict(list)
@@ -278,29 +279,29 @@ class ToolSwitcher:
         self.toggleToolChanged = Signal('ToolSwitcher.toggleToolChanged')
 
     def AddToolToGroup(self, group, toolbar, tool):
-        """!Adds tool from toolbar to group of exclusive tools.
+        """Adds tool from toolbar to group of exclusive tools.
         
-        @param group name of group (e.g. 'mouseUse')
-        @param toolbar instance of toolbar
-        @param tool id of a tool from the toolbar
+        :param group: name of group (e.g. 'mouseUse')
+        :param toolbar: instance of toolbar
+        :param tool: id of a tool from the toolbar
         """
         self._groups[group][toolbar].append(tool)
         self._toolsGroups[tool].append(group)
         
     def AddCustomToolToGroup(self, group, btnId, toggleHandler):
-        """!Adds custom tool from to group of exclusive tools (some toggle button).
+        """Adds custom tool from to group of exclusive tools (some toggle button).
         
-        @param group name of group (e.g. 'mouseUse')
-        @param btnId id of a tool (typically button)
-        @param toggleHandler handler to be called to switch the button
+        :param group: name of group (e.g. 'mouseUse')
+        :param btnId: id of a tool (typically button)
+        :param toggleHandler: handler to be called to switch the button
         """
         self._groups[group]['custom'].append((btnId, toggleHandler))
         self._toolsGroups[btnId].append(group)
        
     def RemoveCustomToolFromGroup(self, tool):
-        """!Removes custom tool from group.
+        """Removes custom tool from group.
 
-        @param tool id of the button
+        :param tool: id of the button
         """
         if not tool in self._toolsGroups:
             return
@@ -310,13 +311,13 @@ class ToolSwitcher:
                 in self._groups[group]['custom'] if bid != tool]
         
     def RemoveToolbarFromGroup(self, group, toolbar):
-        """!Removes toolbar from group.
+        """Removes toolbar from group.
         
         Before toolbar is destroyed, it must be removed from group, too.
         Otherwise we can expect some DeadObject errors.
         
-        @param group name of group (e.g. 'mouseUse')
-        @param toolbar instance of toolbar
+        :param group: name of group (e.g. 'mouseUse')
+        :param toolbar: instance of toolbar
         """
         for tb in self._groups[group]:
             if tb == toolbar:
@@ -324,9 +325,9 @@ class ToolSwitcher:
                 break
 
     def ToolChanged(self, tool):
-        """!When any tool/button is pressed, other tools from group must be unchecked.
+        """When any tool/button is pressed, other tools from group must be unchecked.
         
-        @param tool id of a tool/button
+        :param tool: id of a tool/button
         """
         for group in self._toolsGroups[tool]:
             for tb in self._groups[group]:

+ 23 - 23
gui/wxpython/gui_core/treeview.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package gui_core.treeview
 
 @brief tree view for dislaying tree model (used for search tree)
@@ -32,7 +32,7 @@ from grass.pydispatch.signal import Signal
 
 
 class AbstractTreeViewMixin(VirtualTree):
-    """!Abstract tree view class for displaying tree model.
+    """Abstract tree view class for displaying tree model.
 
     Concrete implementation must inherit both this mixin class and a wx tree widget.
     More functionality and signals can be added if needed.
@@ -58,18 +58,18 @@ class AbstractTreeViewMixin(VirtualTree):
                                            self._emitSignal(evt.GetItem(), self.contextMenu))
 
     def SetModel(self, model):
-        """!Set tree model and refresh.
+        """Set tree model and refresh.
         
-        @param model tree model        
+        :param model: tree model        
         """
         self._model = model
         self.RefreshItems()
 
     def OnGetItemText(self, index, column=0):
-        """!Overridden method necessary to communicate with tree model.
+        """Overridden method necessary to communicate with tree model.
 
-        @param index index as explained in VirtualTree doc
-        @param column column index if applicable
+        :param index: index as explained in VirtualTree doc
+        :param column: column index if applicable
         """
         node = self._model.GetNodeByIndex(index)
         # remove & because of & needed in menu (&Files)
@@ -77,13 +77,13 @@ class AbstractTreeViewMixin(VirtualTree):
         return label
 
     def OnGetChildrenCount(self, index):
-        """!Overridden method necessary to communicate with tree model."""
+        """Overridden method necessary to communicate with tree model."""
         return len(self._model.GetChildrenByIndex(index))
 
     def GetSelected(self):
-        """!Get currently selected items.
+        """Get currently selected items.
 
-        @return list of nodes representing selected items (can be empty)
+        :return: list of nodes representing selected items (can be empty)
         """
         selected = []
         for sel in self.GetSelections():
@@ -92,10 +92,10 @@ class AbstractTreeViewMixin(VirtualTree):
         return selected
 
     def Select(self, node, select=True):
-        """!Select items.
+        """Select items.
 
-        @param node node representing item
-        @param select True/False to select/deselect
+        :param node: node representing item
+        :param select: True/False to select/deselect
         """
         index = self._model.GetIndexOfNode(node)
         for i in range(len(index))[1:]:
@@ -108,10 +108,10 @@ class AbstractTreeViewMixin(VirtualTree):
         self.SelectItem(item, select)
 
     def _emitSignal(self, item, signal):
-        """!Helper method for emitting signals.
+        """Helper method for emitting signals.
 
-        @param item tree item
-        @param signal signal to be emitted
+        :param item: tree item
+        :param signal: signal to be emitted
         """
         if not item or not item.IsOk():
             return
@@ -121,13 +121,13 @@ class AbstractTreeViewMixin(VirtualTree):
 
 
 class TreeView(AbstractTreeViewMixin, wx.TreeCtrl):
-    """!Tree view class inheriting from wx.TreeCtrl"""
+    """Tree view class inheriting from wx.TreeCtrl"""
     def __init__(self, model, parent, *args, **kw):
         super(TreeView, self).__init__(parent=parent, model=model, *args, **kw)
         self.RefreshItems()
 
 class CTreeView(AbstractTreeViewMixin, CT.CustomTreeCtrl):
-    """!Tree view class inheriting from wx.TreeCtrl"""
+    """Tree view class inheriting from wx.TreeCtrl"""
     def __init__(self, model, parent, **kw):
         if hasAgw:
             style = 'agwStyle'
@@ -154,10 +154,10 @@ class TreeListView(AbstractTreeViewMixin, ExpansionState, gizmos.TreeListCtrl):
         self.Bind(wx.EVT_TREE_ITEM_RIGHT_CLICK, self.OnRightClick)
 
     def OnGetItemText(self, index, column=0):
-        """!Overridden method necessary to communicate with tree model.
+        """Overridden method necessary to communicate with tree model.
 
-        @param index index as explained in VirtualTree doc
-        @param column column index if applicable
+        :param index: index as explained in VirtualTree doc
+        :param column: column index if applicable
         """
         node = self._model.GetNodeByIndex(index)
         # remove & because of & needed in menu (&Files)
@@ -168,7 +168,7 @@ class TreeListView(AbstractTreeViewMixin, ExpansionState, gizmos.TreeListCtrl):
             return label
 
     def OnRightClick(self, event):
-        """!Select item on right click.
+        """Select item on right click.
         
         With multiple selection we don't want to deselect all items        
         """
@@ -178,7 +178,7 @@ class TreeListView(AbstractTreeViewMixin, ExpansionState, gizmos.TreeListCtrl):
         event.Skip()
 
 class TreeFrame(wx.Frame):
-    """!Frame for testing purposes only."""
+    """Frame for testing purposes only."""
     def __init__(self, model=None):
         wx.Frame.__init__(self, None, title='Test tree')
 

File diff suppressed because it is too large
+ 298 - 282
gui/wxpython/gui_core/widgets.py


+ 60 - 58
gui/wxpython/iclass/dialogs.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package iclass.dialogs
 
 @brief wxIClass dialogs
@@ -37,15 +37,15 @@ from iclass.statistics  import Statistics, BandStatistics
 import grass.script as grass
 
 class IClassGroupDialog(SimpleDialog):
-    """!Dialog for imagery group selection"""
+    """Dialog for imagery group selection"""
     def __init__(self, parent, group = None, subgroup = None, 
                  title = _("Select imagery group"), id = wx.ID_ANY):
-        """!
+        """
         Does post init and layout.
         
-        @param gui parent
-        @param title dialog window title
-        @param id wx id
+        :param parent: gui parent
+        :param title: dialog window title
+        :param id: wx id
         """
         SimpleDialog.__init__(self, parent, title)
         
@@ -80,7 +80,7 @@ class IClassGroupDialog(SimpleDialog):
         self.SetMinSize(self.GetSize())
 
     def _layout(self):
-        """!Do layout"""
+        """Do layout"""
         self.dataSizer.Add(wx.StaticText(self.panel, id = wx.ID_ANY,
                                          label = _("Name of imagery group:")),
                                          proportion = 0, 
@@ -123,7 +123,7 @@ class IClassGroupDialog(SimpleDialog):
         self.Layout()
 
     def GetData(self):
-        """!Returns selected group and subgroup"""
+        """Returns selected group and subgroup"""
 
         if self.use_subg:
             ret = (self.groupSelect.GetValue(), self.subGroupSelect.GetValue())
@@ -133,7 +133,7 @@ class IClassGroupDialog(SimpleDialog):
         return ret
         
     def OnEditGroup(self, event):
-        """!Launch edit group dialog"""
+        """Launch edit group dialog"""
         g, s = self.GetData()
         dlg = GroupDialog(parent=self, defaultGroup=g, defaultSubgroup=s)
 
@@ -150,11 +150,11 @@ class IClassGroupDialog(SimpleDialog):
         self.subGroupSelect.Insert(group)
 
     def GetSelectedGroup(self):
-        """!Return currently selected group (without mapset)"""
+        """Return currently selected group (without mapset)"""
         return self.groupSelect.GetValue().split('@')[0]
 
     def GetGroupBandsErr(self, parent):
-        """!Get list of raster bands which are in the soubgroup of group with both having same name.
+        """Get list of raster bands which are in the soubgroup of group with both having same name.
            If the group does not exists or it does not contain any bands in subgoup with same name, 
            error dialog is shown.
         """
@@ -191,7 +191,7 @@ class IClassGroupDialog(SimpleDialog):
         return bands
 
     def GetGroupBands(self, group, subgroup):
-        """!Get list of raster bands which are in the soubgroup of group with both having same name."""
+        """Get list of raster bands which are in the soubgroup of group with both having same name."""
 
         kwargs = {}
         if subgroup:
@@ -212,13 +212,13 @@ class IClassGroupDialog(SimpleDialog):
                            read=True, flags='sg').splitlines()
 
 class IClassMapDialog(SimpleDialog):
-    """!Dialog for adding raster/vector map"""
+    """Dialog for adding raster/vector map"""
     def __init__(self, parent, title, element):
-        """!
+        """
         
-        @param parent gui parent
-        @param title dialog title
-        @param element element type ('raster', 'vector')
+        :param parent: gui parent
+        :param title: dialog title
+        :param element: element type ('raster', 'vector')
         """
         
         SimpleDialog.__init__(self, parent, title = title)
@@ -234,7 +234,7 @@ class IClassMapDialog(SimpleDialog):
         self.SetMinSize(self.GetSize())
 
     def _layout(self):
-        """!Do layout"""
+        """Do layout"""
         if self.elementType == 'raster':
             label = _("Name of raster map:")
         elif self.elementType == 'vector':
@@ -249,22 +249,22 @@ class IClassMapDialog(SimpleDialog):
         self.sizer.Fit(self)
 
     def GetMap(self):
-        """!Returns selected raster/vector map"""
+        """Returns selected raster/vector map"""
         return self.element.GetValue()
 
 
 class IClassCategoryManagerDialog(wx.Dialog):
-    """!Dialog for managing categories (classes).
+    """Dialog for managing categories (classes).
     
     Alows adding, deleting class and changing its name and color.
     """
     def __init__(self, parent, title = _("Class manager"), id = wx.ID_ANY):
-        """!
+        """
         Does post init and layout.
         
-        @param gui parent
-        @param title dialog window title
-        @param id wx id
+        :param parent: gui parent
+        :param title: dialog window title
+        :param id: wx id
         """
         wx.Dialog.__init__(self, parent = parent, title = title, id = id)
         
@@ -330,26 +330,27 @@ class IClassCategoryManagerDialog(wx.Dialog):
         #event.Skip()
         
     def GetListCtrl(self):
-        """!Returns list widget"""
+        """Returns list widget"""
         return self.catList
         
 class CategoryListCtrl(wx.ListCtrl,
                        listmix.ListCtrlAutoWidthMixin,
                        listmix.TextEditMixin):
-    """! Widget for controling list of classes (categories).
+    """Widget for controling list of classes (categories).
     
     CategoryListCtrl updates choice in mapwindow and removes raster map
     when deleting class (category).
     It uses virtual data in the terms of @c wx.ListCtrl.
     
-    @todo delete vector features after deleting class
+    .. todo::
+        delete vector features after deleting class
     """
     def __init__(self, parent, mapwindow, stats_data, id = wx.ID_ANY):
-        """!
-        @param parent gui parent
-        @param mapwindow mapwindow instance with iclass toolbar and remove raster method
-        @param stats_data StatisticsData instance (defined in statistics.py)
-        @param id wx id
+        """
+        :param parent: gui parent
+        :param mapwindow: mapwindow instance with iclass toolbar and remove raster method
+        :param stats_data: StatisticsData instance (defined in statistics.py)
+        :param id: wx id
         """
         wx.ListCtrl.__init__(self, parent, id,
                              style = wx.LC_REPORT|wx.LC_VIRTUAL|wx.LC_HRULES|wx.LC_VRULES)
@@ -409,7 +410,7 @@ class CategoryListCtrl(wx.ListCtrl,
         self.SetColumnWidth(1, 100)
         
     def AddCategory(self, cat, name, color):
-        """!Add category record (used when importing areas)"""
+        """Add category record (used when importing areas)"""
 
         self.stats_data.AddStatistics(cat, name, color)
         self.SetItemCount(len(self.stats_data.GetCategories()))
@@ -473,7 +474,7 @@ class CategoryListCtrl(wx.ListCtrl,
         event.Skip()
         
     def OnCategorySelected(self, event):
-        """!Highlight selected areas"""
+        """Highlight selected areas"""
         indexList = self.GetSelectedIndices()
         sel_cats = []
         cats = self.stats_data.GetCategories()
@@ -485,7 +486,7 @@ class CategoryListCtrl(wx.ListCtrl,
             event.Skip()
         
     def OnClassRightUp(self, event):
-        """!Show context menu on right click"""
+        """Show context menu on right click"""
         item, flags = self.HitTest((event.GetX(), event.GetY()))
         if item != wx.NOT_FOUND and flags & wx.LIST_HITTEST_ONITEM:
             self.rightClickedItemIdx = item
@@ -502,12 +503,12 @@ class CategoryListCtrl(wx.ListCtrl,
         menu.Destroy()
     
     def OnZoomToAreasByCat(self, event):
-        """!Zoom to areas of given category"""
+        """Zoom to areas of given category"""
         cat = self.stats_data.GetCategories()[self.rightClickedItemIdx]
         self.mapWindow.ZoomToAreasByCat(cat)
         
     def DeselectAll(self):
-        """!Deselect all items"""
+        """Deselect all items"""
         indexList = self.GetSelectedIndices()
         for i in indexList:
             self.Select(i, on = 0)
@@ -527,7 +528,7 @@ class CategoryListCtrl(wx.ListCtrl,
         return None
 
     def OnGetItemAttr(self, item):
-        """!Set correct class color for a item"""
+        """Set correct class color for a item"""
         back_c = wx.Colour(*map(int, self.OnGetItemText(item, 1).split(':')))
         text_c = wx.Colour(*ContrastColor(back_c))
 
@@ -536,10 +537,11 @@ class CategoryListCtrl(wx.ListCtrl,
         return self.l
     
 def ContrastColor(color):
-    """!Decides which value shoud have text to be contrast with backgroud color 
+    """Decides which value shoud have text to be contrast with backgroud color 
         (bright bg -> black, dark bg -> white)
 
-    @todo could be useful by other apps, consider moving it into gui_core 
+    .. todo::
+        could be useful by other apps, consider moving it into gui_core 
     """
     #gacek, http://stackoverflow.com/questions/1855884/determine-font-color-based-on-background-color
     a = 1 - ( 0.299 * color[0] + 0.587 * color[1] + 0.114 * color[2])/255;
@@ -556,12 +558,12 @@ class IClassSignatureFileDialog(wx.Dialog):
                  file = None, title = _("Save signature file"), id = wx.ID_ANY,
                  style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER,
                  **kwargs):
-        """!Dialog for saving signature file
+        """Dialog for saving signature file
         
-        @param parent window
-        @param group group name
-        @param file signature file name
-        @param title window title
+        :param parent: window
+        :param group: group name
+        :param file: signature file name
+        :param title: window title
         """
         wx.Dialog.__init__(self, parent, id, title, style = style, **kwargs)
         
@@ -590,7 +592,7 @@ class IClassSignatureFileDialog(wx.Dialog):
         self.OnTextChanged(None)
         
     def OnTextChanged(self, event):
-        """!Name for signature file given"""
+        """Name for signature file given"""
         file = self.fileNameCtrl.GetValue()
         if len(file) > 0:
             self.btnOK.Enable(True)
@@ -604,7 +606,7 @@ class IClassSignatureFileDialog(wx.Dialog):
         self.pathPanel.Scroll(*bestSize)
         
     def __layout(self):
-        """!Do layout"""
+        """Do layout"""
         sizer = wx.BoxSizer(wx.VERTICAL)
         
         dataSizer = wx.BoxSizer(wx.VERTICAL)
@@ -651,9 +653,9 @@ class IClassSignatureFileDialog(wx.Dialog):
         self.SetMinSize(self.GetSize())
         
     def GetFileName(self, fullPath = False):
-        """!Returns signature file name
+        """Returns signature file name
         
-        @param fullPath return full path of sig. file
+        :param fullPath: return full path of sig. file
         """
         if fullPath:
             return os.path.join(self.baseFilePath, self.fileNameCtrl.GetValue())
@@ -664,11 +666,11 @@ class IClassExportAreasDialog(wx.Dialog):
     def __init__(self, parent, vectorName = None, title = _("Export training areas"), id = wx.ID_ANY,
                  style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER,
                  **kwargs):
-        """!Dialog for export of training areas to vector layer
+        """Dialog for export of training areas to vector layer
         
-        @param parent window
-        @param vectorName name of vector layer for export
-        @param title window title
+        :param parent: window
+        :param vectorName: name of vector layer for export
+        :param title: window title
         """
         wx.Dialog.__init__(self, parent, id, title, style = style, **kwargs)
         
@@ -688,7 +690,7 @@ class IClassExportAreasDialog(wx.Dialog):
         wx.CallAfter(self.vectorNameCtrl.SetFocus)
 
     def OnTextChanged(self, event):
-        """!Name of new vector map given.
+        """Name of new vector map given.
         
         Enable/diable OK button.
         """
@@ -699,7 +701,7 @@ class IClassExportAreasDialog(wx.Dialog):
             self.btnOK.Enable(False)
         
     def __layout(self):
-        """!Do layout"""
+        """Do layout"""
         sizer = wx.BoxSizer(wx.VERTICAL)
         
         dataSizer = wx.BoxSizer(wx.VERTICAL)
@@ -741,15 +743,15 @@ class IClassExportAreasDialog(wx.Dialog):
         self.SetMinSize(self.GetSize())
         
     def GetVectorName(self):
-        """!Returns vector name"""
+        """Returns vector name"""
         return self.vectorNameCtrl.GetValue()
         
     def WithTable(self):
-        """!Returns true if attribute table should be exported too"""
+        """Returns true if attribute table should be exported too"""
         return self.withTableCtrl.IsChecked()
         
     def OnOK(self, event):
-        """!Checks if map exists and can be overwritten."""
+        """Checks if map exists and can be overwritten."""
         overwrite = UserSettings.Get(group = 'cmd', key = 'overwrite', subkey = 'enabled')
         vName = self.GetVectorName()
         res = grass.find_file(vName, element = 'vector')

+ 25 - 24
gui/wxpython/iclass/digit.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package iclass.digit
 
 @brief wxIClass digitizer classes
@@ -33,14 +33,14 @@ except ImportError:
 import grass.script as grass
 
 class IClassVDigitWindow(VDigitWindow):
-    """! Class similar to VDigitWindow but specialized for wxIClass."""
+    """Class similar to VDigitWindow but specialized for wxIClass."""
     def __init__(self, parent, giface, map, properties):
-        """!
+        """
         
         @a parent should has toolbar providing current class (category).
         
-        @param parent gui parent
-        @param map map renderer instance
+        :param parent: gui parent
+        :param map: map renderer instance
         """
         VDigitWindow.__init__(self, parent=parent, giface=giface,
                               Map=map, properties=properties)
@@ -89,7 +89,7 @@ class IClassVDigitWindow(VDigitWindow):
         self.parent.UpdateChangeState(changes = True)
         
     def GetCurrentCategory(self):
-        """!Returns current category (class).
+        """Returns current category (class).
         
         Category should be assigned to new features (areas).
         It is taken from parent's toolbar.
@@ -97,12 +97,12 @@ class IClassVDigitWindow(VDigitWindow):
         return self.parent.GetToolbar("iClass").GetSelectedCategoryIdx()
 
     def GetCategoryColor(self, cat):
-        """!Get color associated with given category"""
+        """Get color associated with given category"""
         r, g, b = map(int, self.parent.GetClassColor(cat).split(':'))
         return wx.Colour(r, g, b)
         
 class IClassVDigit(IVDigit):
-    """! Class similar to IVDigit but specialized for wxIClass."""
+    """Class similar to IVDigit but specialized for wxIClass."""
     def __init__(self, mapwindow):
         IVDigit.__init__(self, mapwindow, driver = IClassDisplayDriver)
         self._settings['closeBoundary'] = True # snap to the first node
@@ -115,23 +115,23 @@ class IClassVDigit(IVDigit):
         return cat
         
     def DeleteAreasByCat(self, cats):
-        """!Delete areas (centroid+boundaries) by categories
+        """Delete areas (centroid+boundaries) by categories
 
-        @param cats list of categories
+        :param cats: list of categories
         """
         for cat in cats:
             Vedit_delete_areas_cat(self.poMapInfo, 1, cat)
        
     def CopyMap(self, name, tmp = False):
-        """!Make a copy of open vector map
+        """Make a copy of open vector map
 
         Note: Attributes are not copied
         
-        @param name name for a copy
-        @param tmp True for temporary map
+        :param name: name for a copy
+        :param tmp: True for temporary map
 
-        @return number of copied features
-        @return -1 on error
+        :return: number of copied features
+        :return: -1 on error
         """
         if not self.poMapInfo:
             # nothing to copy
@@ -164,22 +164,23 @@ class IClassVDigit(IVDigit):
         return ret
 
     def GetMapInfo(self):
-        """!Returns Map_info() struct of open vector map"""
+        """Returns Map_info() struct of open vector map"""
         return self.poMapInfo
 
 class IClassDisplayDriver(DisplayDriver):
-    """! Class similar to DisplayDriver but specialized for wxIClass
+    """Class similar to DisplayDriver but specialized for wxIClass
 
-    @todo needs refactoring (glog, gprogress)
+    .. todo::
+        needs refactoring (glog, gprogress)
     """
     def __init__(self, device, deviceTmp, mapObj, window, glog, gprogress):
         DisplayDriver.__init__(self, device, deviceTmp, mapObj, window, glog, gprogress)
         self._cat = -1
         
     def _drawObject(self, robj):
-        """!Draw given object to the device
+        """Draw given object to the device
 
-        @param robj object to draw
+        :param robj: object to draw
         """
         if robj.type == TYPE_AREA:
             self._cat = Vect_get_area_cat(self.poMapInfo, robj.fid, 1)
@@ -188,11 +189,11 @@ class IClassDisplayDriver(DisplayDriver):
         DisplayDriver._drawObject(self, robj)
         
     def _definePen(self, rtype):
-        """!Define pen/brush based on rendered object)
+        """Define pen/brush based on rendered object)
 
-        @param rtype type of the object
+        :param rtype: type of the object
 
-        @return pen, brush
+        :return: pen, brush
         """
         pen, brush = DisplayDriver._definePen(self, rtype)
         if self._cat > 0 and rtype == TYPE_AREA:
@@ -201,7 +202,7 @@ class IClassDisplayDriver(DisplayDriver):
         return pen, brush
 
     def CloseMap(self):
-        """!Close training areas map - be quiet"""
+        """Close training areas map - be quiet"""
         verbosity = G_verbose()
         G_set_verbose(0)
         DisplayDriver.CloseMap(self)

+ 104 - 98
gui/wxpython/iclass/frame.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package iclass.frame
 
 @brief wxIClass frame with toolbar for digitizing training areas and
@@ -63,7 +63,7 @@ from iclass.plots       import PlotPanel
 from grass.pydispatch.signal import Signal
 
 class IClassMapFrame(DoubleMapFrame):
-    """! wxIClass main frame
+    """wxIClass main frame
     
     It has two map windows one for digitizing training areas and one for
     result preview.
@@ -75,11 +75,11 @@ class IClassMapFrame(DoubleMapFrame):
     def __init__(self, parent = None, giface = None, title = _("GRASS GIS Supervised Classification Tool"),
                  toolbars = ["iClassMisc", "iClassMap", "vdigit", "iClass"],
                  size = (875, 600), name = 'IClassWindow', **kwargs):
-        """!
-        @param parent (no parent is expected)
-        @param title window title
-        @param toolbars dictionary of active toolbars (defalult value represents all toolbars)
-        @param size default size
+        """
+        :param parent: (no parent is expected)
+        :param title: window title
+        :param toolbars: dictionary of active toolbars (defalult value represents all toolbars)
+        :param size: default size
         """
         DoubleMapFrame.__init__(self, parent = parent, title = title,
                                 name = name,
@@ -208,7 +208,7 @@ class IClassMapFrame(DoubleMapFrame):
         self.Destroy()
         
     def __del__(self):
-        """! Frees C structs and removes vector map and all raster maps."""
+        """Frees C structs and removes vector map and all raster maps."""
         I_free_signatures(self.signatures)
         I_free_group_ref(self.refer)
         for st in self.cStatisticsDict.values():
@@ -219,21 +219,21 @@ class IClassMapFrame(DoubleMapFrame):
             self.RemoveTempRaster(self.stats_data.GetStatistics(i).rasterName)
             
     def OnHelp(self, event):
-        """!Show help page"""
+        """Show help page"""
         self._giface.Help(entry = 'wxGUI.iclass')
         
     def _getTempVectorName(self):
-        """!Return new name for temporary vector map (training areas)"""
+        """Return new name for temporary vector map (training areas)"""
         vectorPath = grass.tempfile(create = False)
         
         return 'trAreas' + os.path.basename(vectorPath).replace('.','')
 
     def SetGroup(self, group, subgroup):
-        """!Set group and subgroup manually"""
+        """Set group and subgroup manually"""
         self.g = {'group' : group, 'subgroup' : subgroup}
 
     def CreateTempVector(self):
-        """!Create temporary vector map for training areas"""
+        """Create temporary vector map for training areas"""
         vectorName = self._getTempVectorName()
         
         env = os.environ.copy()
@@ -251,7 +251,7 @@ class IClassMapFrame(DoubleMapFrame):
         return vectorName
     
     def RemoveTempVector(self):
-        """!Removes temporary vector map with training areas"""
+        """Removes temporary vector map with training areas"""
         ret = RunCommand(prog = 'g.remove',
                          parent = self,
                          flags = 'f',
@@ -262,7 +262,7 @@ class IClassMapFrame(DoubleMapFrame):
         return True
         
     def RemoveTempRaster(self, raster):
-        """!Removes temporary raster maps"""
+        """Removes temporary raster maps"""
         self.GetFirstMap().Clean()
         self.GetSecondMap().Clean()
         ret = RunCommand(prog = 'g.remove',
@@ -275,7 +275,7 @@ class IClassMapFrame(DoubleMapFrame):
         return True
 
     def AddToolbar(self, name):
-        """!Add defined toolbar to the window
+        """Add defined toolbar to the window
         
         Currently known toolbars are:
          - 'iClassMap'          - basic map toolbar
@@ -339,7 +339,7 @@ class IClassMapFrame(DoubleMapFrame):
                               BestSize((self.toolbars[name].GetBestSize())))
                               
     def _addPanes(self):
-        """!Add mapwindows and toolbars to aui manager"""
+        """Add mapwindows and toolbars to aui manager"""
         if sys.platform == 'win32':
             self._addPaneMapWindow(name = 'training')
             self._addPaneToolbar(name = 'iClassTrainingMapManager')
@@ -386,12 +386,13 @@ class IClassMapFrame(DoubleMapFrame):
                           Center().Layer(0))
         
     def IsStandalone(self):
-        """!Check if Map display is standalone"""
+        """Check if Map display is standalone"""
         return True
 
     def OnUpdateActive(self, event):
-        """!
-        @todo move to DoubleMapFrame?
+        """
+        .. todo::
+            move to DoubleMapFrame?
         """
         if self.GetMapToolbar().GetActiveMap() == 0:
             self.MapWindow = self.firstMapWindow
@@ -406,8 +407,9 @@ class IClassMapFrame(DoubleMapFrame):
             self.MapWindow.SetFocus()
 
     def UpdateActive(self, win):
-        """!
-        @todo move to DoubleMapFrame?
+        """
+        .. todo::
+            move to DoubleMapFrame?
         """
         mapTb = self.GetMapToolbar()
         # optionally disable tool zoomback tool
@@ -426,22 +428,22 @@ class IClassMapFrame(DoubleMapFrame):
         self.GetMapToolbar().Enable('zoomBack', enable=(len(self.MapWindow.zoomhistory) > 1))
 
     def GetMapToolbar(self):
-        """!Returns toolbar with zooming tools"""
+        """Returns toolbar with zooming tools"""
         return self.toolbars['iClassMap']
 
     def GetClassColor(self, cat):
-        """!Get class color as string
+        """Get class color as string
 
-        @param cat class category
+        :param cat: class category
         
-        @return 'R:G:B'
+        :return: 'R:G:B'
         """
         if cat in self.stats_data.GetCategories():
             return self.stats_data.GetStatistics(cat).color
         return '0:0:0'
         
     def OnZoomMenu(self, event):
-        """!Popup Zoom menu """
+        """Popup Zoom menu """
         zoommenu = wx.Menu()
         # Add items to the menu
 
@@ -469,7 +471,7 @@ class IClassMapFrame(DoubleMapFrame):
         zoommenu.Destroy()
         
     def OnZoomToTraining(self, event):
-        """!Set preview display to match extents of training display """
+        """Set preview display to match extents of training display """
 
         if not self.MapWindow == self.GetSecondWindow():
             self.MapWindow = self.GetSecondWindow()
@@ -482,7 +484,7 @@ class IClassMapFrame(DoubleMapFrame):
         self.Render(self.GetSecondWindow())
         
     def OnZoomToPreview(self, event):
-        """!Set preview display to match extents of training display """
+        """Set preview display to match extents of training display """
 
         if not self.MapWindow == self.GetFirstWindow():
             self.MapWindow = self.GetFirstWindow()
@@ -495,7 +497,7 @@ class IClassMapFrame(DoubleMapFrame):
         self.Render(self.GetFirstWindow())
         
     def AddBands(self):
-        """!Add imagery group"""
+        """Add imagery group"""
         dlg = IClassGroupDialog(self, group=self.g['group'])
         
         while True:
@@ -515,7 +517,7 @@ class IClassMapFrame(DoubleMapFrame):
         dlg.Destroy()
 
     def OnImportAreas(self, event):
-        """!Import training areas"""
+        """Import training areas"""
         # check if we have any changes
         if self.GetAreasCount() or self.stats_data.GetCategories():
             qdlg = wx.MessageDialog(parent = self,
@@ -536,11 +538,11 @@ class IClassMapFrame(DoubleMapFrame):
         dlg.Destroy()
         
     def _checkImportedTopo(self, vector):
-        """!Check if imported vector map has areas
+        """Check if imported vector map has areas
         
-        @param vector vector map name
+        :param str vector: vector map name
         
-        @return warning message (empty if topology is ok)
+        :return: warning message (empty if topology is ok)
         """
         topo = grass.vector_info_topo(map = vector)
         
@@ -554,11 +556,11 @@ class IClassMapFrame(DoubleMapFrame):
         return warning
             
     def ImportAreas(self, vector):
-        """!Import training areas.
+        """Import training areas.
         
         If table connected, try load certain columns to class manager
         
-        @param vector vector map name
+        :param str vector: vector map name
         """
         warning = self._checkImportedTopo(vector)
         if warning:
@@ -615,7 +617,7 @@ class IClassMapFrame(DoubleMapFrame):
         return True
         
     def ImportClasses(self, vector):
-        """!If imported map has table, try to import certain columns to class manager"""
+        """If imported map has table, try to import certain columns to class manager"""
         # check connection
         dbInfo = VectorDBInfo(vector)
         connected = (len(dbInfo.layers.keys()) > 0)
@@ -678,7 +680,7 @@ class IClassMapFrame(DoubleMapFrame):
                 listCtrl.AddCategory(cat = int(record[0]), name = record[1], color = record[2])
             
     def OnExportAreas(self, event):
-        """!Export training areas"""
+        """Export training areas"""
         if self.GetAreasCount() == 0:
             GMessage(parent = self, message = _("No training areas to export."))
             return
@@ -697,10 +699,10 @@ class IClassMapFrame(DoubleMapFrame):
                               self.exportVector), parent = self)
                     
     def ExportAreas(self, vectorName, withTable):
-        """!Export training areas to new vector map (with attribute table).
+        """Export training areas to new vector map (with attribute table).
         
-        @param vectorName name of exported vector map
-        @param withTable true if attribute table is required
+        :param str vectorName: name of exported vector map
+        :param bool withTable: true if attribute table is required
         """
         wx.BeginBusyCursor()
         wx.Yield()
@@ -774,13 +776,13 @@ class IClassMapFrame(DoubleMapFrame):
         return True
     
     def _runDBUpdate(self, tmpFile, table, column, value, cat):
-        """!Helper function for UPDATE statement
+        """Helper function for UPDATE statement
         
-        @param tmpFile file where to write UPDATE statements
-        @param table table name
-        @param column name of updated column
-        @param value new value
-        @param cat which category to update
+        :param tmpFile: file where to write UPDATE statements
+        :param table: table name
+        :param column: name of updated column
+        :param value: new value
+        :param cat: which category to update
         """
         if type(value) == (types.IntType, types.FloatType):
             tmpFile.write("UPDATE %s SET %s = %d WHERE cat = %d\n" %
@@ -790,7 +792,7 @@ class IClassMapFrame(DoubleMapFrame):
                           (table, column, value, cat))
         
     def OnCategoryManager(self, event):
-        """!Show category management dialog"""
+        """Show category management dialog"""
         if self.dialogs['classManager'] is None:
             dlg = IClassCategoryManagerDialog(self)
             dlg.CenterOnParent()
@@ -801,7 +803,7 @@ class IClassMapFrame(DoubleMapFrame):
                 self.dialogs['classManager'].Show()
         
     def CategoryChanged(self, currentCat):
-        """!Updates everything which depends on current category.
+        """Updates everything which depends on current category.
         
         Updates number of stddev, histograms, layer in preview display. 
         """
@@ -821,20 +823,20 @@ class IClassMapFrame(DoubleMapFrame):
         self.categoryChanged.emit(cat = currentCat)
         
     def DeleteAreas(self, cats):
-        """!Removes all training areas of given categories
+        """Removes all training areas of given categories
         
-        @param cats list of categories to be deleted
+        :param cats: list of categories to be deleted
         """
         self.firstMapWindow.GetDigit().DeleteAreasByCat(cats)
         self.firstMapWindow.UpdateMap(render=False, renderVector=True)
         
     def HighlightCategory(self, cats):
-        """!Highlight araes given by category"""
+        """Highlight araes given by category"""
         self.firstMapWindow.GetDigit().GetDisplay().SetSelected(cats, layer = 1)
         self.firstMapWindow.UpdateMap(render=False, renderVector=True)
         
     def ZoomToAreasByCat(self, cat):
-        """!Zoom to areas given by category"""
+        """Zoom to areas given by category"""
         n, s, w, e = self.GetFirstWindow().GetDigit().GetDisplay().GetRegionSelected()
         self.GetFirstMap().GetRegion(n = n, s = s, w = w, e = e, update = True)
         self.GetFirstMap().AdjustRegion()
@@ -843,12 +845,12 @@ class IClassMapFrame(DoubleMapFrame):
         self.GetFirstWindow().UpdateMap(render = True, renderVector = True)
         
     def UpdateRasterName(self, newName, cat):
-        """!Update alias of raster map when category name is changed"""
+        """Update alias of raster map when category name is changed"""
         origName = self.stats_data.GetStatistics(cat).rasterName
         self.previewMapManager.SetAlias(origName, self._addSuffix(newName))
         
     def StddevChanged(self, cat, nstd):
-        """!Standard deviation multiplier changed, rerender map, histograms"""
+        """Standard deviation multiplier changed, rerender map, histograms"""
         stat = self.stats_data.GetStatistics(cat)
         stat.SetStatistics({"nstd" : nstd})
         
@@ -867,13 +869,13 @@ class IClassMapFrame(DoubleMapFrame):
         self.plotPanel.StddevChanged()
         
     def UpdateChangeState(self, changes):
-        """!Informs if any important changes happened
+        """Informs if any important changes happened
         since last analysis computation.
         """
         self.changes = changes
         
     def AddRasterMap(self, name, firstMap = True, secondMap = True):
-        """!Add raster map to Map"""
+        """Add raster map to Map"""
         cmdlist = ['d.rast', 'map=%s' % name]
         if firstMap:
             self.GetFirstMap().AddLayer(ltype='raster', command=cmdlist, active=True,
@@ -885,7 +887,7 @@ class IClassMapFrame(DoubleMapFrame):
             self.Render(self.GetSecondWindow())
            
     def AddTrainingAreaMap(self):
-        """!Add vector map with training areas to Map (training
+        """Add vector map with training areas to Map (training
         sub-display)"""
         vname = self.CreateTempVector()
         if vname:
@@ -904,14 +906,14 @@ class IClassMapFrame(DoubleMapFrame):
         self.Render(self.GetFirstWindow())
         
     def OnRunAnalysis(self, event):
-        """!Run analysis and update plots"""
+        """Run analysis and update plots"""
         if self.RunAnalysis():
             currentCat = self.GetCurrentCategoryIdx()
             self.plotPanel.UpdatePlots(group = self.g['group'], subgroup = self.g['subgroup'], 
                                        currentCat = currentCat, stats_data = self.stats_data)
         
     def RunAnalysis(self):
-        """!Run analysis
+        """Run analysis
         
         Calls C functions to compute all statistics and creates raster maps.
         Signatures are created but signature file is not.
@@ -981,7 +983,7 @@ class IClassMapFrame(DoubleMapFrame):
         return '_'.join((name, suffix))
 
     def OnSaveSigFile(self, event):
-        """!Asks for signature file name and saves it."""
+        """Asks for signature file name and saves it."""
         if not self.g['group']:
             GMessage(parent = self, message = _("No imagery group selected."))
             return
@@ -1022,7 +1024,7 @@ class IClassMapFrame(DoubleMapFrame):
         dlg.Destroy()
         
     def InitStatistics(self):
-        """!Initialize variables and c structures neccessary for
+        """Initialize variables and c structures neccessary for
         computing statistics.
         """
         self.g = {'group' : None, 'subgroup' : None}
@@ -1041,16 +1043,16 @@ class IClassMapFrame(DoubleMapFrame):
         I_init_group_ref(self.refer) # must be freed on exit
         
     def WriteSignatures(self, signatures, group, subgroup, filename):
-        """!Writes current signatures to signature file
+        """Writes current signatures to signature file
         
-        @param signatures signature (c structure)
-        @param group imagery group
-        @param filename signature file name
+        :param signatures: signature (c structure)
+        :param group: imagery group
+        :param filename: signature file name
         """
         I_iclass_write_signatures(signatures, group, subgroup, filename)
                                         
     def CheckInput(self, group, vector):
-        """!Check if input is valid"""
+        """Check if input is valid"""
         # check if group is ok
         #TODO check subgroup
         if not group:
@@ -1095,7 +1097,7 @@ class IClassMapFrame(DoubleMapFrame):
         return True
         
     def GetAreasCount(self):
-        """!Returns number of not dead areas"""
+        """Returns number of not dead areas"""
         count = 0
         numAreas = Vect_get_num_areas(self.poMapInfo)
         for i in range(numAreas):
@@ -1104,9 +1106,10 @@ class IClassMapFrame(DoubleMapFrame):
         return count
         
     def GetGroupLayers(self, group, subgroup=None):
-        """!Get layers in subgroup (expecting same name for group and subgroup)
+        """Get layers in subgroup (expecting same name for group and subgroup)
     
-        @todo consider moving this function to core module for convenient
+        .. todo::
+            consider moving this function to core module for convenient
         """
         kwargs = {}
         if subgroup:
@@ -1122,61 +1125,62 @@ class IClassMapFrame(DoubleMapFrame):
         return []
     
     def ConvertToNull(self, name):
-        """! Sets value which represents null values for given raster map.
+        """Sets value which represents null values for given raster map.
         
-        @param name raster map name
+        :param name: raster map name
         """
         RunCommand('r.null',
                    map = name,
                    setnull = 0)
                      
     def GetCurrentCategoryIdx(self):
-        """!Returns current category number"""
+        """Returns current category number"""
         return self.toolbars['iClass'].GetSelectedCategoryIdx()
         
     def OnZoomIn(self, event):
-        """!Enable zooming for plots"""
+        """Enable zooming for plots"""
         super(IClassMapFrame, self).OnZoomIn(event)
         self.plotPanel.EnableZoom(type = 1)
         
     def OnZoomOut(self, event):
-        """!Enable zooming for plots"""
+        """Enable zooming for plots"""
         super(IClassMapFrame, self).OnZoomOut(event)
         self.plotPanel.EnableZoom(type = -1)
         
     def OnPan(self, event):
-        """!Enable panning for plots"""
+        """Enable panning for plots"""
         super(IClassMapFrame, self).OnPan(event)
         self.plotPanel.EnablePan()
         
     def OnPointer(self, event):
-        """!Set pointer mode.
+        """Set pointer mode.
 
-        @todo: pointers need refactoring
+        .. todo::
+            pointers need refactoring
         """
         self.GetFirstWindow().SetModePointer()
         self.GetSecondWindow().SetModePointer()
 
     def GetMapManagers(self):
-      """!Get map managers of wxIClass 
+        """Get map managers of wxIClass
 
-      @return trainingMapManager, previewMapManager 
-      """
-      return self.trainingMapManager, self.previewMapManager
+        :return: trainingMapManager, previewMapManager 
+        """
+        return self.trainingMapManager, self.previewMapManager
 
 class MapManager:
-    """! Class for managing map renderer.
+    """Class for managing map renderer.
     
     It is connected with iClassMapManagerToolbar.
     """
     def __init__(self, frame, mapWindow, Map):
-        """!
+        """
         
         It is expected that \a mapWindow is conected with \a Map.
         
-        @param frame application main window
-        @param mapWindow map window instance
-        @param Map map renderer instance
+        :param frame: application main window
+        :param mapWindow: map window instance
+        :param map: map renderer instance
         """
         self.map = Map
         self.frame = frame
@@ -1190,10 +1194,10 @@ class MapManager:
         self.toolbar = toolbar
         
     def AddLayer(self, name, alias = None, resultsLayer = False):
-        """!Adds layer to Map and update toolbar 
+        """Adds layer to Map and update toolbar 
         
-        @param name layer (raster) name
-        @param resultsLayer True if layer is temp. raster showing the results of computation
+        :param str name: layer (raster) name
+        :param str resultsLayer: True if layer is temp. raster showing the results of computation
         """
         if (resultsLayer and
             name in [l.GetName() for l in self.map.GetListOfLayers(name = name)]):
@@ -1215,9 +1219,9 @@ class MapManager:
         self.toolbar.choice.SetSelection(0)
         
     def AddLayerRGB(self, cmd):
-        """!Adds RGB layer and update toolbar.
+        """Adds RGB layer and update toolbar.
 
-        @param cmd d.rgb command as a list
+        :param cmd: d.rgb command as a list
         """
         name = []
         for param in cmd:
@@ -1232,9 +1236,9 @@ class MapManager:
         self.toolbar.choice.SetSelection(0)
 
     def RemoveTemporaryLayer(self, name):
-        """!Removes temporary layer (if exists) from Map and and updates toolbar.
+        """Removes temporary layer (if exists) from Map and and updates toolbar.
         
-        @param name real name of layer
+        :param name: real name of layer
         """
         # check if layer is loaded
         layers = self.map.GetListOfLayers(ltype = 'raster')
@@ -1264,11 +1268,13 @@ class MapManager:
         self.frame.Render(self.mapWindow)
     
     def Render(self):
-        """@todo giface shoud be used instead of this method"""
+        """
+        .. todo::
+            giface shoud be used instead of this method"""
         self.frame.Render(self.mapWindow)
 
     def RemoveLayer(self, name, idx):
-        """!Removes layer from Map and update toolbar"""
+        """Removes layer from Map and update toolbar"""
         name = self.layerName[name]
         self.map.RemoveLayer(name = name)
         del self.layerName[name]
@@ -1279,7 +1285,7 @@ class MapManager:
         self.frame.Render(self.mapWindow)
             
     def SelectLayer(self, name):
-        """!Moves selected layer to top"""
+        """Moves selected layer to top"""
         layers = self.map.GetListOfLayers(ltype = 'rgb') + \
                  self.map.GetListOfLayers(ltype = 'raster')
         idx = None
@@ -1302,7 +1308,7 @@ class MapManager:
             self.frame.Render(self.mapWindow)
         
     def SetOpacity(self, name):
-        """!Sets opacity of layers."""
+        """Sets opacity of layers."""
         name = self.layerName[name]
         layers = self.map.GetListOfLayers(name = name)
         if not layers:
@@ -1324,7 +1330,7 @@ class MapManager:
         self.frame.Render(self.mapWindow)
                 
     def GetAlias(self, name):
-        """!Returns alias for layer"""
+        """Returns alias for layer"""
         name =  [k for k, v in self.layerName.iteritems() if v == name]
         if name:
             return name[0]

+ 24 - 24
gui/wxpython/iclass/plots.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package iclass.plots
 
 @brief wxIClass plots (histograms, coincidence plots).
@@ -22,7 +22,7 @@ from core.utils import _
 from core.gcmd import GError
 
 class PlotPanel(scrolled.ScrolledPanel):
-    """!Panel for drawing multiple plots.
+    """Panel for drawing multiple plots.
     
     There are three types of plots: histograms, coincidence plots and scatter plots.
     Histograms show frequency of cell category values in training areas
@@ -70,7 +70,7 @@ class PlotPanel(scrolled.ScrolledPanel):
         self.plotSwitch.Bind(wx.EVT_CHOICE, self.OnPlotTypeSelected)
     
     def _createScatterPlotPanel(self):
-        """!Init interactive scatter plot tool
+        """Init interactive scatter plot tool
         """
         try:
             from iscatt.frame import IClassIScattPanel
@@ -86,7 +86,7 @@ class PlotPanel(scrolled.ScrolledPanel):
             self.iscatt_panel = None
 
     def OnPlotTypeSelected(self, event):
-        """!Plot type selected"""
+        """Plot type selected"""
 
         if self.plotSwitch.GetSelection() in [0, 1]:
             self.SetupScrolling(scroll_x = False, scroll_y = True)
@@ -119,7 +119,7 @@ class PlotPanel(scrolled.ScrolledPanel):
         self.Layout()
 
     def StddevChanged(self):
-        """!Standard deviation multiplier changed, redraw histograms"""
+        """Standard deviation multiplier changed, redraw histograms"""
         if self.plotSwitch.GetSelection() == 0:
             stat = self.stats_data.GetStatistics(self.currentCat)
             self.UpdateRanges(stat)
@@ -135,25 +135,25 @@ class PlotPanel(scrolled.ScrolledPanel):
             canvas.SetEnableDrag(enable)
             
     def DestroyPlots(self):
-        """!Destroy all plot canvases"""
+        """Destroy all plot canvases"""
         for panel in self.canvasList:
             panel.Destroy()
             
         self.canvasList = []
 
     def ClearPlots(self):
-        """!Clears plot canvases"""
+        """Clears plot canvases"""
         for bandIdx in range(len(self.bandList)):
             self.canvasList[bandIdx].Clear()
             
     def Reset(self):
-        """!Reset plots (when new map imported)"""
+        """Reset plots (when new map imported)"""
         self.currentCat = None
         self.ClearPlots()
         # bands are still the same
         
     def CreatePlotCanvases(self):
-        """!Create plot canvases according to the number of bands"""
+        """Create plot canvases according to the number of bands"""
         for band in self.bandList:
             canvas = plot.PlotCanvas(self.canvasPanel)
             canvas.SetMinSize((-1, 140))
@@ -167,12 +167,12 @@ class PlotPanel(scrolled.ScrolledPanel):
         self.Layout()
         
     def UpdatePlots(self, group, subgroup, currentCat, stats_data):
-        """!Update plots after new analysis
+        """Update plots after new analysis
         
-        @param group imagery group
-        @param subgroup imagery group
-        @param currentCat currently selected category (class)
-        @param stats_data StatisticsData instance (defined in statistics.py)
+        :param group: imagery group
+        :param subgroup: imagery group
+        :param currentCat: currently selected category (class)
+        :param stats_data: StatisticsData instance (defined in statistics.py)
         """
         self.stats_data = stats_data
         self.currentCat = currentCat
@@ -192,7 +192,7 @@ class PlotPanel(scrolled.ScrolledPanel):
         self.currentCat = cat
     
     def DrawCoincidencePlots(self):
-        """!Draw coincidence plots"""
+        """Draw coincidence plots"""
         for bandIdx in range(len(self.bandList)):
             self.canvasList[bandIdx].SetYSpec(type = 'none')
             lines = []
@@ -217,11 +217,11 @@ class PlotPanel(scrolled.ScrolledPanel):
             self.canvasList[bandIdx].Draw(plotGraph)
         
     def DrawCoincidenceLine(self, level, color, bandValues):
-        """!Draw line between band min and max values
+        """Draw line between band min and max values
         
-        @param level y coordinate of line
-        @param color class color
-        @param bandValues BandStatistics instance
+        :param level: y coordinate of line
+        :param color: class color
+        :param bandValues: BandStatistics instance
         """
         minim = bandValues.min
         maxim = bandValues.max
@@ -230,14 +230,14 @@ class PlotPanel(scrolled.ScrolledPanel):
         return plot.PolyLine(points, colour = color, width = 4)
         
     def DrawInvisibleLine(self, level):
-        """!Draw white line to achieve better margins"""
+        """Draw white line to achieve better margins"""
         points = [(100, level), (101, level)]
         return plot.PolyLine(points, colour = wx.WHITE, width = 1)
         
     def DrawHistograms(self, statistics):
-        """!Draw histograms for one class
+        """Draw histograms for one class
         
-        @param statistics statistics for one class
+        :param statistics: statistics for one class
         """
         self.histogramLines = []
         for bandIdx in range(len(self.bandList)):
@@ -308,9 +308,9 @@ class PlotPanel(scrolled.ScrolledPanel):
         return plot.PolyLine(points, colour = wx.BLACK, width = 1)
          
     def UpdateRanges(self, statistics):
-        """!Redraw ranges lines in histograms when std dev multiplier changes
+        """Redraw ranges lines in histograms when std dev multiplier changes
         
-        @param statistics python Statistics instance
+        :param statistics: python Statistics instance
         """
         for bandIdx in range(len(self.bandList)):
             self.canvasList[bandIdx].Clear()

+ 19 - 18
gui/wxpython/iclass/statistics.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package iclass.statistics
 
 @brief wxIClass classes for storing statistics about cells in training areas.
@@ -31,8 +31,8 @@ except ImportError as e:
 from grass.pydispatch.signal import Signal
 
 class StatisticsData:
-    """!Stores all statistics.
-    """ 
+    """Stores all statistics.
+    """
     def __init__(self):
         self.statisticsDict = {}
         self.statisticsList = []
@@ -73,7 +73,7 @@ class StatisticsData:
         self.allStatisticsDeleted.emit()
 
 class Statistics:
-    """! Statistis conected to one class (category).
+    """Statistis conected to one class (category).
     
     It is Python counterpart of similar C structure.
     But it adds some attributes or features used in wxIClass.
@@ -99,12 +99,13 @@ class Statistics:
         return self.ready
         
     def SetBaseStatistics(self, cat, name, color):
-        """! Sets basic (non-statistical) values.
+        """Sets basic (non-statistical) values.
         
-        @todo Later self.name is changed but self.rasterName is not.
-        self.rasterName should not be set by user. It can remains the same.
-        But it should be done more explicitly.
-        Currently it looks like unintentional feature or bug.
+        .. todo::
+            Later self.name is changed but self.rasterName is not. 
+            self.rasterName should not be set by user. It can remains
+            the same. But it should be done more explicitly. Currently
+            it looks like unintentional feature or bug.
         """
         self.category = cat
         self.name = name
@@ -115,11 +116,11 @@ class Statistics:
         self.rasterName = name + '_' + os.path.basename(rasterPath)
         
     def SetFromcStatistics(self, cStatistics):
-        """! Sets all statistical values.
+        """Sets all statistical values.
         
         Copies all statistic values from \a cStattistics.
         
-        @param cStatistics pointer to C statistics structure
+        :param cStatistics: pointer to C statistics structure
         """
         cat = c_int()
 
@@ -157,9 +158,9 @@ class Statistics:
         self.SetBandStatistics(cStatistics)
 
     def SetBandStatistics(self, cStatistics):
-        """! Sets all band statistics.
+        """Sets all band statistics.
         
-        @param cStatistics pointer to C statistics structure
+        :param cStatistics: pointer to C statistics structure
         """
         self.bands = []
         for i in range(self.nbands):
@@ -175,9 +176,9 @@ class Statistics:
         self.statisticsSet.emit(stats = stats)
 
 class BandStatistics:
-    """! Statistis conected to one band within class (category).
+    """Statistis conected to one band within class (category).
     
-    @see Statistics
+    :class:`Statistics`
     """
     def __init__(self):
         self.min = self.max = None
@@ -188,10 +189,10 @@ class BandStatistics:
         
         
     def SetFromcStatistics(self, cStatistics, index):
-        """! Sets statistics for one band by given index.
+        """Sets statistics for one band by given index.
         
-        @param cStatistics pointer to C statistics structure
-        @param index index of band in C statistics structure
+        :param cStatistics: pointer to C statistics structure
+        :param index: index of band in C statistics structure
         """
         min, max = c_int(), c_int()
         I_iclass_statistics_get_min(cStatistics, index, byref(min))

+ 16 - 16
gui/wxpython/iclass/toolbars.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package iclass.toolbars
 
 @brief wxIClass toolbars and icons.
@@ -50,10 +50,10 @@ iClassIcons = {
         }
         
 class IClassMapToolbar(BaseToolbar):
-    """!IClass Map toolbar
+    """IClass Map toolbar
     """
     def __init__(self, parent, toolSwitcher):
-        """!IClass Map toolbar constructor
+        """IClass Map toolbar constructor
         """
         BaseToolbar.__init__(self, parent, toolSwitcher)
         
@@ -79,19 +79,19 @@ class IClassMapToolbar(BaseToolbar):
         self.EnableTool(self.zoomBack, False)
         
     def GetActiveMapTool(self):
-        """!Return widget for selecting active maps"""
+        """Return widget for selecting active maps"""
         return self.togglemap
         
     def GetActiveMap(self):
-        """!Get currently selected map"""
+        """Get currently selected map"""
         return self.togglemap.GetSelection()
         
     def SetActiveMap(self, index):
-        """!Set currently selected map"""
+        """Set currently selected map"""
         return self.togglemap.SetSelection(index)
         
     def _toolbarData(self):
-        """!Toolbar data"""
+        """Toolbar data"""
         icons = BaseIcons
         return self._getToolbarData((("displaymap", icons["display"],
                                       self.parent.OnDraw),
@@ -120,10 +120,10 @@ class IClassMapToolbar(BaseToolbar):
                                       self.parent.OnZoomToMap)
                                     ))
 class IClassToolbar(BaseToolbar):
-    """!IClass toolbar
+    """IClass toolbar
     """
     def __init__(self, parent, stats_data):
-        """!IClass toolbar constructor
+        """IClass toolbar constructor
         """
         self.stats_data = stats_data
 
@@ -157,7 +157,7 @@ class IClassToolbar(BaseToolbar):
         self.Realize()
         
     def _toolbarData(self):
-        """!Toolbar data"""
+        """Toolbar data"""
         icons = iClassIcons
         return self._getToolbarData((("selectGroup", icons['selectGroup'],
                                       lambda event : self.parent.AddBands()),
@@ -281,10 +281,10 @@ class IClassToolbar(BaseToolbar):
         # don't forget to update maps, histo, ...
         
 class IClassMapManagerToolbar(BaseToolbar):
-    """!IClass toolbar
+    """IClass toolbar
     """
     def __init__(self, parent, mapManager):
-        """!IClass toolbar constructor
+        """IClass toolbar constructor
         """
         BaseToolbar.__init__(self, parent)
         
@@ -300,7 +300,7 @@ class IClassMapManagerToolbar(BaseToolbar):
         self.Realize()
         
     def _toolbarData(self):
-        """!Toolbar data"""
+        """Toolbar data"""
         return self._getToolbarData((("addRast", BaseIcons['addRast'],
                                       self.OnAddRast),
                                      ('addRgb', iClassIcons['addRgb'],
@@ -347,10 +347,10 @@ class IClassMapManagerToolbar(BaseToolbar):
         self.mapManager.SetOpacity(name = layer)
 
 class IClassMiscToolbar(BaseToolbar):
-    """!IClass toolbar
+    """IClass toolbar
     """
     def __init__(self, parent):
-        """!IClass toolbar constructor
+        """IClass toolbar constructor
         """
         BaseToolbar.__init__(self, parent)
         
@@ -359,7 +359,7 @@ class IClassMiscToolbar(BaseToolbar):
         self.Realize()
         
     def _toolbarData(self):
-        """!Toolbar data"""
+        """Toolbar data"""
         icons = BaseIcons
         return self._getToolbarData((("help", icons['help'],
                                       self.parent.OnHelp),

+ 6 - 6
gui/wxpython/icons/icon.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package icons.icon
 
 @brief Icon metadata
@@ -51,7 +51,7 @@ except StandardError as e:
     sys.exit(_("Unable to load icon theme. Reason: %s. Quiting wxGUI...") % e)
     
 class MetaIcon:
-    """!Handle icon metadata (image path, tooltip, ...)
+    """Handle icon metadata (image path, tooltip, ...)
     """
     def __init__(self, img, label = None, desc = None):
         self.imagepath = iconSet.get(img, wx.ART_MISSING_IMAGE)
@@ -99,12 +99,12 @@ class MetaIcon:
         return os.path.basename(self.imagepath)
 
     def SetLabel(self, label = None, desc = None):
-        """!Set label/description for icon
+        """Set label/description for icon
 
-        @param label icon label (None for no change)
-        @param desc icon description (None for no change)
+        :param label: icon label (None for no change)
+        :param desc: icon description (None for no change)
         
-        @return copy of original object
+        :return: copy of original object
         """
         cobj = copy.copy(self)
         if label:

+ 111 - 10
gui/wxpython/iscatt/controllers.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package iscatt.controllers
 
 @brief Controller layer wx.iscatt.
@@ -39,7 +39,7 @@ import grass.script as grass
 from grass.pydispatch.signal import Signal
 
 class ScattsManager:
-    """!Main controller
+    """Main controller
     """
     def __init__(self, guiparent, giface, iclass_mapwin = None):
         self.giface = giface
@@ -109,7 +109,7 @@ class ScattsManager:
         self.plots.clear()
     
     def _initSettings(self):
-        """!Initialization of settings (if not already defined)
+        """Initialization of settings (if not already defined)
         """
         # initializes default settings
         initSettings = [
@@ -444,9 +444,10 @@ class ScattsManager:
         return self.cats_mgr
 
 class PlotsRenderingManager:
-    """!Manages rendering of scatter plot.
+    """Manages rendering of scatter plot.
 
-    @todo still space for optimalization
+    .. todo::
+        still space for optimalization
     """
     def __init__(self, scatt_mgr, cats_mgr, core):
         self.scatt_mgr = scatt_mgr
@@ -585,7 +586,7 @@ class PlotsRenderingManager:
                                 subkey="show_ellips")
 
 class CategoriesManager:
-    """!Manages categories list of scatter plot.
+    """Manages categories list of scatter plot.
     """
     def __init__(self, scatt_mgr, core):
 
@@ -763,7 +764,8 @@ class CategoriesManager:
 
 
 class IMapWinDigitConnection:
-    """!Manage communication of the scatter plot with digitizer in mapwindow (does not work).
+    """Manage communication of the scatter plot with digitizer in
+    mapwindow (does not work).
     """
     def Update(self):
         pass
@@ -772,7 +774,8 @@ class IMapWinDigitConnection:
         pass
 
 class IClassDigitConnection:
-    """!Manages communication of the scatter plot with digitizer in wx.iclass.
+    """Manages communication of the scatter plot with digitizer in
+    wx.iclass.
     """
     def __init__(self, scatt_mgr, mapWin, scatt_rast_updater):
         self.mapWin = mapWin
@@ -873,7 +876,7 @@ class IClassDigitConnection:
         self.scatt_mgr.render_mgr.RenderScattPlts()
 
 class IMapDispConnection:
-    """!Manage comunication of the scatter plot with mapdisplay in mapwindow.
+    """Manage comunication of the scatter plot with mapdisplay in mapwindow.
     """
     def __init__(self, scatt_mgr, cats_mgr, giface):
         self.scatt_mgr = scatt_mgr
@@ -956,7 +959,7 @@ class IMapDispConnection:
             self.giface.updateMap.emit()
 
 class IClassConnection:
-    """!Manage comunication of the scatter plot with mapdisplay in wx.iclass.
+    """Manage comunication of the scatter plot with mapdisplay in wx.iclass.
     """
     def __init__(self, scatt_mgr, iclass_frame, cats_mgr):
         self.iclass_frame = iclass_frame
@@ -1106,3 +1109,101 @@ class IClassConnection:
         if res.split('\n')[0]:
             bands = res.split('\n')
             self.scatt_mgr.SetBands(bands)
+
+
+#TODO it uses also BufferedMapWindow class -> move to core?
+class gThread(threading.Thread, wx.EvtHandler):
+    """Thread for scatter plot backend"""
+    requestId = 0
+
+    def __init__(self, requestQ=None, resultQ=None, **kwds):
+        wx.EvtHandler.__init__(self)
+        self.terminate = False
+
+        threading.Thread.__init__(self, **kwds)
+
+        if requestQ is None:
+            self.requestQ = Queue.Queue()
+        else:
+            self.requestQ = requestQ
+
+        if resultQ is None:
+            self.resultQ = Queue.Queue()
+        else:
+            self.resultQ = resultQ
+
+        self.setDaemon(True)
+
+        self.Bind(EVT_CMD_DONE, self.OnDone)
+        self.start()
+
+    def Run(self, *args, **kwds):
+        """Run command in queue
+
+        :param args: unnamed command arguments
+        :param kwds: named command arguments, keyword 'callable'
+                     represents function to be run, keyword 'ondone'
+                     represents function to be called after the
+                     callable is done
+
+        :return: request id in queue
+        """
+        gThread.requestId += 1
+        self.requestQ.put((gThread.requestId, args, kwds))
+
+        return gThread.requestId
+
+    def GetId(self):
+         """Get id for next command"""
+         return gThread.requestId + 1
+
+    def SetId(self, id):
+        """Set starting id"""
+        gThread.requestId = id
+
+    def run(self):
+        while True:
+            requestId, args, kwds = self.requestQ.get()
+            for key in ('callable', 'ondone', 'userdata'):
+                if key in kwds:
+                    vars()[key] = kwds[key]
+                    del kwds[key]
+                else:
+                    vars()[key] = None
+
+            requestTime = time.time()
+
+            ret = None
+            exception = None
+            time.sleep(.01)
+
+            if self.terminate:
+                return
+
+            ret = vars()['callable'](*args, **kwds)
+
+            if self.terminate:
+                return
+            #except Exception as e:
+            #    exception  = e;
+
+            self.resultQ.put((requestId, ret))
+
+            event = wxCmdDone(ondone=vars()['ondone'],
+                              kwds=kwds,
+                              args=args, #TODO expand args to kwds
+                              ret=ret,
+                              exception=exception,
+                              userdata=vars()['userdata'],
+                              pid=requestId)
+
+            # send event
+            wx.PostEvent(self, event)
+
+    def OnDone(self, event):
+        if event.ondone:
+            event.ondone(event)
+
+    def Terminate(self):
+        """Abort command(s)"""
+        self.terminate = True

+ 1 - 1
gui/wxpython/iscatt/core_c.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package iscatt.core_c
 
 @brief Wrappers for scatter plot C backend.

+ 18 - 18
gui/wxpython/iscatt/dialogs.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package iscatt.dialogs
 
 @brief Dialogs widgets.
@@ -138,7 +138,7 @@ class AddScattPlotDialog(wx.Dialog):
         event.Skip()
 
     def _addSelectSizer(self, title, sel): 
-        """!Helper layout function.
+        """Helper layout function.
         """
         selSizer = wx.BoxSizer(orient = wx.VERTICAL)
 
@@ -156,25 +156,25 @@ class AddScattPlotDialog(wx.Dialog):
         return selSizer
 
     def GetBands(self):
-        """!Get layers"""
+        """Get layers"""
         return self.sel_bands_ids
 
     def OnClose(self, event):
-        """!Close dialog
+        """Close dialog
         """
         if not self.IsModal():
             self.Destroy()
         event.Skip()
 
     def OnRemoveLayer(self, event):
-        """!Remove layer from listbox"""
+        """Remove layer from listbox"""
         while self.scattsBox.GetSelections():
             sel = self.scattsBox.GetSelections()[0]
             self.scattsBox.Delete(sel)
             self.sel_bands_ids.pop(sel)
 
     def OnAdd(self, event):
-        """!
+        """
         """
         b_x = self.band_1_ch.GetSelection()
         b_y = self.band_2_ch.GetSelection()
@@ -209,11 +209,11 @@ class ExportCategoryRaster(wx.Dialog):
     def __init__(self, parent, title, rasterName = None, id = wx.ID_ANY,
                  style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER,
                  **kwargs):
-        """!Dialog for export of category raster.
+        """Dialog for export of category raster.
         
-        @param parent window
-        @param rasterName name of vector layer for export
-        @param title window title
+        :param parent: window
+        :param str rasterName name of vector layer for export
+        :param title: window title
         """
         wx.Dialog.__init__(self, parent, id, title, style = style, **kwargs)
         
@@ -233,7 +233,7 @@ class ExportCategoryRaster(wx.Dialog):
         wx.CallAfter(self.vectorNameCtrl.SetFocus)
 
     def OnTextChanged(self, event):
-        """!Name of new vector map given.
+        """Name of new vector map given.
         
         Enable/diable OK button.
         """
@@ -244,7 +244,7 @@ class ExportCategoryRaster(wx.Dialog):
             self.btnOK.Enable(False)
         
     def __layout(self):
-        """!Do layout"""
+        """Do layout"""
         sizer = wx.BoxSizer(wx.VERTICAL)
         
         dataSizer = wx.BoxSizer(wx.VERTICAL)
@@ -279,11 +279,11 @@ class ExportCategoryRaster(wx.Dialog):
         self.SetMinSize(self.GetSize())
         
     def GetRasterName(self):
-        """!Returns vector name"""
+        """Returns vector name"""
         return self.vectorNameCtrl.GetValue()
 
     def OnOK(self, event):
-        """!Checks if map exists and can be overwritten."""
+        """Checks if map exists and can be overwritten."""
         overwrite = UserSettings.Get(group = 'cmd', key = 'overwrite', subkey = 'enabled')
         rast_name = self.GetRasterName()
         res = grass.find_file(rast_name, element = 'cell')
@@ -302,7 +302,7 @@ class ExportCategoryRaster(wx.Dialog):
 class SettingsDialog(wx.Dialog):
     def __init__(self, parent, id, title, scatt_mgr, pos=wx.DefaultPosition, size=wx.DefaultSize,
                  style=wx.DEFAULT_DIALOG_STYLE):
-        """!Settings dialog"""
+        """Settings dialog"""
         wx.Dialog.__init__(self, parent, id, title, pos, size, style)
 
         self.scatt_mgr = scatt_mgr
@@ -417,7 +417,7 @@ class SettingsDialog(wx.Dialog):
         sizer.Fit(self)
      
     def OnSave(self, event):
-        """!Button 'Save' pressed"""
+        """Button 'Save' pressed"""
         self.UpdateSettings()
 
         fileSettings = {}
@@ -461,12 +461,12 @@ class SettingsDialog(wx.Dialog):
             self.scatt_mgr.SettingsUpdated(chanaged_setts)
 
     def OnApply(self, event):
-        """!Button 'Apply' pressed"""
+        """Button 'Apply' pressed"""
         self.UpdateSettings()
         #self.Close()
 
     def OnClose(self, event):
-        """!Button 'Cancel' pressed"""
+        """Button 'Cancel' pressed"""
         self.Close()
 
 class ManageBusyCursorMixin:

+ 7 - 7
gui/wxpython/iscatt/frame.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package iscatt.frame
 
 @brief Main scatter plot widgets.
@@ -295,7 +295,7 @@ class ScatterPlotsPanel(scrolled.ScrolledPanel):
         self.SetupScrolling()
 
     def OnClose(self, event):
-        """!Close dialog"""
+        """Close dialog"""
         #TODO
         print "closed"
         self.scatt_mgr.CleanUp()
@@ -478,7 +478,7 @@ class CategoryListCtrl(wx.ListCtrl,
         return indices        
 
     def DeselectAll(self):
-        """!Deselect all items"""
+        """Deselect all items"""
         indexList = self.GetSelectedIndices()
         for i in indexList:
             self.Select(i, on = 0)
@@ -514,7 +514,7 @@ class CategoryListCtrl(wx.ListCtrl,
         return self.l
 
     def OnCategoryRightUp(self, event):
-        """!Show context menu on right click"""
+        """Show context menu on right click"""
         item, flags = self.HitTest((event.GetX(), event.GetY()))
         if item != wx.NOT_FOUND and flags & wx.LIST_HITTEST_ONITEM:
             self.rightClickedItemIdx = item
@@ -589,7 +589,7 @@ class CategoryListCtrl(wx.ListCtrl,
         menu.Destroy()
 
     def OnExportCatRast(self, event):
-        """!Export training areas"""
+        """Export training areas"""
         #TODO
         #   GMessage(parent=self, message=_("No class raster to export."))
         #    return
@@ -625,7 +625,7 @@ class CategoryListCtrl(wx.ListCtrl,
         self.RefreshItems(0, len(self.cats_mgr.GetCategories()))
 
     def OnSetColor(self, event):
-        """!Popup opacity level indicator"""
+        """Popup opacity level indicator"""
         cat_idx = self.rightClickedItemIdx
         cat_id = self.cats_mgr.GetCategories()[cat_idx]
 
@@ -646,7 +646,7 @@ class CategoryListCtrl(wx.ListCtrl,
         dlg.Destroy()
 
     def OnPopupOpacityLevel(self, event):
-        """!Popup opacity level indicator"""
+        """Popup opacity level indicator"""
 
         cat_id = self.cats_mgr.GetCategories()[self.rightClickedItemIdx]
         cat_attrs = self.cats_mgr.GetCategoryAttrs(cat_id)

+ 13 - 16
gui/wxpython/iscatt/iscatt_core.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package iscatt.iscatt_core
 
 @brief Non GUI functions.
@@ -44,7 +44,7 @@ MAX_NCELLS = 65536 * 65536
 WARN_NCELLS = 12000 * 12000
 
 class Core:
-    """!Represents scatter plot backend.
+    """Represents scatter plot backend.
     """
     def __init__(self):
         
@@ -211,7 +211,7 @@ class Core:
         return val
 
 class CatRastUpdater:
-    """!Update backend data structures according to selected areas in mapwindow.
+    """Update backend data structures according to selected areas in mapwindow.
     """
     def __init__(self, scatts_dt, an_data, core):
         self.scatts_dt = scatts_dt
@@ -284,8 +284,7 @@ class CatRastUpdater:
             ret = UpdateCatRast(patch_rast, region, self.scatts_dt.GetCatRastCond(cat))
             if ret < 0:
                 GException(_("Patching category raster conditions file failed."))            
-            RunCommand("g.remove", flags = 'f',
-                      type = 'rast', name = patch_rast)
+            RunCommand("g.remove", flags='f', type='rast', name=patch_rast)
 
     def _rasterize(self, grass_region, layer, cat, out_rast):
 
@@ -367,7 +366,7 @@ class CatRastUpdater:
         return {"GRASS_REGION" :  grass.region_env(**new_r)}
 
 class AnalyzedData:
-    """!Represents analyzed data (bands, region).
+    """Represents analyzed data (bands, region).
     """
     def __init__(self):
         
@@ -408,7 +407,7 @@ class AnalyzedData:
         return self.bands_info[band]
 
 class ScattPlotsCondsData:
-    """!Data structure for selected areas in scatter plot(condtions).
+    """Data structure for selected areas in scatter plot(condtions).
     """
     def __init__(self, an_data):
 
@@ -557,7 +556,7 @@ class ScattPlotsCondsData:
 
                    
 class ScattPlotsData(ScattPlotsCondsData):
-    """!Data structure for computed points (classes) in scatter plots.\
+    """Data structure for computed points (classes) in scatter plots.\
     """
     def __init__(self, an_data):
 
@@ -598,8 +597,8 @@ class ScattPlotsData(ScattPlotsCondsData):
         grass.try_remove(self.cats_rasts_conds[cat_id])
         del self.cats_rasts_conds[cat_id]
 
-        RunCommand("g.remove", flags='f',
-                   type='rast', name=self.cats_rasts[cat_id])
+        RunCommand("g.remove", flags='f', type='rast',
+                   name=self.cats_rasts[cat_id])
         del self.cats_rasts[cat_id]
 
         return True
@@ -709,10 +708,8 @@ class ScattPlotsData(ScattPlotsCondsData):
         for tmp in self.cats_rasts_conds.itervalues():
             grass.try_remove(tmp) 
         for tmp in self.cats_rasts.itervalues():
-            RunCommand("g.remove",
-                       flags='f',
-                       type='rast',
-                       name=tmp,
+            RunCommand("g.remove", flags='f',
+                       type='rast', name=tmp,
                        getErrorMsg=True)
 
         self.cats_rasts = {}
@@ -776,7 +773,7 @@ def RasterizePolygon(pol, height, min_h, width, min_w):
 """
 
 def idScattToidBands(scatt_id, n_bands):
-    """!Get bands ids from scatter plot id.""" 
+    """Get bands ids from scatter plot id."""
     n_b1 = n_bands - 1
 
     band_1 = (int) ((2 * n_b1 + 1 - sqrt(((2 * n_b1 + 1) * (2 * n_b1 + 1) - 8 * scatt_id))) / 2)
@@ -786,7 +783,7 @@ def idScattToidBands(scatt_id, n_bands):
     return band_1, band_2
 
 def idBandsToidScatt(band_1_id, band_2_id, n_bands):
-    """!Get scatter plot id from band ids."""
+    """Get scatter plot id from band ids."""
     if band_2_id <  band_1_id:
         tmp = band_1_id
         band_1_id = band_2_id

+ 4 - 4
gui/wxpython/iscatt/plots.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package iscatt.plots
 
 @brief Ploting widgets.
@@ -200,7 +200,7 @@ class ScatterPlotWidget(wx.Panel, ManageBusyCursorMixin):
         self.main_sizer.Fit(self)
     
     def Plot(self, cats_order, scatts, ellipses, styles):
-        """ Redraws the figure
+        """Redraws the figure
         """
 
         callafter_list = []
@@ -899,7 +899,7 @@ class ModestImage(mi.AxesImage):
         return self._full_res
 
     def _scale_to_res(self):
-        """ Change self._A and _extent to render an image whose
+        """Change self._A and _extent to render an image whose
         resolution is matched to the eventual rendering."""
 
         ax = self.axes
@@ -945,7 +945,7 @@ def imshow(axes, X, cmap=None, norm=None, aspect=None,
     """Similar to matplotlib's imshow command, but produces a ModestImage
 
     Unlike matplotlib version, must explicitly specify axes
-    Author: Chris Beaumont <beaumont@hawaii.edu>
+    @author: Chris Beaumont <beaumont@hawaii.edu>
     """
 
     if not axes._hold:

+ 7 - 7
gui/wxpython/iscatt/toolbars.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package iscatt.toolbars
 
 @brief Scatter plot - toolbars
@@ -23,7 +23,7 @@ from iscatt.iscatt_core import idBandsToidScatt
 from iscatt.dialogs import SettingsDialog
 
 class MainToolbar(BaseToolbar):
-    """!Main toolbar
+    """Main toolbar
     """
     def __init__(self, parent, scatt_mgr, opt_tools=None):
         BaseToolbar.__init__(self, parent)
@@ -142,7 +142,7 @@ class MainToolbar(BaseToolbar):
                        entry = 'wxGUI.iscatt')
 
 class EditingToolbar(BaseToolbar):
-    """!Main toolbar
+    """Main toolbar
     """
     def __init__(self, parent, scatt_mgr):
         BaseToolbar.__init__(self, parent)
@@ -155,7 +155,7 @@ class EditingToolbar(BaseToolbar):
         self.scatt_mgr.modeSet.connect(self.ModeSet)
 
     def _toolbarData(self):
-        """!Toolbar data
+        """Toolbar data
         """
         self.icons = {
             'sel_add'         : MetaIcon(img = 'layer-add',
@@ -236,7 +236,7 @@ class EditingToolbar(BaseToolbar):
         return vars(self)[toolName]
 
 class CategoryToolbar(BaseToolbar):
-    """!Main toolbar
+    """Main toolbar
     """
     def __init__(self, parent, scatt_mgr, cats_list):
         BaseToolbar.__init__(self, parent)
@@ -250,7 +250,7 @@ class CategoryToolbar(BaseToolbar):
         self.Realize()
 
     def _toolbarData(self):
-        """!Toolbar data
+        """Toolbar data
         """
         self.icons = {
             'add_class'     : MetaIcon(img = 'layer-add',
@@ -264,4 +264,4 @@ class CategoryToolbar(BaseToolbar):
                                      lambda event: self.cats_mgr.AddCategory()),
                                      ("remove_class", self.icons['remove_class'],
                                      lambda event: self.cats_list.DeleteCategory()),
-                                    ))
+                                    ))

+ 139 - 135
gui/wxpython/lmgr/frame.py

@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-"""!
+"""
 @package lmgr::frame
 
 @brief Layer Manager - main menu, layer management toolbar, notebook
@@ -78,7 +78,7 @@ from mapswipe.frame        import SwipeMapFrame
 from rlisetup.frame        import RLiSetupFrame
 
 class GMFrame(wx.Frame):
-    """!Layer Manager frame with notebook widget for controlling GRASS
+    """Layer Manager frame with notebook widget for controlling GRASS
     GIS. Includes command console page for typing GRASS (and other)
     commands, tree widget page for managing map layers.
     """
@@ -239,20 +239,20 @@ class GMFrame(wx.Frame):
         wx.CallAfter(self.Raise)
 
     def _setTitle(self):
-        """!Set frame title"""
+        """Set frame title"""
         if self.workspaceFile:
             self.SetTitle(self.baseTitle + " - " +  os.path.splitext(os.path.basename(self.workspaceFile))[0])
         else:
             self.SetTitle(self.baseTitle)
         
     def _createMenuBar(self):
-        """!Creates menu bar"""
+        """Creates menu bar"""
         self.menubar = Menu(parent=self, model=self._menuTreeBuilder.GetModel(separators=True))
         self.SetMenuBar(self.menubar)
         self.menucmd = self.menubar.GetCmd()
         
     def _createTabMenu(self):
-        """!Creates context menu for display tabs.
+        """Creates context menu for display tabs.
         
         Used to rename display.
         """
@@ -268,13 +268,13 @@ class GMFrame(wx.Frame):
         self.goutput.SetCopyingOfSelectedText(copy)
     
     def IsPaneShown(self, name):
-        """!Check if pane (toolbar, ...) of given name is currently shown"""
+        """Check if pane (toolbar, ...) of given name is currently shown"""
         if self._auimgr.GetPane(name).IsOk():
             return self._auimgr.GetPane(name).IsShown()
         return False
     
     def _createNoteBook(self):
-        """!Creates notebook widgets"""
+        """Creates notebook widgets"""
         self.notebook = GNotebook(parent = self, style = globalvar.FNPageDStyle)
         # create displays notebook widget and add it to main notebook page
         cbStyle = globalvar.FNPageStyle
@@ -332,9 +332,10 @@ class GMFrame(wx.Frame):
         return self.notebook
             
     def AddNvizTools(self, firstTime):
-        """!Add nviz notebook page
+        """Add nviz notebook page
 
-        @param firstTime if a mapdisplay is starting 3D mode for the first time
+        :param firstTime: if a mapdisplay is starting 3D mode for the
+                          first time
         """
         Debug.msg(5, "GMFrame.AddNvizTools()")
         if not haveNviz:
@@ -362,7 +363,7 @@ class GMFrame(wx.Frame):
                 self.nviz.UpdatePage(page)
 
     def RemoveNvizTools(self):
-        """!Remove nviz notebook page"""
+        """Remove nviz notebook page"""
         # if more mapwindow3D were possible, check here if nb page should be removed
         self.notebook.SetSelectionByName('layers')
         self.notebook.DeletePage('nviz')
@@ -374,7 +375,7 @@ class GMFrame(wx.Frame):
         self._auimgr.Update()
     
     def WorkspaceChanged(self):
-        """!Update window title"""
+        """Update window title"""
         if not self.workspaceChanged:
             self.workspaceChanged = True
         
@@ -382,7 +383,7 @@ class GMFrame(wx.Frame):
             self._setTitle()
         
     def OnLocationWizard(self, event):
-        """!Launch location wizard"""
+        """Launch location wizard"""
         from location_wizard.wizard import LocationWizard
         from location_wizard.dialogs import RegionDef
         
@@ -432,7 +433,7 @@ class GMFrame(wx.Frame):
                     dlg.Destroy()
         
     def OnSettingsChanged(self):
-        """!Here can be functions which have to be called
+        """Here can be functions which have to be called
         after receiving settingsChanged signal. 
         Now only set copying of selected text to clipboard (in goutput).
         """
@@ -440,19 +441,19 @@ class GMFrame(wx.Frame):
         self._setCopyingOfSelectedText()
         
     def OnGCPManager(self, event=None, cmd=None):
-        """!Launch georectifier module. See OnIClass documentation.
+        """Launch georectifier module. See OnIClass documentation.
         """
         GCPWizard(self, self._giface)
 
     def OnGModeler(self, event=None, cmd=None):
-        """!Launch Graphical Modeler. See OnIClass documentation."""
+        """Launch Graphical Modeler. See OnIClass documentation."""
         win = ModelFrame(parent = self, giface = self._giface)
         win.CentreOnScreen()
         
         win.Show()
         
     def OnPsMap(self, event=None, cmd=None):
-        """!Launch Cartographic Composer. See OnIClass documentation.
+        """Launch Cartographic Composer. See OnIClass documentation.
         """
         win = PsMapFrame(parent = self)
         win.CentreOnScreen()
@@ -460,7 +461,7 @@ class GMFrame(wx.Frame):
         win.Show()
 
     def OnMapSwipe(self, event=None, cmd=None):
-        """!Launch Map Swipe. See OnIClass documentation."""
+        """Launch Map Swipe. See OnIClass documentation."""
         win = SwipeMapFrame(parent=self, giface=self._giface)
 
         rasters = []
@@ -481,7 +482,7 @@ class GMFrame(wx.Frame):
         win.Show()
 
     def OnRLiSetup(self, event=None, cmd=None):
-        """!Launch r.li Setup. See OnIClass documentation."""
+        """Launch r.li Setup. See OnIClass documentation."""
         win = RLiSetupFrame(parent = self)
         win.CentreOnScreen()
         
@@ -495,7 +496,7 @@ class GMFrame(wx.Frame):
         self.SetStatusText('')
         
     def OnRunModel(self, event):
-        """!Run model"""
+        """Run model"""
         filename = ''
         dlg = wx.FileDialog(parent = self, message =_("Choose model to run"),
                             defaultDir = os.getcwd(),
@@ -514,7 +515,7 @@ class GMFrame(wx.Frame):
         dlg.Destroy()
         
     def OnMapsets(self, event):
-        """!Launch mapset access dialog
+        """Launch mapset access dialog
         """
         dlg = MapsetAccess(parent = self, id = wx.ID_ANY)
         dlg.CenterOnScreen()
@@ -527,7 +528,7 @@ class GMFrame(wx.Frame):
                        operation = 'set')
         
     def OnCBPageChanged(self, event):
-        """!Page in notebook (display) changed"""
+        """Page in notebook (display) changed"""
         self.currentPage    = self.notebookLayers.GetCurrentPage()
         self.currentPageNum = self.notebookLayers.GetSelection()
         try:
@@ -539,7 +540,7 @@ class GMFrame(wx.Frame):
         event.Skip()
 
     def OnPageChanged(self, event):
-        """!Page in notebook changed"""
+        """Page in notebook changed"""
         page = event.GetSelection()
         if page == self.notebook.GetPageIndexByName('output'):
             wx.CallAfter(self.goutput.ResetFocus)
@@ -548,7 +549,7 @@ class GMFrame(wx.Frame):
         event.Skip()
 
     def OnCBPageClosed(self, event):
-        """!Page of notebook closed
+        """Page of notebook closed
         Also close associated map display
         """
         if UserSettings.Get(group = 'manager', key = 'askOnQuit', subkey = 'enabled'):
@@ -592,7 +593,7 @@ class GMFrame(wx.Frame):
         event.Skip()
 
     def _switchPage(self, notification):
-        """!Manages @c 'output' notebook page according to event notification."""
+        """Manages @c 'output' notebook page according to event notification."""
         if notification == Notification.HIGHLIGHT:
             self.notebook.HighlightPageByName('output')
         if notification == Notification.MAKE_VISIBLE:
@@ -603,7 +604,7 @@ class GMFrame(wx.Frame):
             self.Raise()
 
     def RunSpecialCmd(self, command):
-        """!Run command from command line, check for GUI wrappers"""
+        """Run command from command line, check for GUI wrappers"""
         if re.compile('^d\..*').search(command[0]):
             self.RunDisplayCmd(command)
         elif re.compile('r[3]?\.mapcalc').search(command[0]):
@@ -629,9 +630,9 @@ class GMFrame(wx.Frame):
                              ' not supported.' % ' '.join(command))
 
     def RunDisplayCmd(self, command):
-        """!Handles display commands.
+        """Handles display commands.
 
-        @param command command in a list
+        :param command: command in a list
         """
         if not self.currentPage:
             self.NewDisplay(show = True)
@@ -679,27 +680,27 @@ class GMFrame(wx.Frame):
                                          lcmd = command)
 
     def GetLayerNotebook(self):
-        """!Get Layers Notebook"""
+        """Get Layers Notebook"""
         return self.notebookLayers
     
     def GetLayerTree(self):
-        """!Get current layer tree
+        """Get current layer tree
 
-        @return LayerTree instance
-        @return None no layer tree selected
+        :return: LayerTree instance
+        :return: None no layer tree selected
         """
         if self.currentPage:
             return self.currentPage.maptree
         return None
     
     def GetMapDisplay(self, onlyCurrent = True):
-        """!Get current map display
+        """Get current map display
 
-        @param onlyCurrent True to return only active mapdisplay
-                           False for list of all mapdisplays
+        :param bool onlyCurrent: True to return only active mapdisplay
+                                 False for list of all mapdisplays
 
-        @return MapFrame instance (or list)
-        @return None no mapdisplay selected
+        :return: MapFrame instance (or list)
+        :return: None no mapdisplay selected
         """
         if onlyCurrent:
             if self.currentPage:
@@ -714,20 +715,20 @@ class GMFrame(wx.Frame):
             return mlist
 
     def GetLogWindow(self):
-        """!Gets console for command output and messages"""
+        """Gets console for command output and messages"""
         return self._gconsole
     
     def GetToolbar(self, name):
-        """!Returns toolbar if exists else None"""
+        """Returns toolbar if exists else None"""
         if name in self.toolbars:
             return self.toolbars[name]
         
         return None
         
     def GetMenuCmd(self, event):
-        """!Get GRASS command from menu item
+        """Get GRASS command from menu item
 
-        Return command as a list"""
+        :return: command as a list"""
         layer = None
         if event:
             cmd = self.menucmd[event.GetId()]
@@ -761,13 +762,13 @@ class GMFrame(wx.Frame):
         return cmdlist
 
     def RunMenuCmd(self, event = None, cmd = []):
-        """!Run command selected from menu"""
+        """Run command selected from menu"""
         if event:       
             cmd = self.GetMenuCmd(event)
         self._gconsole.RunCmd(cmd)
 
     def OnMenuCmd(self, event = None, cmd = []):
-        """!Parse command selected from menu"""
+        """Parse command selected from menu"""
         if event:       
             cmd = self.GetMenuCmd(event)
         GUI(parent=self, giface=self._giface).ParseCommand(cmd)
@@ -780,7 +781,7 @@ class GMFrame(wx.Frame):
             self.NewDisplay(show = True).OnVNet(event)
         
     def OnVDigit(self, event):
-        """!Start vector digitizer
+        """Start vector digitizer
         """
         if not self.currentPage:
             self.MsgNoLayerSelected()
@@ -828,7 +829,7 @@ class GMFrame(wx.Frame):
         tree.OnStartEditing(None) # TODO: change to signal
         
     def OnRunScript(self, event):
-        """!Run user-defined script"""
+        """Run user-defined script"""
         # open dialog and choose script file
         dlg = wx.FileDialog(parent = self, message = _("Choose script file to run"),
                             defaultDir = os.getcwd(),
@@ -913,7 +914,7 @@ class GMFrame(wx.Frame):
                          { 'loc' : location, 'mapset' : mapset })
         
     def OnCreateMapset(self, event):
-        """!Create new mapset"""
+        """Create new mapset"""
         dlg = wx.TextEntryDialog(parent = self,
                                  message = _('Enter name for new mapset:'),
                                  caption = _('Create new mapset'))
@@ -958,10 +959,10 @@ class GMFrame(wx.Frame):
                     dispId += 1 
         
     def OnChangeCWD(self, event=None, cmd=None):
-        """!Change current working directory
+        """Change current working directory
 
-        @param event to be able to serve as a handler of wx event
-        @param command cd command as a list (must start with 'cd')
+        :param event: to be able to serve as a handler of wx event
+        :param cmd: command as a list (must start with 'cd')
         """
         # local functions
         def write_beginning(directory):
@@ -1006,11 +1007,11 @@ class GMFrame(wx.Frame):
                 write_end()
 
     def GetCwdPath(self):
-        """!Get current working directory or None"""
+        """Get current working directory or None"""
         return self.cwdPath
     
     def OnNewVector(self, event):
-        """!Create new vector map layer"""
+        """Create new vector map layer"""
         dlg = CreateNewVector(self, giface=self._giface,
                               cmd=(('v.edit',
                                     {'tool': 'create'},
@@ -1028,7 +1029,7 @@ class GMFrame(wx.Frame):
         dlg.Destroy()
         
     def OnSystemInfo(self, event):
-        """!Print system information"""
+        """Print system information"""
         vInfo = grass.version()
         if not vInfo:
             sys.stderr.write(_("Unable to get GRASS version\n"))
@@ -1068,13 +1069,13 @@ class GMFrame(wx.Frame):
         self._gconsole.WriteCmdLog(' ')
     
     def OnAboutGRASS(self, event):
-        """!Display 'About GRASS' dialog"""
+        """Display 'About GRASS' dialog"""
         win = AboutWindow(self)
         win.CentreOnScreen()
         win.Show(True)  
 
     def _popupMenu(self, data):
-        """!Create popup menu
+        """Create popup menu
         """
         menu = wx.Menu()
         
@@ -1092,7 +1093,7 @@ class GMFrame(wx.Frame):
         menu.Destroy()
 
     def OnImportMenu(self, event):
-        """!Import maps menu (import, link)
+        """Import maps menu (import, link)
         """
         self._popupMenu((('rastImport',    self.OnImportGdalLayers),
                          ('rastLink',      self.OnLinkGdalLayers),
@@ -1103,7 +1104,7 @@ class GMFrame(wx.Frame):
                          ('vectOut',       self.OnVectorOutputFormat)))
         
     def OnWorkspaceNew(self, event = None):
-        """!Create new workspace file
+        """Create new workspace file
 
         Erase current workspace settings first
         """
@@ -1147,7 +1148,7 @@ class GMFrame(wx.Frame):
         self._setTitle()
         
     def OnWorkspaceOpen(self, event = None):
-        """!Open file with workspace definition"""
+        """Open file with workspace definition"""
         dlg = wx.FileDialog(parent = self, message = _("Choose workspace file"),
                             defaultDir = os.getcwd(), wildcard = _("GRASS Workspace File (*.gxw)|*.gxw"))
 
@@ -1169,12 +1170,13 @@ class GMFrame(wx.Frame):
         self._setTitle()
 
     def LoadWorkspaceFile(self, filename):
-        """!Load layer tree definition stored in GRASS Workspace XML file (gxw)
+        """Load layer tree definition stored in GRASS Workspace XML file (gxw)
 
-        @todo Validate against DTD
+        .. todo::
+            Validate against DTD
         
-        @return True on success
-        @return False on error
+        :return: True on success
+        :return: False on error
         """
         # parse workspace file
         try:
@@ -1298,7 +1300,7 @@ class GMFrame(wx.Frame):
         return True
     
     def OnWorkspaceLoadGrcFile(self, event):
-        """!Load map layers from GRC file (Tcl/Tk GUI) into map layer tree"""
+        """Load map layers from GRC file (Tcl/Tk GUI) into map layer tree"""
         dlg = wx.FileDialog(parent = self, message = _("Choose GRC file to load"),
                             defaultDir = os.getcwd(), wildcard = _("Old GRASS Workspace File (*.grc)|*.grc"))
 
@@ -1336,7 +1338,7 @@ class GMFrame(wx.Frame):
             maptree.Map.ReverseListOfLayers()
 
     def OnWorkspaceSaveAs(self, event = None):
-        """!Save workspace definition to selected file"""
+        """Save workspace definition to selected file"""
         dlg = wx.FileDialog(parent = self, message = _("Choose file to save current workspace"),
                             defaultDir = os.getcwd(), wildcard = _("GRASS Workspace File (*.gxw)|*.gxw"), style = wx.FD_SAVE)
 
@@ -1366,7 +1368,7 @@ class GMFrame(wx.Frame):
         self._setTitle()
 
     def OnWorkspaceSave(self, event = None):
-        """!Save file with workspace definition"""
+        """Save file with workspace definition"""
         if self.workspaceFile:
             dlg = wx.MessageDialog(self, message = _("Workspace file <%s> already exists. "
                                                    "Do you want to overwrite this file?") % \
@@ -1383,9 +1385,9 @@ class GMFrame(wx.Frame):
             self.OnWorkspaceSaveAs()
 
     def SaveToWorkspaceFile(self, filename):
-        """!Save layer tree layout to workspace file
+        """Save layer tree layout to workspace file
         
-        Return True on success, False on error
+        :return: True on success, False on error
         """
         tmpfile = tempfile.TemporaryFile(mode = 'w+b')
         try:
@@ -1411,7 +1413,7 @@ class GMFrame(wx.Frame):
         return True
     
     def OnWorkspaceClose(self, event = None):
-        """!Close file with workspace definition
+        """Close file with workspace definition
         
         If workspace has been modified ask user to save the changes.
         """
@@ -1425,19 +1427,19 @@ class GMFrame(wx.Frame):
         self.currentPage = None
         
     def OnDisplayClose(self, event = None):
-        """!Close current map display window
+        """Close current map display window
         """
         if self.currentPage and self.GetMapDisplay():
             self.GetMapDisplay().OnCloseWindow(event)
         
     def OnDisplayCloseAll(self, event = None):
-        """!Close all open map display windows
+        """Close all open map display windows
         """
         for display in self.GetMapDisplay(onlyCurrent = False):
             display.OnCloseWindow(event)
         
     def OnRenameDisplay(self, event):
-        """!Change Map Display name"""
+        """Change Map Display name"""
         name = self.notebookLayers.GetPageText(self.currentPageNum)
         dlg = wx.TextEntryDialog(self, message = _("Enter new name:"),
                                  caption = _("Rename Map Display"), defaultValue = name)
@@ -1451,14 +1453,14 @@ class GMFrame(wx.Frame):
         dlg.Destroy()
         
     def OnRasterRules(self, event):
-        """!Launches dialog for raster color rules
+        """Launches dialog for raster color rules
         """
         ctable = RasterColorTable(self, layerTree = self.GetLayerTree())
         ctable.Show()
         ctable.CentreOnScreen()
 
     def OnVectorRules(self, event):
-        """!Launches dialog for vector color rules
+        """Launches dialog for vector color rules
         """
         ctable = VectorColorTable(self, layerTree = self.GetLayerTree(),
                                   attributeType = 'color')
@@ -1466,26 +1468,26 @@ class GMFrame(wx.Frame):
         ctable.CentreOnScreen()
         
     def OnEditImageryGroups(self, event, cmd = None):
-        """!Show dialog for creating and editing groups.
+        """Show dialog for creating and editing groups.
         """
         dlg = GroupDialog(self)
         dlg.CentreOnScreen()
         dlg.Show()
         
     def OnInstallExtension(self, event):
-        """!Install extension from GRASS Addons SVN repository"""
+        """Install extension from GRASS Addons SVN repository"""
         win = InstallExtensionWindow(self, giface=self._giface, size = (650, 550))
         win.CentreOnScreen()
         win.Show()
         
     def OnManageExtension(self, event):
-        """!Uninstall extension"""
+        """Uninstall extension"""
         win = ManageExtensionWindow(self, size = (650, 300))
         win.CentreOnScreen()
         win.Show()
 
     def OnPreferences(self, event):
-        """!General GUI preferences/settings
+        """General GUI preferences/settings
         """
         if not self.dialogs['preferences']:
             dlg = PreferencesDialog(parent = self, giface = self._giface)
@@ -1497,7 +1499,7 @@ class GMFrame(wx.Frame):
         self.dialogs['preferences'].ShowModal()
         
     def OnNvizPreferences(self, event):
-        """!Show nviz preferences"""
+        """Show nviz preferences"""
         if not self.dialogs['nvizPreferences']:
             dlg = NvizPreferencesDialog(parent = self, giface = self._giface)
             self.dialogs['nvizPreferences'] = dlg
@@ -1506,19 +1508,21 @@ class GMFrame(wx.Frame):
         self.dialogs['nvizPreferences'].Show()
 
     def OnHelp(self, event):
-        """!Show help
+        """Show help
         """
         self._gconsole.RunCmd(['g.manual','-i'])
         
     def OnIClass(self, event=None, cmd=None):
-        """!Start wxIClass tool
+        """Start wxIClass tool
 
         The parameters of all handlers which are associated with module
         and contained in menu/toolboxes must be event and cmd.
-        When called from menu event is always None and cmd is the associated
-        command (list containing a module name and paremeters).
-        @todo This documentation is actually documentation of some component related
-        to gui_core/menu.py file.
+        When called from menu event is always None and cmd is the
+        associated command (list containing a module name and paremeters).
+        
+        .. todo::
+            This documentation is actually documentation of some
+            component related to gui_core/menu.py file.
         """
         from iclass.frame import IClassMapFrame, haveIClass, errMsg
         if not haveIClass:
@@ -1532,7 +1536,7 @@ class GMFrame(wx.Frame):
         win.Show()
 
     def OnAnimationTool(self, event=None, cmd=None):
-        """!Launch Animation tool. See OnIClass documentation.
+        """Launch Animation tool. See OnIClass documentation.
         """
         from animation.frame import AnimationFrame
 
@@ -1568,7 +1572,7 @@ class GMFrame(wx.Frame):
         frame.Show()
 
     def OnHistogram(self, event):
-        """!Init histogram display canvas and tools
+        """Init histogram display canvas and tools
         """
         from modules.histogram import HistogramFrame
         win = HistogramFrame(self, giface=self._giface)
@@ -1579,7 +1583,7 @@ class GMFrame(wx.Frame):
         win.Update()
 
     def OnMapCalculator(self, event, cmd = ''):
-        """!Init map calculator for interactive creation of mapcalc statements
+        """Init map calculator for interactive creation of mapcalc statements
         """
         if event:
             try:
@@ -1594,7 +1598,7 @@ class GMFrame(wx.Frame):
         win.Show()
     
     def OnVectorCleaning(self, event, cmd = ''):
-        """!Init interactive vector cleaning
+        """Init interactive vector cleaning
         """
         from modules.vclean import VectorCleaningFrame
         win = VectorCleaningFrame(parent = self)
@@ -1602,47 +1606,47 @@ class GMFrame(wx.Frame):
         win.Show()
 
     def OnRasterOutputFormat(self, event):
-        """!Set raster output format handler"""
+        """Set raster output format handler"""
         self.OnMenuCmd(cmd = ['r.external.out'])
 
     def OnVectorOutputFormat(self, event):
-        """!Set vector output format handler"""
+        """Set vector output format handler"""
         dlg = GdalOutputDialog(parent = self, ogr = True)
         dlg.CentreOnScreen()
         dlg.Show()
     
     def OnImportDxfFile(self, event, cmd = None):
-        """!Convert multiple DXF layers to GRASS vector map layers"""
+        """Convert multiple DXF layers to GRASS vector map layers"""
         dlg = DxfImportDialog(parent = self, giface = self._giface)
         dlg.CentreOnScreen()
         dlg.Show()
 
     def OnImportGdalLayers(self, event, cmd = None):
-        """!Convert multiple GDAL layers to GRASS raster map layers"""
+        """Convert multiple GDAL layers to GRASS raster map layers"""
         dlg = GdalImportDialog(parent = self, giface = self._giface)
         dlg.CentreOnScreen()
         dlg.Show()
 
     def OnLinkGdalLayers(self, event, cmd = None):
-        """!Link multiple GDAL layers to GRASS raster map layers"""
+        """Link multiple GDAL layers to GRASS raster map layers"""
         dlg = GdalImportDialog(parent = self, giface = self._giface, link = True)
         dlg.CentreOnScreen()
         dlg.Show()
         
     def OnImportOgrLayers(self, event, cmd = None):
-        """!Convert multiple OGR layers to GRASS vector map layers"""
+        """Convert multiple OGR layers to GRASS vector map layers"""
         dlg = GdalImportDialog(parent = self, giface = self._giface, ogr = True)
         dlg.CentreOnScreen()
         dlg.Show()
         
     def OnLinkOgrLayers(self, event, cmd = None):
-        """!Links multiple OGR layers to GRASS vector map layers"""
+        """Links multiple OGR layers to GRASS vector map layers"""
         dlg = GdalImportDialog(parent = self, giface = self._giface, ogr = True, link = True)
         dlg.CentreOnScreen()
         dlg.Show()
         
     def OnAddWS(self, event, cmd = None):
-        """!Add web services layer"""
+        """Add web services layer"""
         from web_services.dialogs import AddWSDialog
         dlg = AddWSDialog(parent = self, giface = self._giface)
         dlg.CentreOnScreen()
@@ -1651,7 +1655,7 @@ class GMFrame(wx.Frame):
         dlg.Show()
 
     def OnShowAttributeTable(self, event, selection = None):
-        """!Show attribute table of the given vector map layer
+        """Show attribute table of the given vector map layer
         """
         if not self.currentPage:
             self.MsgNoLayerSelected()
@@ -1693,17 +1697,17 @@ class GMFrame(wx.Frame):
         dbmanager.Show()
         
     def OnNewDisplay(self, event = None):
-        """!Create new layer tree and map display instance"""
+        """Create new layer tree and map display instance"""
         self.NewDisplay()
 
     def NewDisplay(self, name = None, show = True):
-        """!Create new layer tree, which will
+        """Create new layer tree, which will
         create an associated map display frame
 
-        @param name name of new map display
-        @param show show map display window if True
+        :param name: name of new map display
+        :param show: show map display window if True
 
-        @return reference to mapdisplay intance
+        :return: reference to mapdisplay intance
         """
         Debug.msg(1, "GMFrame.NewDisplay(): idx=%d" % self.displayIndex)
         
@@ -1770,7 +1774,7 @@ class GMFrame(wx.Frame):
             self.currentPage = self.notebookLayers.GetCurrentPage()
 
     def _onMapDisplayStarting3dMode(self, mapDisplayPage):
-        """!Disables 3D mode for all map displays except for @p mapDisplay"""
+        """Disables 3D mode for all map displays except for @p mapDisplay"""
         # TODO: it should be disabled also for newly created map windows
         # moreover mapdisp.Disable3dMode() does not work properly
         for page in range(0, self.GetLayerNotebook().GetPageCount()):
@@ -1779,7 +1783,7 @@ class GMFrame(wx.Frame):
                 mapdisp.Disable3dMode()
 
     def OnAddMaps(self, event = None):
-        """!Add selected map layers into layer tree"""
+        """Add selected map layers into layer tree"""
         dialog = MapLayersDialog(parent = self, title = _("Add selected map layers into layer tree"))
         dialog.applyAddingMapLayers.connect(self.AddMaps)
         val = dialog.ShowModal()
@@ -1789,12 +1793,12 @@ class GMFrame(wx.Frame):
         dialog.Destroy()
 
     def AddMaps(self, mapLayers, ltype, check = False):
-        """!Add map layers to layer tree.
+        """Add map layers to layer tree.
 
-        @param mapLayers list of map names
-        @param ltype layer type ('rast', 'rast3d', 'vect')
-        @param check @c True if new layers should be checked in layer tree
-        @c False otherwise
+        :param list mapLayers: list of map names
+        :param str ltype: layer type ('rast', 'rast3d', 'vect')
+        :param bool check: True if new layers should be checked in
+                           layer tree False otherwise
         """
         # start new map display if no display is available
         if not self.currentPage:
@@ -1825,14 +1829,14 @@ class GMFrame(wx.Frame):
                                        lgroup = None)
 
     def _updateCurrentMap(self, **kwargs):
-        """!Updates map of the current map window."""
+        """Updates map of the current map window."""
         if kwargs.has_key('delay'):
             self.GetMapDisplay().GetWindow().UpdateMap(delay=kwargs['delay'])
         else:
             self.GetMapDisplay().GetWindow().UpdateMap()
 
     def OnMapCreated(self, name, ltype, add=None):
-        """!Decides wheter the map should be added to layer tree."""
+        """Decides wheter the map should be added to layer tree."""
         if add is None:
             # add new map into layer if globally enabled
             if UserSettings.Get(group = 'cmd',
@@ -1847,7 +1851,7 @@ class GMFrame(wx.Frame):
             display.GetWindow().UpdateMap(render = True)
 
     def AddOrUpdateMap(self, mapName, ltype):
-        """!Add map layer or update"""
+        """Add map layer or update"""
         # start new map display if no display is available
 
         # TODO: standardize type identifiers
@@ -1876,7 +1880,7 @@ class GMFrame(wx.Frame):
                 self.AddMaps([mapName], grassType, check = True)
 
     def OnAddRaster(self, event):
-        """!Add raster map layer"""
+        """Add raster map layer"""
         # start new map display if no display is available
         if not self.currentPage:
             self.NewDisplay(show = True)
@@ -1885,7 +1889,7 @@ class GMFrame(wx.Frame):
         self.GetLayerTree().AddLayer('raster')
         
     def OnAddRasterMisc(self, event):
-        """!Create misc raster popup-menu"""
+        """Create misc raster popup-menu"""
         # start new map display if no display is available
         if not self.currentPage:
             self.NewDisplay(show = True)
@@ -1904,7 +1908,7 @@ class GMFrame(wx.Frame):
         self.GetMapDisplay().Show()
         
     def OnAddVector(self, event):
-        """!Add vector map to the current layer tree"""
+        """Add vector map to the current layer tree"""
         # start new map display if no display is available
         if not self.currentPage:
             self.NewDisplay(show = True)
@@ -1913,7 +1917,7 @@ class GMFrame(wx.Frame):
         self.GetLayerTree().AddLayer('vector')
 
     def OnAddVectorMisc(self, event):
-        """!Create misc vector popup-menu"""
+        """Create misc vector popup-menu"""
         # start new map display if no display is available
         if not self.currentPage:
             self.NewDisplay(show = True)
@@ -1925,17 +1929,17 @@ class GMFrame(wx.Frame):
         self.GetMapDisplay().Show()
 
     def OnAddVectorTheme(self, event):
-        """!Add thematic vector map to the current layer tree"""
+        """Add thematic vector map to the current layer tree"""
         self.notebook.SetSelectionByName('layers')
         self.GetLayerTree().AddLayer('thememap')
 
     def OnAddVectorChart(self, event):
-        """!Add chart vector map to the current layer tree"""
+        """Add chart vector map to the current layer tree"""
         self.notebook.SetSelectionByName('layers')
         self.GetLayerTree().AddLayer('themechart')
 
     def OnAddOverlay(self, event):
-        """!Create decoration overlay menu""" 
+        """Create decoration overlay menu"""
         # start new map display if no display is available
         if not self.currentPage:
             self.NewDisplay(show = True)
@@ -1951,27 +1955,27 @@ class GMFrame(wx.Frame):
         self.GetMapDisplay().Show()
         
     def OnAddRaster3D(self, event):
-        """!Add 3D raster map to the current layer tree"""
+        """Add 3D raster map to the current layer tree"""
         self.notebook.SetSelectionByName('layers')
         self.GetLayerTree().AddLayer('3d-raster')
 
     def OnAddRasterRGB(self, event):
-        """!Add RGB raster map to the current layer tree"""
+        """Add RGB raster map to the current layer tree"""
         self.notebook.SetSelectionByName('layers')
         self.GetLayerTree().AddLayer('rgb')
 
     def OnAddRasterHIS(self, event):
-        """!Add HIS raster map to the current layer tree"""
+        """Add HIS raster map to the current layer tree"""
         self.notebook.SetSelectionByName('layers')
         self.GetLayerTree().AddLayer('his')
 
     def OnAddRasterShaded(self, event):
-        """!Add shaded relief raster map to the current layer tree"""
+        """Add shaded relief raster map to the current layer tree"""
         self.notebook.SetSelectionByName('layers')
         self.GetLayerTree().AddLayer('shaded')
 
     def OnAddRasterArrow(self, event):
-        """!Add flow arrows raster map to the current layer tree"""
+        """Add flow arrows raster map to the current layer tree"""
         self.notebook.SetSelectionByName('layers')
         # here it seems that it should be retrieved from the mapwindow
         mapdisplay = self.GetMapDisplay()
@@ -1985,7 +1989,7 @@ class GMFrame(wx.Frame):
         self.GetLayerTree().AddLayer('rastarrow')
 
     def OnAddRasterNum(self, event):
-        """!Add cell number raster map to the current layer tree"""
+        """Add cell number raster map to the current layer tree"""
         self.notebook.SetSelectionByName('layers')
         mapdisplay = self.GetMapDisplay()
         resolution = mapdisplay.mapWindowProperties.resolution
@@ -2003,7 +2007,7 @@ class GMFrame(wx.Frame):
         self.GetLayerTree().AddLayer('rastnum')
 
     def OnAddCommand(self, event):
-        """!Add command line map layer to the current layer tree"""
+        """Add command line map layer to the current layer tree"""
         # start new map display if no display is available
         if not self.currentPage:
             self.NewDisplay(show = True)
@@ -2015,7 +2019,7 @@ class GMFrame(wx.Frame):
         self.GetMapDisplay().Show()
 
     def OnAddGroup(self, event):
-        """!Add layer group"""
+        """Add layer group"""
         # start new map display if no display is available
         if not self.currentPage:
             self.NewDisplay(show = True)
@@ -2027,22 +2031,22 @@ class GMFrame(wx.Frame):
         self.GetMapDisplay().Show()
 
     def OnAddGrid(self, event):
-        """!Add grid map layer to the current layer tree"""
+        """Add grid map layer to the current layer tree"""
         self.notebook.SetSelectionByName('layers')
         self.GetLayerTree().AddLayer('grid')
 
     def OnAddGeodesic(self, event):
-        """!Add geodesic line map layer to the current layer tree"""
+        """Add geodesic line map layer to the current layer tree"""
         self.notebook.SetSelectionByName('layers')
         self.GetLayerTree().AddLayer('geodesic')
 
     def OnAddRhumb(self, event):
-        """!Add rhumb map layer to the current layer tree"""
+        """Add rhumb map layer to the current layer tree"""
         self.notebook.SetSelectionByName('layers')
         self.GetLayerTree().AddLayer('rhumb')
 
     def OnAddLabels(self, event):
-        """!Add vector labels map layer to the current layer tree"""
+        """Add vector labels map layer to the current layer tree"""
         # start new map display if no display is available
         if not self.currentPage:
             self.NewDisplay(show = True)
@@ -2054,7 +2058,7 @@ class GMFrame(wx.Frame):
         self.GetMapDisplay().Show()
 
     def OnDeleteLayer(self, event):
-        """!Remove selected map layer from the current layer Tree
+        """Remove selected map layer from the current layer Tree
         """
         if not self.currentPage or not self.GetLayerTree().layer_selected:
             self.MsgNoLayerSelected()
@@ -2094,7 +2098,7 @@ class GMFrame(wx.Frame):
             self.GetLayerTree().Delete(layer)
         
     def OnKeyDown(self, event):
-        """!Key pressed"""
+        """Key pressed"""
         kc = event.GetKeyCode()
         
         if event.ControlDown():
@@ -2120,7 +2124,7 @@ class GMFrame(wx.Frame):
         event.Skip()
 
     def OnCloseWindow(self, event):
-        """!Cleanup when wxGUI is quitted"""
+        """Cleanup when wxGUI is quitted"""
         # save command protocol if actived
         if self.goutput.btnCmdProtocol.GetValue():
             self.goutput.CmdProtocolSave()
@@ -2173,17 +2177,17 @@ class GMFrame(wx.Frame):
         self.Destroy()
         
     def MsgNoLayerSelected(self):
-        """!Show dialog message 'No layer selected'"""
+        """Show dialog message 'No layer selected'"""
         wx.MessageBox(parent = self,
                       message = _("No map layer selected. Operation canceled."),
                       caption = _("Message"),
                       style = wx.OK | wx.ICON_INFORMATION | wx.CENTRE)
                       
     def MsgDisplayResolution(self, limitText = None):
-        """!Returns dialog for d.rast.num, d.rast.arrow
+        """Returns dialog for d.rast.num, d.rast.arrow
             when display resolution is not constrained
             
-        @param limitText adds a note about cell limit
+        :param limitText: adds a note about cell limit
         """
         message = _("Display resolution is currently not constrained to "
                     "computational settings. "

+ 34 - 28
gui/wxpython/lmgr/giface.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package lmgr.giface
 
 @brief Layer Manager GRASS interface
@@ -22,10 +22,12 @@ from core.giface import Notification
 
 
 class Layer(object):
-    """!@implements core::giface::Layer
+    """@implements core::giface::Layer
+
+    .. note::
 
-    @note Currently implemented without specifying the interface.
-    It only provides all attributes of existing layer as used in lmgr.
+        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
@@ -41,21 +43,21 @@ class Layer(object):
 
 
 class LayerList(object):
-    """!@implements core.giface.Layer"""
+    """@implements core.giface.Layer"""
     def __init__(self, tree):
         self._tree = tree
 
     def __iter__(self):
-        """!Iterates over the contents of the list."""
+        """Iterates over the contents of the list."""
         for item in self._tree.GetSelectedLayer(multi=True):
             yield Layer(self._tree.GetPyData(item))
 
     def __getitem__(self, index):
-        """!Select a layer from the LayerList using the index."""
+        """Select a layer from the LayerList using the index."""
         return [l for l in self][index]
 
     def __repr__(self):
-        """!Return a representation of the object."""
+        """Return a representation of the object."""
         return "LayerList(%r)" % [layer for layer in self]
 
     def GetSelectedLayers(self, checkedOnly=True):
@@ -69,7 +71,7 @@ class LayerList(object):
 
     # TODO: it is not clear if default of checkedOnly should be False or True
     def GetSelectedLayer(self, checkedOnly=False):
-        """!Returns selected layer or None when there is no selected layer."""
+        """Returns selected layer or None when there is no selected layer."""
         item = self._tree.GetSelectedLayer(multi=False,
                                            checkedOnly=checkedOnly)
         if item is None:
@@ -79,20 +81,20 @@ class LayerList(object):
             return Layer(data)
 
     def GetLayerInfo(self, layer):
-        """!For compatibility only, will be removed."""
+        """For compatibility only, will be removed."""
         return Layer(self._tree.GetPyData(layer))
 
     def AddLayer(self, ltype, name=None, checked=None,
                  opacity=1.0, cmd=None):
-        """!Adds a new layer to the layer list.
+        """Adds a new layer to the layer list.
 
         Launches property dialog if needed (raster, vector, etc.)
 
-        @param ltype layer type (raster, vector, 3d-raster, ...)
-        @param name layer name
-        @param checked if True layer is checked
-        @param opacity layer opacity level
-        @param cmd command (given as a list)
+        :param ltype: layer type (raster, vector, 3d-raster, ...)
+        :param name: layer name
+        :param checked: if True layer is checked
+        :param opacity: layer opacity level
+        :param cmd: command (given as a list)
         """
         self._tree.AddLayer(ltype=ltype, lname=name, lchecked=checked,
                             lopacity=opacity, lcmd=cmd)
@@ -109,7 +111,7 @@ class LayerList(object):
             return layers
 
     def GetLayerByData(self, key, value):
-        """!Returns layer with specified.
+        """Returns layer with specified.
 
         Returns only one layer.
         Avoid using this method, it might be removed in the future.
@@ -125,9 +127,9 @@ class LayerList(object):
 
 
 class LayerManagerGrassInterface(object):
-    """!@implements core::giface::GrassInterface"""
+    """@implements core::giface::GrassInterface"""
     def __init__(self, lmgr):
-        """!Costructor is specific to the current implementation.
+        """Costructor is specific to the current implementation.
 
         Uses Layer Manager object including its private attributes.
         (It encapsulates existing Layer Manager so access to private members
@@ -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,16 +195,17 @@ 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),
+    """Provides reference only to the given layer list (according to tree),
         not to the current.
 
         @implements core::giface::GrassInterface
     """
     def __init__(self, giface, tree):
-        """!
-        @param giface original grass interface
-        @param tree tree which will be used instead of the tree from giface
+        """
+        :param giface: original grass interface
+        :param tree: tree which will be used instead of the tree from giface
         """
         self._giface = giface
         self.tree = tree

+ 92 - 87
gui/wxpython/lmgr/layertree.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package lmgr.layertree
 
 @brief Utility classes for map layer management.
@@ -110,7 +110,7 @@ LMIcons = {
     }
 
 class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
-    """!Creates layer tree structure
+    """Creates layer tree structure
     """
     def __init__(self, parent, giface,
                  id = wx.ID_ANY, style = wx.SUNKEN_BORDER,
@@ -223,10 +223,10 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
             self._icon[iconKey] = il.Add(icon)
             
     def _getSelectedLayer(self):
-        """!Get selected layer.
+        """Get selected layer.
 
-        @return None if no layer selected
-        @return first layer (GenericTreeItem instance) of all selected
+        :return: None if no layer selected
+        :return: first layer (GenericTreeItem instance) of all selected
         """
         return self.GetSelectedLayer(multi = False, checkedOnly = False)
 
@@ -234,20 +234,21 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
     layer_selected = property(fget = _getSelectedLayer)
 
     def GetSelectedLayers(self, checkedOnly = False):
-        """!Get selected layers as a list.
+        """Get selected layers as a list.
 
-        @todo somewhere we have checkedOnly default True and elsewhere False
+        .. todo::
+            somewhere we have checkedOnly default True and elsewhere False
         """
         return self.GetSelectedLayer(multi = True, checkedOnly = checkedOnly)
 
     def GetSelectedLayer(self, multi = False, checkedOnly = False):
-        """!Get selected layer from layer tree.
+        """Get selected layer from layer tree.
         
-        @param multi return multiple selection as a list
-        @param checkedOnly return only the checked layers
+        :param bool multi: return multiple selection as a list
+        :param bool checkedOnly: return only the checked layers
 
-        @return None or [] for multi == True if no layer selected 
-        @return first layer (GenericTreeItem instance) of all selected or a list
+        :return: None or [] for multi == True if no layer selected 
+        :return: first layer (GenericTreeItem instance) of all selected or a list
         """
         ret = []
         layers = self.GetSelections()
@@ -269,9 +270,9 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         self.SetItemImage(item, self._icon[iconName])
         
     def _setGradient(self, iType = None):
-        """!Set gradient for items
+        """Set gradient for items
 
-        @param iType bgmap, vdigit or None
+        :param iType: bgmap, vdigit or None
         """
         if iType == 'bgmap':
             self.SetFirstGradientColour(wx.Colour(0, 100, 0))
@@ -300,18 +301,18 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         return array
 
     def GetMap(self):
-        """!Get map instace"""
+        """Get map instace"""
         return self.Map
     
     def GetMapDisplay(self):
-        """!Get associated MapFrame"""
+        """Get associated MapFrame"""
         return self.mapdisplay
 
     def GetLayerInfo(self, layer, key = None):
-        """!Get layer info.
+        """Get layer info.
 
-        @param layer GenericTreeItem instance
-        @param key cmd, type, ctrl, label, maplayer, propwin, vdigit, nviz
+        :param layer: GenericTreeItem instance
+        :param key: cmd, type, ctrl, label, maplayer, propwin, vdigit, nviz
          (vdigit, nviz for map layers only)
         """
         if not self.GetPyData(layer):
@@ -321,22 +322,22 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         return self.GetPyData(layer)[0]
 
     def SetLayerInfo(self, layer, key, value):
-        """!Set layer info.
+        """Set layer info.
 
-        @param layer GenericTreeItem instance
-        @param key cmd, type, ctrl, label, maplayer, propwin, vdigit, nviz
+        :param layer: GenericTreeItem instance
+        :param key: cmd, type, ctrl, label, maplayer, propwin, vdigit, nviz
          (vdigit, nviz for map layers only)
-        @param value value
+        :param value: value
         """
         info = self.GetPyData(layer)[0]
         info[key] = value
 
     def GetLayerParams(self, layer):
-        """!Get layer command params"""
+        """Get layer command params"""
         return self.GetPyData(layer)[1]
 
     def OnIdle(self, event):
-        """!Only re-order and re-render a composite map image from GRASS during
+        """Only re-order and re-render a composite map image from GRASS during
         idle time instead of multiple times during layer changing.
         """
         # no need to check for digitizer since it is handled internaly
@@ -352,7 +353,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         event.Skip()
         
     def OnKeyUp(self, event):
-        """!Key pressed"""
+        """Key pressed"""
         key = event.GetKeyCode()
         
         if key == wx.WXK_DELETE and self.lmgr and \
@@ -362,11 +363,11 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         event.Skip()
 
     def OnKeyDown(self, event):
-        """!Skip event, otherwise causing error when layertree is empty"""
+        """Skip event, otherwise causing error when layertree is empty"""
         event.Skip()
 
     def OnLayerContextMenu (self, event):
-        """!Contextual menu for item/layer"""
+        """Contextual menu for item/layer"""
         if not self.layer_selected:
             event.Skip()
             return
@@ -622,7 +623,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         self.popupMenu.Destroy()
 
     def OnSaveWs(self, event):
-        """!Show dialog for saving web service layer into GRASS vector/raster layer"""
+        """Show dialog for saving web service layer into GRASS vector/raster layer"""
         mapLayer = self.GetLayerInfo(self.layer_selected, key = 'maplayer')
         dlg = SaveWMSLayerDialog(parent=self, layer=mapLayer,
                                  giface=self._gifaceForDisplay)
@@ -630,22 +631,24 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         dlg.Show()
 
     def OnTopology(self, event):
-        """!Rebuild topology of selected vector map"""
+        """Rebuild topology of selected vector map"""
         mapLayer = self.GetLayerInfo(self.layer_selected, key = 'maplayer')
         cmd = ['v.build',
                'map=%s' % mapLayer.GetName()]
         self._giface.RunCmd(cmd)
 
     def OnSqlQuery(self, event):
-        """!Show SQL query window for PostGIS layers
+        """Show SQL query window for PostGIS layers
         """
         dlg = SqlQueryFrame(parent = self)
         dlg.CentreOnScreen()
         dlg.Show()
         
     def OnMetadata(self, event):
-        """!Print metadata of raster/vector map layer
-        TODO: Dialog to modify metadata
+        """Print metadata of raster/vector map layer
+        
+        .. todo::
+            Dialog to modify metadata
         """
         mapLayer = self.GetLayerInfo(self.layer_selected, key = 'maplayer')
         mltype = self.GetLayerInfo(self.layer_selected,key = 'type')
@@ -662,7 +665,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         self._giface.RunCmd(cmd)
 
     def OnSetCompRegFromRaster(self, event):
-        """!Set computational region from selected raster map (ignore NULLs)"""
+        """Set computational region from selected raster map (ignore NULLs)"""
         mapLayer = self.GetLayerInfo(self.layer_selected, key = 'maplayer')
         
         cmd = ['g.region',
@@ -675,7 +678,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         self._giface.GetMapWindow().UpdateMap(render=True)
 
     def OnSetCompRegFromMap(self, event):
-        """!Set computational region from selected raster/vector map
+        """Set computational region from selected raster/vector map
         """
         rast = []
         vect = []
@@ -713,7 +716,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         self._giface.GetMapWindow().UpdateMap(render=True)
             
     def OnProfile(self, event):
-        """!Plot profile of given raster map layer"""
+        """Plot profile of given raster map layer"""
         mapLayer = self.GetLayerInfo(self.layer_selected, key = 'maplayer')
         if not mapLayer.GetName():
             wx.MessageBox(parent = self,
@@ -724,7 +727,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         self.mapdisplay.Profile(rasters=[mapLayer.GetName()])
 
     def OnRasterColorTable(self, event):
-        """!Set color table for 2D/3D raster map"""
+        """Set color table for 2D/3D raster map"""
         raster2d = []
         raster3d = []
         for layer in self.GetSelectedLayers():
@@ -741,7 +744,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
                                                                     'map=%s' % ','.join(raster3d)])
             
     def OnVectorColorTable(self, event):
-        """!Set color table for vector map"""
+        """Set color table for vector map"""
         name = self.GetLayerInfo(self.layer_selected, key = 'maplayer').GetName()
         GUI(parent = self, centreOnParent = False).ParseCommand(['v.colors',
                                                                  'map=%s' % name])
@@ -753,7 +756,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         GError(parent=self, message=message, caption=_("Invalid name"))
 
     def OnCopyMap(self, event):
-        """!Copy selected map into current mapset"""
+        """Copy selected map into current mapset"""
         layer = self.GetSelectedLayer()
         ltype = self.GetLayerInfo(layer, key='type')
         lnameSrc = self.GetLayerInfo(layer, key = 'maplayer').GetName()
@@ -814,7 +817,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         self.AddLayer(ltype, lname = lnameDst, lcmd = ['d.%s' % key, 'map=%s' % lnameDst])
 
     def OnHistogram(self, event):
-        """!Plot histogram for given raster map layer
+        """Plot histogram for given raster map layer
         """
         rasterList = []
         for layer in self.GetSelectedLayers():
@@ -831,7 +834,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         win.Show()
                 
     def OnUnivariateStats(self, event):
-        """!Univariate 2D/3D raster statistics"""
+        """Univariate 2D/3D raster statistics"""
         raster2d = []
         raster3d = []
         for layer in self.GetSelectedLayers():
@@ -847,7 +850,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
             self._giface.RunCmd(['r3.univar', 'map=%s' % ','.join(raster3d)])
 
     def OnReportStats(self, event):
-        """!Print 2D statistics"""
+        """Print 2D statistics"""
         rasters = []
         # TODO: Implement self.GetSelectedLayers(ltype='raster')
         for layer in self.GetSelectedLayers():
@@ -858,7 +861,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
             self._giface.RunCmd(['r.report', 'map=%s' % ','.join(rasters), 'units=h,c,p'])
         
     def OnStartEditing(self, event):
-        """!Start editing vector map layer requested by the user
+        """Start editing vector map layer requested by the user
         """
         mapLayer = self.GetLayerInfo(self.layer_selected, key = 'maplayer')
         if not haveVDigit:
@@ -886,7 +889,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
             self.RefreshLine(layerItem)
         
     def OnStopEditing(self, event):
-        """!Stop editing the current vector map layer
+        """Stop editing the current vector map layer
         """
         self.mapdisplay.toolbars['vdigit'].OnExit()
 
@@ -911,11 +914,11 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         self.RefreshLine(layerItem)
 
     def OnPopupProperties (self, event):
-        """!Popup properties dialog"""
+        """Popup properties dialog"""
         self.PropertiesDialog(self.layer_selected)
 
     def OnPopupOpacityLevel(self, event):
-        """!Popup opacity level indicator"""
+        """Popup opacity level indicator"""
         if not self.GetLayerInfo(self.layer_selected, key = 'ctrl'):
             return
         
@@ -933,9 +936,10 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         dlg.Destroy()
 
     def ChangeLayerOpacity(self, layer, value):
-        """!Change opacity value of layer
-        @param layer layer for which to change (item in layertree)
-        @param value opacity value (float between 0 and 1)
+        """Change opacity value of layer
+
+        :param layer: layer for which to change (item in layertree)
+        :param value: opacity value (float between 0 and 1)
         """
         maplayer = self.GetLayerInfo(layer, key = 'maplayer')
         self.Map.ChangeOpacity(maplayer, value)
@@ -956,9 +960,10 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         self.GetMapDisplay().GetWindow().UpdateMap(render = False, renderVector = renderVector)
 
     def OnNvizProperties(self, event):
-        """!Nviz-related properties (raster/vector/volume)
+        """Nviz-related properties (raster/vector/volume)
 
-        @todo vector/volume
+        .. todo::
+            vector/volume
         """
         self.lmgr.notebook.SetSelectionByName('nviz')
         ltype = self.GetLayerInfo(self.layer_selected, key = 'type')
@@ -970,12 +975,12 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
             self.lmgr.nviz.SetPage('volume')
         
     def OnRenameLayer (self, event):
-        """!Rename layer"""
+        """Rename layer"""
         self.EditLabel(self.layer_selected)
         self.GetEditControl().SetSelection(-1, -1)
         
     def OnRenamed(self, event):
-        """!Layer renamed"""
+        """Layer renamed"""
         if not event.GetLabel():
             event.Skip()
             return
@@ -988,18 +993,18 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
 
     def AddLayer(self, ltype, lname = None, lchecked = None,
                  lopacity = 1.0, lcmd = None, lgroup = None, lvdigit = None, lnviz = None, multiple = True):
-        """!Add new item to the layer tree, create corresponding MapLayer instance.
+        """Add new item to the layer tree, create corresponding MapLayer instance.
         Launch property dialog if needed (raster, vector, etc.)
 
-        @param ltype layer type (raster, vector, 3d-raster, ...)
-        @param lname layer name
-        @param lchecked if True layer is checked
-        @param lopacity layer opacity level
-        @param lcmd command (given as a list)
-        @param lgroup index of group item (-1 for root) or None
-        @param lvdigit vector digitizer settings (eg. geometry attributes)
-        @param lnviz layer Nviz properties
-        @param multiple True to allow multiple map layers in layer tree
+        :param ltype: layer type (raster, vector, 3d-raster, ...)
+        :param lname: layer name
+        :param lchecked: if True layer is checked
+        :param lopacity: layer opacity level
+        :param lcmd: command (given as a list)
+        :param lgroup: index of group item (-1 for root) or None
+        :param lvdigit: vector digitizer settings (eg. geometry attributes)
+        :param lnviz: layer Nviz properties
+        :param bool multiple: True to allow multiple map layers in layer tree
         """
         if lname and not multiple:
             # check for duplicates
@@ -1176,7 +1181,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         return layer
 
     def PropertiesDialog(self, layer, show = True):
-        """!Launch the properties dialog"""
+        """Launch the properties dialog"""
         ltype  = self.GetLayerInfo(layer, key = 'type')
         if 'propwin' in self.GetLayerInfo(layer) and \
                 self.GetLayerInfo(layer, key = 'propwin') is not None:
@@ -1222,7 +1227,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
                                                                     completed = (self.GetOptData,layer,params))
         
     def OnActivateLayer(self, event):
-        """!Double click on the layer item.
+        """Double click on the layer item.
         Launch property dialog, or expand/collapse group of items, etc.
         """
         self.lmgr.WorkspaceChanged()
@@ -1237,7 +1242,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
                 self.Expand(layer)
         
     def OnDeleteLayer(self, event):
-        """!Remove selected layer item from the layer tree"""
+        """Remove selected layer item from the layer tree"""
         self.lmgr.WorkspaceChanged()
         item = event.GetItem()
         
@@ -1280,7 +1285,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         event.Skip()
 
     def OnLayerChecking(self, event):
-        """!Layer checkbox is being checked.
+        """Layer checkbox is being checked.
 
         Continue only if mouse is above checkbox or layer was checked programatically.
         """
@@ -1291,7 +1296,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
             event.Veto()
 
     def OnLayerChecked(self, event):
-        """!Enable/disable data layer"""
+        """Enable/disable data layer"""
         self.lmgr.WorkspaceChanged()
         
         item    = event.GetItem()
@@ -1355,7 +1360,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         self.Map.SetLayers(self.GetVisibleLayers())
         
     def OnCmdChanged(self, event):
-        """!Change command string"""
+        """Change command string"""
         ctrl = event.GetEventObject().GetId()
         
         # find layer tree item by ctrl
@@ -1371,7 +1376,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         event.Skip()
 
     def OnMotion(self, event):
-        """!Mouse is moving.
+        """Mouse is moving.
 
         Detects if mouse points at checkbox.
         """
@@ -1386,7 +1391,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         event.Skip()
         
     def OnChangingSel(self, event):
-        """!Selection is changing.
+        """Selection is changing.
 
         If the user is clicking on checkbox, selection change is vetoed.
         """
@@ -1394,7 +1399,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
             event.Veto()
 
     def OnChangeSel(self, event):
-        """!Selection changed
+        """Selection changed
 
         Preconditions:
             event.GetItem() is a valid layer;
@@ -1504,7 +1509,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         self.SelectItem(newItem)
         
     def RecreateItem (self, dragItem, dropTarget, parent = None):
-        """!Recreate item (needed for OnEndDrag())
+        """Recreate item (needed for OnEndDrag())
         """
         Debug.msg (4, "LayerTree.RecreateItem(): layer=%s" % \
                    self.GetItemText(dragItem))
@@ -1583,9 +1588,9 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         return newItem
 
     def _getLayerName(self, item, lname = ''):
-        """!Get layer name string
+        """Get layer name string
 
-        @param lname optional layer name
+        :param lname: optional layer name
         """
         mapLayer = self.GetLayerInfo(item, key = 'maplayer')
         if not mapLayer:
@@ -1607,7 +1612,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         return lname
                 
     def GetOptData(self, dcmd, layer, params, propwin):
-        """!Process layer data (when changes in properties dialog are applied)
+        """Process layer data (when changes in properties dialog are applied)
         """
         # set layer text to map name
         if dcmd:
@@ -1708,7 +1713,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         return layers
 
     def ChangeLayer(self, item):
-        """!Change layer"""
+        """Change layer"""
         type = self.GetLayerInfo(item, key = 'type')
         layerName = None
         
@@ -1752,12 +1757,12 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         # self.Map.Clean()
 
     def FindItemByData(self, key, value):
-        """!Find item based on key and value (see PyData[0]).
+        """Find item based on key and value (see PyData[0]).
         
         If key is 'name', finds item(s) of given maplayer name.
         
-        @return item instance
-        @return None not found
+        :return: item instance
+        :return: None not found
         """
         item = self.GetFirstChild(self.root)[0]
         if key == 'name':
@@ -1766,10 +1771,10 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
             return self.__FindSubItemByData(item, key, value)
 
     def FindItemByIndex(self, index):
-        """!Find item by index (starting at 0)
+        """Find item by index (starting at 0)
 
-        @return item instance
-        @return None not found
+        :return: item instance
+        :return: None not found
         """
         item = self.GetFirstChild(self.root)[0]
         i = 0
@@ -1783,7 +1788,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         return None
     
     def EnableItemType(self, type, enable = True):
-        """!Enable/disable items in layer tree"""
+        """Enable/disable items in layer tree"""
         item = self.GetFirstChild(self.root)[0]
         while item and item.IsOk():
             mapLayer = self.GetLayerInfo(item, key = 'maplayer')
@@ -1793,7 +1798,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
             item = self.GetNextSibling(item)
         
     def __FindSubItemByData(self, item, key, value):
-        """!Support method for FindItemByData"""
+        """Support method for FindItemByData"""
         while item and item.IsOk():
             itemValue = self.GetLayerInfo(item, key = key)
             
@@ -1809,7 +1814,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         return None
 
     def __FindSubItemByName(self, item, value):
-        """!Support method for FindItemByData for searching by name"""
+        """Support method for FindItemByData for searching by name"""
         items = []
         while item and item.IsOk():
             try:
@@ -1831,7 +1836,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         return None
 
     def _createCommandCtrl(self):
-        """!Creates text control for command layer"""
+        """Creates text control for command layer"""
         height = 25
         if sys.platform in ('win32', 'darwin'):
             height = 40

+ 1 - 1
gui/wxpython/lmgr/menudata.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package lmgr.menudata
 
 @brief wxGUI Layer Manager - menu data

+ 9 - 8
gui/wxpython/lmgr/pyshell.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package lmgr.pyshell
 
 @brief wxGUI Interactive Python Shell for Layer Manager
@@ -6,8 +6,9 @@
 Classes:
  - pyshell::PyShellWindow
 
-@todo Run pyshell and evaluate code in a separate instance of python &
-design the widget communicate back and forth with it
+.. todo::
+    Run pyshell and evaluate code in a separate instance of python &
+    design the widget communicate back and forth with it
 
 (C) 2011 by the GRASS Development Team
 
@@ -27,7 +28,7 @@ import grass.script as grass
 from core.utils import _
 
 class PyShellWindow(wx.Panel):
-    """!Python Shell Window"""
+    """Python Shell Window"""
     def __init__(self, parent, id = wx.ID_ANY, **kwargs):
         self.parent = parent # GMFrame
         
@@ -74,10 +75,10 @@ class PyShellWindow(wx.Panel):
         self.Layout()
 
     def AddLayer(self, name, ltype = 'auto'):
-        """!Add selected map to the layer tree
+        """Add selected map to the layer tree
 
-        @param name name of raster/vector map to be added
-        @param type map type ('raster', 'vector', 'auto' for autodetection)
+        :param name: name of raster/vector map to be added
+        :param type: map type ('raster', 'vector', 'auto' for autodetection)
         """
         fname = None
         if ltype == 'raster' or ltype != 'vector':
@@ -107,7 +108,7 @@ class PyShellWindow(wx.Panel):
         return _('Vector map <%s> added') % fname
     
     def OnClear(self, event):
-        """!Delete all text from the shell
+        """Delete all text from the shell
         """
         self.shell.clear()
         self.shell.showIntro(self.intro)

+ 15 - 15
gui/wxpython/lmgr/toolbars.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package lmgr.toolbars
 
 @brief wxGUI Layer Manager - toolbars
@@ -28,7 +28,7 @@ from icons.icon         import MetaIcon
 from core.utils import _
 
 class LMWorkspaceToolbar(BaseToolbar):
-    """!Layer Manager `workspace` toolbar
+    """Layer Manager `workspace` toolbar
     """
     def __init__(self, parent):
         BaseToolbar.__init__(self, parent)
@@ -39,7 +39,7 @@ class LMWorkspaceToolbar(BaseToolbar):
         self.Realize()
 
     def _toolbarData(self):
-        """!Toolbar data
+        """Toolbar data
         """
         icons = {
             'newdisplay'    : MetaIcon(img = 'monitor-create',
@@ -63,7 +63,7 @@ class LMWorkspaceToolbar(BaseToolbar):
                                      ))
 
 class LMDataToolbar(BaseToolbar):
-    """!Layer Manager `data` toolbar
+    """Layer Manager `data` toolbar
     """
     def __init__(self, parent):
         BaseToolbar.__init__(self, parent)
@@ -74,7 +74,7 @@ class LMDataToolbar(BaseToolbar):
         self.Realize()
 
     def _toolbarData(self):
-        """!Toolbar data
+        """Toolbar data
         """
         icons = {
             'addMulti'   : MetaIcon(img = 'layer-open',
@@ -118,7 +118,7 @@ class LMDataToolbar(BaseToolbar):
                                      ))
 
 class LMToolsToolbar(BaseToolbar):
-    """!Layer Manager `tools` toolbar
+    """Layer Manager `tools` toolbar
     """
     def __init__(self, parent):
         BaseToolbar.__init__(self, parent)
@@ -129,7 +129,7 @@ class LMToolsToolbar(BaseToolbar):
         self.Realize()
 
     def _toolbarData(self):
-        """!Toolbar data
+        """Toolbar data
         """
         icons = {
             'import'  : MetaIcon(img = 'layer-import',
@@ -163,7 +163,7 @@ class LMToolsToolbar(BaseToolbar):
                                      ))
 
 class LMMiscToolbar(BaseToolbar):
-    """!Layer Manager `misc` toolbar
+    """Layer Manager `misc` toolbar
     """
     def __init__(self, parent):
         BaseToolbar.__init__(self, parent)
@@ -174,7 +174,7 @@ class LMMiscToolbar(BaseToolbar):
         self.Realize()
 
     def _toolbarData(self):
-        """!Toolbar data
+        """Toolbar data
         """
         icons = {
             'settings'   : BaseIcons['settings'].SetLabel(_('GUI settings')),
@@ -188,7 +188,7 @@ class LMMiscToolbar(BaseToolbar):
                                      ))
 
 class LMVectorToolbar(BaseToolbar):
-    """!Layer Manager `vector` toolbar
+    """Layer Manager `vector` toolbar
     """
     def __init__(self, parent):
         BaseToolbar.__init__(self, parent)
@@ -199,7 +199,7 @@ class LMVectorToolbar(BaseToolbar):
         self.Realize()
 
     def _toolbarData(self):
-        """!Toolbar data
+        """Toolbar data
         """
         icons = {
             'vdigit'     : MetaIcon(img = 'edit',
@@ -215,7 +215,7 @@ class LMVectorToolbar(BaseToolbar):
                                      ))
 
 class LMNvizToolbar(BaseToolbar):
-    """!Nviz toolbar
+    """Nviz toolbar
     """
     def __init__(self, parent):
         self.lmgr = parent
@@ -231,7 +231,7 @@ class LMNvizToolbar(BaseToolbar):
         self.Realize()
         
     def _toolbarData(self):
-        """!Toolbar data"""
+        """Toolbar data"""
         icons = {
             'cmd'    : MetaIcon(img = 'script-save',
                                 label = _('Generate command for m.nviz.image'),
@@ -253,11 +253,11 @@ class LMNvizToolbar(BaseToolbar):
                                     )
         
     def OnNvizCmd(self, event):
-        """!Show m.nviz.image command"""
+        """Show m.nviz.image command"""
         self.lmgr.GetLayerTree().GetMapDisplay().GetWindow().OnNvizCmd()
         
     def OnHelp(self, event):
-        """!Show 3D view mode help"""
+        """Show 3D view mode help"""
         if not self.lmgr:
             RunCommand('g.manual',
                        entry = 'wxGUI.Nviz')

+ 5 - 5
gui/wxpython/location_wizard/base.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package location_wizard.base
 
 @brief Location wizard - base classes
@@ -19,12 +19,12 @@ This program is free software under the GNU General Public License
 import wx
 
 class BaseClass(wx.Object):
-    """!Base class providing basic methods"""
+    """Base class providing basic methods"""
     def __init__(self):
         pass
 
     def MakeLabel(self, text = "", style = wx.ALIGN_LEFT, parent = None, tooltip = None):
-        """!Make aligned label"""
+        """Make aligned label"""
         if not parent:
             parent = self
         label =  wx.StaticText(parent = parent, id = wx.ID_ANY, label = text,
@@ -34,7 +34,7 @@ class BaseClass(wx.Object):
         return label
 
     def MakeTextCtrl(self, text = '', size = (100,-1), style = 0, parent = None, tooltip = None):
-        """!Generic text control"""
+        """Generic text control"""
         if not parent:
             parent = self
         textCtrl = wx.TextCtrl(parent = parent, id = wx.ID_ANY, value = text,
@@ -44,7 +44,7 @@ class BaseClass(wx.Object):
         return textCtrl
 
     def MakeButton(self, text, id = wx.ID_ANY, size = (-1,-1), parent = None, tooltip = None):
-        """!Generic button"""
+        """Generic button"""
         if not parent:
             parent = self
         button = wx.Button(parent = parent, id = id, label = text,

+ 12 - 12
gui/wxpython/location_wizard/dialogs.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package location_wizard.dialogs
 
 @brief Location wizard - dialogs
@@ -30,7 +30,7 @@ from location_wizard.base import BaseClass
 from grass.script import core as grass
 
 class RegionDef(BaseClass, wx.Dialog):
-    """!Page for setting default region extents and resolution
+    """Page for setting default region extents and resolution
     """
     def __init__(self, parent, id = wx.ID_ANY, size = (800, 600),
                  title = _("Set default region extent and resolution"), location = None):
@@ -208,7 +208,7 @@ class RegionDef(BaseClass, wx.Dialog):
         wx.CallAfter(self.settings3D.Collapse, True)
     
     def MakeSettings3DPaneContent(self, pane):
-        """!Create 3D region settings pane"""
+        """Create 3D region settings pane"""
         border = wx.BoxSizer(wx.VERTICAL)
         gridSizer = wx.GridBagSizer(vgap = 0, hgap = 0)
 
@@ -285,7 +285,7 @@ class RegionDef(BaseClass, wx.Dialog):
         border.Fit(pane)
 
     def OnSettings3DPaneChanged(self, event):
-        """!Collapse 3D settings box"""
+        """Collapse 3D settings box"""
 
         if self.settings3D.IsExpanded():
             self.settings3D.SetLabel(self.infoCollapseLabelCol)
@@ -301,7 +301,7 @@ class RegionDef(BaseClass, wx.Dialog):
         self.SendSizeEvent()
 
     def __DoLayout(self, panel):
-        """!Window layout"""
+        """Window layout"""
         frameSizer = wx.BoxSizer(wx.VERTICAL)
         gridSizer = wx.GridBagSizer(vgap = 0, hgap = 0)
         settings3DSizer = wx.BoxSizer(wx.VERTICAL)
@@ -405,7 +405,7 @@ class RegionDef(BaseClass, wx.Dialog):
         self.Layout()
 
     def OnValue(self, event):
-        """!Set given value"""
+        """Set given value"""
         try:
             if event.GetId() == self.tnorth.GetId():
                 self.north = float(event.GetString())
@@ -454,7 +454,7 @@ class RegionDef(BaseClass, wx.Dialog):
         event.Skip()
 
     def __UpdateInfo(self):
-        """!Update number of rows/cols/cells"""
+        """Update number of rows/cols/cells"""
         self.rows = int((self.north - self.south) / self.nsres)
         self.cols = int((self.east - self.west) / self.ewres)
         self.cells = self.rows * self.cols
@@ -471,7 +471,7 @@ class RegionDef(BaseClass, wx.Dialog):
         self.lcells3.SetLabel(_("3D Cells: %d" % self.cells3))
 
     def OnSetButton(self, event = None):
-        """!Set default region"""
+        """Set default region"""
         ret = RunCommand('g.region',
                          flags = 'sgpa',
                          n = self.north,
@@ -490,7 +490,7 @@ class RegionDef(BaseClass, wx.Dialog):
         self.Destroy()
 
 class TransList(wx.VListBox):
-    """!Creates a multiline listbox for selecting datum transforms"""
+    """Creates a multiline listbox for selecting datum transforms"""
         
     def OnDrawItem(self, dc, rect, n):
         if self.GetSelection() == n:
@@ -518,7 +518,7 @@ class TransList(wx.VListBox):
             return transitem
 
 class SelectTransformDialog(wx.Dialog):
-    """!Dialog for selecting datum transformations"""
+    """Dialog for selecting datum transformations"""
     def __init__(self, parent, transforms, title = _("Select datum transformation"),
                  pos = wx.DefaultPosition, size = wx.DefaultSize, 
                  style = wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER):
@@ -603,12 +603,12 @@ class SelectTransformDialog(wx.Dialog):
         self.Layout()
         
     def ClickTrans(self, event):
-        """!Get the number of the datum transform to use in g.proj"""
+        """Get the number of the datum transform to use in g.proj"""
         self.transnum = event.GetSelection()
         self.transnum = self.transnum - 1
     
     def GetTransform(self):
-        """!Get the number of the datum transform to use in g.proj"""
+        """Get the number of the datum transform to use in g.proj"""
         self.transnum = self.translist.GetSelection()
         self.transnum = self.transnum - 1
         return self.transnum

+ 56 - 56
gui/wxpython/location_wizard/wizard.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package location_wizard.wizard
 
 @brief Location wizard - creates a new GRASS Location. User can choose
@@ -59,7 +59,7 @@ global wizerror
 global translist
 
 class TitledPage(BaseClass, wiz.WizardPageSimple):
-    """!Class to make wizard pages. Generic methods to make labels,
+    """Class to make wizard pages. Generic methods to make labels,
     text entries, and buttons.
     """
     def __init__(self, parent, title):
@@ -75,7 +75,7 @@ class TitledPage(BaseClass, wiz.WizardPageSimple):
         self.sizer = wx.GridBagSizer(vgap = 0, hgap = 0)
         
     def DoLayout(self):
-        """!Do page layout"""
+        """Do page layout"""
         self.pagesizer.Add(item = self.title, proportion = 0,
                            flag = wx.ALIGN_CENTRE | wx.ALL,
                            border = 5)
@@ -90,7 +90,7 @@ class TitledPage(BaseClass, wiz.WizardPageSimple):
         self.Layout()
 
 class DatabasePage(TitledPage):
-    """!Wizard page for setting GIS data directory and location name"""
+    """Wizard page for setting GIS data directory and location name"""
     def __init__(self, wizard, parent, grassdatabase):
         TitledPage.__init__(self, wizard, _("Define GRASS Database and Location Name"))
 
@@ -163,7 +163,7 @@ class DatabasePage(TitledPage):
         GError(parent=self, message=message, caption=_("Invalid location name"))
 
     def OnChangeName(self, event):
-        """!Name for new location was changed"""
+        """Name for new location was changed"""
         nextButton = wx.FindWindowById(wx.ID_FORWARD)
         if len(event.GetString()) > 0:
             if not nextButton.IsEnabled():
@@ -174,7 +174,7 @@ class DatabasePage(TitledPage):
         event.Skip()
 
     def OnBrowse(self, event):
-        """!Choose GRASS data directory"""
+        """Choose GRASS data directory"""
         dlg = wx.DirDialog(self, _("Choose GRASS data directory:"),
                            os.getcwd(), wx.DD_DEFAULT_STYLE)
         if dlg.ShowModal() == wx.ID_OK:
@@ -208,7 +208,7 @@ class DatabasePage(TitledPage):
             self.locTitle = self.locTitle.split(os.linesep)[0][:255]
             
 class CoordinateSystemPage(TitledPage):
-    """!Wizard page for choosing method for location creation"""
+    """Wizard page for choosing method for location creation"""
     def __init__(self, wizard, parent):
         TitledPage.__init__(self, wizard, _("Choose method for creating a new location"))
         
@@ -302,7 +302,7 @@ class CoordinateSystemPage(TitledPage):
             wx.FindWindowById(wx.ID_FORWARD).Enable()
     
     def SetVal(self, event):
-        """!Choose method"""
+        """Choose method"""
         global coordsys
         if event.GetId() == self.radio1.GetId():
             coordsys = "proj"
@@ -330,7 +330,7 @@ class CoordinateSystemPage(TitledPage):
             self.parent.sumpage.SetPrev(self.parent.csystemspage)
 
 class ProjectionsPage(TitledPage):
-    """!Wizard page for selecting projection (select coordinate system option)"""
+    """Wizard page for selecting projection (select coordinate system option)"""
     def __init__(self, wizard, parent):
         TitledPage.__init__(self, wizard, _("Choose projection"))
 
@@ -387,7 +387,7 @@ class ProjectionsPage(TitledPage):
             event.Veto()
 
     def OnText(self, event):
-        """!Projection name changed"""
+        """Projection name changed"""
         self.proj = event.GetString().lower()
         self.p4proj = ''
         nextButton = wx.FindWindowById(wx.ID_FORWARD)
@@ -421,7 +421,7 @@ class ProjectionsPage(TitledPage):
         event.Skip()
     
     def OnSearch(self, event):
-        """!Search projection by desc"""
+        """Search projection by desc"""
         str = event.GetString()
         try:
             self.proj, self.projdesc = self.projlist.Search(index = [0,1], pattern = event.GetString())
@@ -431,7 +431,7 @@ class ProjectionsPage(TitledPage):
         event.Skip()
 
     def OnItemSelected(self, event):
-        """!Projection selected"""
+        """Projection selected"""
         index = event.m_itemIndex
 
         # set values
@@ -443,7 +443,7 @@ class ProjectionsPage(TitledPage):
 class ItemList(wx.ListCtrl,
                listmix.ListCtrlAutoWidthMixin,
                listmix.ColumnSorterMixin):
-    """!Generic list (for projections, ellipsoids, etc.)"""
+    """Generic list (for projections, ellipsoids, etc.)"""
 
     def __init__(self, parent, columns, data = None):
         wx.ListCtrl.__init__(self, parent = parent, id = wx.ID_ANY,
@@ -505,7 +505,7 @@ class ItemList(wx.ListCtrl,
         self.Bind(wx.EVT_LIST_COL_CLICK, self.OnColumnClick)
 
     def Populate(self, data = None, update = False):
-        """!Populate list"""
+        """Populate list"""
         self.itemDataMap  = {}
         self.itemIndexMap = []
         
@@ -539,7 +539,7 @@ class ItemList(wx.ListCtrl,
                           caption = _("Error"), style = wx.OK | wx.ICON_ERROR)
 
     def OnColumnClick(self, event):
-        """!Sort by column"""
+        """Sort by column"""
         self._col = event.GetColumn()
 
         # remove duplicated arrow symbol from column header
@@ -554,17 +554,17 @@ class ItemList(wx.ListCtrl,
         event.Skip()
 
     def GetSortImages(self):
-        """!Used by the ColumnSorterMixin, see wx/lib/mixins/listctrl.py"""
+        """Used by the ColumnSorterMixin, see wx/lib/mixins/listctrl.py"""
         return (self.sm_dn, self.sm_up)
 
     def OnGetItemText(self, item, col):
-        """!Get item text"""
+        """Get item text"""
         index = self.itemIndexMap[item]
         s = str(self.itemDataMap[index][col])
         return s
 
     def OnGetItemAttr(self, item):
-        """!Get item attributes"""
+        """Get item attributes"""
         index = self.itemIndexMap[item]
         if ( index % 2) == 0:
             return self.attr2
@@ -572,7 +572,7 @@ class ItemList(wx.ListCtrl,
             return self.attr1
 
     def SortItems(self, sorter = cmp):
-        """!Sort items"""
+        """Sort items"""
         items = list(self.itemDataMap.keys())
         items.sort(self.Sorter)
         self.itemIndexMap = items
@@ -603,11 +603,11 @@ class ItemList(wx.ListCtrl,
             return -cmpVal
 
     def GetListCtrl(self):
-        """!Used by listmix.ColumnSorterMixin"""
+        """Used by listmix.ColumnSorterMixin"""
         return self
 
     def Search (self, index, pattern):
-        """!Search projection by description
+        """Search projection by description
         Return first found item or None
         """
         if pattern == '':
@@ -634,7 +634,7 @@ class ItemList(wx.ListCtrl,
             return []
 
 class ProjParamsPage(TitledPage):
-    """!Wizard page for selecting method of setting coordinate system
+    """Wizard page for selecting method of setting coordinate system
     parameters (select coordinate system option)
     """
     def __init__(self, wizard, parent):
@@ -682,7 +682,7 @@ class ProjParamsPage(TitledPage):
         self.Bind(wiz.EVT_WIZARD_PAGE_CHANGED, self.OnEnterPage)
         
     def OnParamEntry(self, event):
-        """!Parameter value changed"""
+        """Parameter value changed"""
         id  = event.GetId()
         val = event.GetString()
         
@@ -707,7 +707,7 @@ class ProjParamsPage(TitledPage):
         event.Skip()
         
     def OnPageChange(self,event=None):
-        """!Go to next page"""
+        """Go to next page"""
         if event.GetDirection():
             self.p4projparams = ''
             for id, param in self.pparam.iteritems():
@@ -726,7 +726,7 @@ class ProjParamsPage(TitledPage):
                         self.p4projparams += (' +' + param['proj4'] + '=' + str(param['value']))
 
     def OnEnterPage(self,event):
-        """!Page entered"""
+        """Page entered"""
         self.projdesc = self.parent.projections[self.parent.projpage.proj][0]
         if self.prjParamSizer is None:
             # entering page for the first time
@@ -813,7 +813,7 @@ class ProjParamsPage(TitledPage):
         event.Skip()
 
     def SetVal(self, event):
-        """!Set value"""
+        """Set value"""
         if event.GetId() == self.radio1.GetId():
             self.SetNext(self.parent.datumpage)
             self.parent.sumpage.SetPrev(self.parent.datumpage)
@@ -822,7 +822,7 @@ class ProjParamsPage(TitledPage):
             self.parent.sumpage.SetPrev(self.parent.ellipsepage)
     
 class DatumPage(TitledPage):
-    """!Wizard page for selecting datum (with associated ellipsoid)
+    """Wizard page for selecting datum (with associated ellipsoid)
     and datum transformation parameters (select coordinate system option)
     """
 
@@ -940,7 +940,7 @@ class DatumPage(TitledPage):
         event.Skip()
 
     def OnDText(self, event):
-        """!Datum code changed"""
+        """Datum code changed"""
         self.datum = event.GetString()
 
         nextButton = wx.FindWindowById(wx.ID_FORWARD)
@@ -969,7 +969,7 @@ class DatumPage(TitledPage):
         event.Skip()
 
     def OnDSearch(self, event):
-        """!Search geodetic datum by desc"""
+        """Search geodetic datum by desc"""
         str =  self.searchb.GetValue()
         try:
             self.datum, self.ellipsoid, self.datumdesc = self.datumlist.Search(index = [0,1,2], pattern = str)
@@ -979,7 +979,7 @@ class DatumPage(TitledPage):
         event.Skip()
 
     def OnDatumSelected(self, event):
-        """!Datum selected"""
+        """Datum selected"""
         index = event.m_itemIndex
         item = event.GetItem()
 
@@ -989,7 +989,7 @@ class DatumPage(TitledPage):
         event.Skip()
 
 class EllipsePage(TitledPage):
-    """!Wizard page for selecting ellipsoid (select coordinate system option)"""
+    """Wizard page for selecting ellipsoid (select coordinate system option)"""
 
     def __init__(self, wizard, parent):
         TitledPage.__init__(self, wizard, _("Specify ellipsoid"))
@@ -1093,7 +1093,7 @@ class EllipsePage(TitledPage):
 
     #FIXME: index number doesn't translate when you've given a valid name from the other list
     def OnText(self, event):
-        """!Ellipspoid code changed"""
+        """Ellipspoid code changed"""
         self.ellipse = event.GetString()
         nextButton = wx.FindWindowById(wx.ID_FORWARD)
         if len(self.ellipse) == 0 or \
@@ -1114,7 +1114,7 @@ class EllipsePage(TitledPage):
         #print self.ellipse, self.ellipsedesc, self.ellipseparams
 
     def OnSearch(self, event):
-        """!Search ellipsoid by desc"""
+        """Search ellipsoid by desc"""
         try:
             self.ellipse, self.ellipsedesc = \
                 self.ellipselist.Search(index=[0,1], pattern=event.GetString())
@@ -1128,7 +1128,7 @@ class EllipsePage(TitledPage):
         event.Skip()
 
     def OnItemSelected(self,event):
-        """!Ellipsoid selected"""
+        """Ellipsoid selected"""
         index = event.m_itemIndex
         item = event.GetItem()
 
@@ -1138,7 +1138,7 @@ class EllipsePage(TitledPage):
         event.Skip()
 
     def SetVal(self, event):
-        """!Choose table to use"""
+        """Choose table to use"""
         self.ellipselist.DeleteAllItems()
         data = []
         if event.GetId() == self.radio1.GetId():
@@ -1154,7 +1154,7 @@ class EllipsePage(TitledPage):
 
 
 class GeoreferencedFilePage(TitledPage):
-    """!Wizard page for selecting georeferenced file to use
+    """Wizard page for selecting georeferenced file to use
     for setting coordinate system parameters"""
 
     def __init__(self, wizard, parent):
@@ -1203,7 +1203,7 @@ class GeoreferencedFilePage(TitledPage):
         event.Skip()
 
     def OnText(self, event):
-        """!File changed"""
+        """File changed"""
         self.georeffile = event.GetString()
         nextButton = wx.FindWindowById(wx.ID_FORWARD)
         if len(self.georeffile) > 0 and os.path.isfile(self.georeffile):
@@ -1216,7 +1216,7 @@ class GeoreferencedFilePage(TitledPage):
         event.Skip()
 
     def OnBrowse(self, event):
-        """!Choose file"""
+        """Choose file"""
         dlg = wx.FileDialog(self,
                             _("Select georeferenced file"),
                             os.getcwd(), "", "*.*", wx.OPEN)
@@ -1228,7 +1228,7 @@ class GeoreferencedFilePage(TitledPage):
         event.Skip()
 
 class WKTPage(TitledPage):
-    """!Wizard page for selecting WKT file to use
+    """Wizard page for selecting WKT file to use
     for setting coordinate system parameters"""
 
     def __init__(self, wizard, parent):
@@ -1274,7 +1274,7 @@ class WKTPage(TitledPage):
         event.Skip()
 
     def OnText(self, event):
-        """!File changed"""
+        """File changed"""
         self.wktfile = event.GetString()
         nextButton = wx.FindWindowById(wx.ID_FORWARD)
         if len(self.wktfile) > 0 and os.path.isfile(self.wktfile):
@@ -1287,7 +1287,7 @@ class WKTPage(TitledPage):
         event.Skip()
 
     def OnBrowse(self, event):
-        """!Choose file"""
+        """Choose file"""
         dlg = wx.FileDialog(parent = self,
                             message = _("Select Well Known Text (WKT) .prj file"),
                             defaultDir = os.getcwd(),
@@ -1302,7 +1302,7 @@ class WKTPage(TitledPage):
         event.Skip()
 
 class EPSGPage(TitledPage):
-    """!Wizard page for selecting EPSG code for
+    """Wizard page for selecting EPSG code for
     setting coordinate system parameters"""
 
     def __init__(self, wizard, parent):
@@ -1463,7 +1463,7 @@ class EPSGPage(TitledPage):
         event.Skip()
         
     def OnBrowse(self, event):
-        """!Define path for EPSG code file"""
+        """Define path for EPSG code file"""
         path = os.path.dirname(self.tfile.GetValue())
         if not path:
             path = os.getcwd()
@@ -1481,7 +1481,7 @@ class EPSGPage(TitledPage):
         event.Skip()
 
     def OnItemSelected(self, event):
-        """!EPSG code selected from the list"""
+        """EPSG code selected from the list"""
         index = event.m_itemIndex
         item = event.GetItem()
 
@@ -1492,7 +1492,7 @@ class EPSGPage(TitledPage):
         event.Skip()
         
     def OnBrowseCodes(self, event, search = None):
-        """!Browse EPSG codes"""
+        """Browse EPSG codes"""
         self.epsgCodeDict = utils.ReadEpsgCodes(self.tfile.GetValue())
 
         if type(self.epsgCodeDict) != dict:
@@ -1510,7 +1510,7 @@ class EPSGPage(TitledPage):
         self.epsglist.Populate(data, update = True)
         
 class CustomPage(TitledPage):
-    """!Wizard page for entering custom PROJ.4 string
+    """Wizard page for entering custom PROJ.4 string
     for setting coordinate system parameters"""
 
     def __init__(self, wizard, parent):
@@ -1603,7 +1603,7 @@ class CustomPage(TitledPage):
         self.GetNext().SetPrev(self)
             
     def GetProjstring(self, event):
-        """!Change proj string"""
+        """Change proj string"""
         # TODO: check PROJ.4 syntax
         self.customstring = event.GetString()
         nextButton = wx.FindWindowById(wx.ID_FORWARD)
@@ -1615,7 +1615,7 @@ class CustomPage(TitledPage):
                 nextButton.Enable()
 
 class SummaryPage(TitledPage):
-    """!Shows summary result of choosing coordinate system parameters
+    """Shows summary result of choosing coordinate system parameters
     prior to creating location"""
     def __init__(self, wizard, parent):
         TitledPage.__init__(self, wizard, _("Summary"))
@@ -1638,7 +1638,7 @@ class SummaryPage(TitledPage):
         self._doLayout()
         
     def _doLayout(self):
-        """!Do page layout"""
+        """Do page layout"""
 
         titleSizer = wx.BoxSizer(wx.VERTICAL)
         titleSizer.Add(item = self.llocTitle, proportion = 1,
@@ -1695,7 +1695,7 @@ class SummaryPage(TitledPage):
         self.sizer.AddGrowableRow(5, 5)
    
     def OnEnterPage(self, event):
-        """!Insert values into text controls for summary of location
+        """Insert values into text controls for summary of location
         creation options
         """
         database = self.parent.startpage.grassdatabase
@@ -1798,7 +1798,7 @@ class SummaryPage(TitledPage):
             event.Skip()
 
 class LocationWizard(wx.Object):
-    """!Start wizard here and finish wizard here
+    """Start wizard here and finish wizard here
     """
     def __init__(self, parent, grassdatabase):
         self.__cleanUp()
@@ -1955,7 +1955,7 @@ class LocationWizard(wx.Object):
         transformlist = list()
 
     def __readData(self):
-        """!Get georeferencing information from tables in $GISBASE/etc/proj"""
+        """Get georeferencing information from tables in $GISBASE/etc/proj"""
 
         # read projection and parameters
         f = open(os.path.join(globalvar.ETCDIR, "proj", "parms.table"), "r")
@@ -2042,10 +2042,10 @@ class LocationWizard(wx.Object):
         f.close()
 
     def OnWizFinished(self):
-        """!Wizard finished, create new location
+        """Wizard finished, create new location
 
-        @return error message on error
-        @return None on success
+        :return: error message on error
+        :return: None on success
         """
         database = self.startpage.grassdatabase
         location = self.startpage.location
@@ -2142,7 +2142,7 @@ class LocationWizard(wx.Object):
         return None
     
     def CreateProj4String(self):
-        """!Constract PROJ.4 string"""
+        """Constract PROJ.4 string"""
         location = self.startpage.location
         proj = self.projpage.p4proj
         projdesc = self.projpage.projdesc

+ 90 - 89
gui/wxpython/mapdisp/frame.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package mapdisp.frame
 
 @brief Map display with toolbar for various display management
@@ -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
@@ -64,24 +63,24 @@ from grass.pydispatch.signal import Signal
 
 
 class MapFrame(SingleMapFrame):
-    """!Main frame for map display window. Drawing takes place in
+    """Main frame for map display window. Drawing takes place in
     child double buffered drawing window.
     """
     def __init__(self, parent, giface, title = _("GRASS GIS - Map display"),
                  toolbars = ["map"], tree = None, notebook = None, lmgr = None,
                  page = None, Map = Map(), auimgr = None, name = 'MapWindow', **kwargs):
-        """!Main map display window with toolbars, statusbar and
+        """Main map display window with toolbars, statusbar and
         2D map window, 3D map window and digitizer.
         
-        @param toolbars array of activated toolbars, e.g. ['map', 'digit']
-        @param tree reference to layer tree
-        @param notebook control book ID in Layer Manager
-        @param lmgr Layer Manager
-        @param page notebook page with layer tree
-        @param Map instance of render.Map
-        @param auimgs AUI manager
-        @param name frame name
-        @param kwargs wx.Frame attributes
+        :param toolbars: array of activated toolbars, e.g. ['map', 'digit']
+        :param tree: reference to layer tree
+        :param notebook: control book ID in Layer Manager
+        :param lmgr: Layer Manager
+        :param page: notebook page with layer tree
+        :param map: instance of render.Map
+        :param auimgs: AUI manager
+        :param name: frame name
+        :param kwargs: wx.Frame attributes
         """
         SingleMapFrame.__init__(self, parent = parent, title = title,
                               Map = Map, auimgr = auimgr, name = name, **kwargs)
@@ -242,7 +241,7 @@ class MapFrame(SingleMapFrame):
         return self.MapWindow
 
     def SetTitleNumber(self, displayId=1):
-        """!Set map display title"""
+        """Set map display title"""
         try:
             grassVersion = grass.version()['version']
         except KeyError:
@@ -259,7 +258,7 @@ class MapFrame(SingleMapFrame):
         self.SetTitle(title)
 
     def _addToolbarVDigit(self):
-        """!Add vector digitizer toolbar
+        """Add vector digitizer toolbar
         """
         from vdigit.main import haveVDigit, VDigit
         
@@ -319,7 +318,7 @@ class MapFrame(SingleMapFrame):
         self.MapWindow.polypen      = wx.Pen(colour = 'green', width = 2, style = wx.SOLID)
 
     def AddNviz(self):
-        """!Add 3D view mode window
+        """Add 3D view mode window
         """
         from nviz.main import haveNviz, GLWindow, errorMsg
         
@@ -414,7 +413,7 @@ class MapFrame(SingleMapFrame):
             self.toolbars['map'].combo.Delete(1)
 
     def RemoveNviz(self):
-        """!Restore 2D view"""
+        """Restore 2D view"""
         try:
             self.toolbars['map'].RemoveTool(self.toolbars['map'].rotate)
             self.toolbars['map'].RemoveTool(self.toolbars['map'].flyThrough)
@@ -454,14 +453,14 @@ class MapFrame(SingleMapFrame):
         self.GetMapToolbar().SelectDefault()
         
     def AddToolbar(self, name, fixed = False):
-        """!Add defined toolbar to the window
+        """Add defined toolbar to the window
 
         Currently recognized toolbars are:
          - 'map'     - basic map toolbar
          - 'vdigit'  - vector digitizer
 
-        @param name toolbar to add
-        @param fixed fixed toolbar
+        :param name: toolbar to add
+        :param fixed: fixed toolbar
         """
         # default toolbar
         if name == "map":
@@ -487,9 +486,10 @@ class MapFrame(SingleMapFrame):
         self._mgr.Update()
         
     def RemoveToolbar (self, name):
-        """!Removes defined toolbar from the window
+        """Removes defined toolbar from the window
 
-        @todo Only hide, activate by calling AddToolbar()
+        .. todo::
+            Only hide, activate by calling AddToolbar()
         """
         # cannot hide main toolbar
         if name == "map":
@@ -511,19 +511,19 @@ class MapFrame(SingleMapFrame):
         self._mgr.Update()
     
     def IsPaneShown(self, name):
-        """!Check if pane (toolbar, mapWindow ...) of given name is currently shown"""
+        """Check if pane (toolbar, mapWindow ...) of given name is currently shown"""
         if self._mgr.GetPane(name).IsOk():
             return self._mgr.GetPane(name).IsShown()
         return False
 
     def RemoveQueryLayer(self):
-        """!Removes temporary map layers (queries)"""
+        """Removes temporary map layers (queries)"""
         qlayer = self.GetMap().GetListOfLayers(name = globalvar.QUERYLAYER)
         for layer in qlayer:
             self.GetMap().DeleteLayer(layer)
 
     def OnRender(self, event):
-        """!Re-render map composition (each map layer)
+        """Re-render map composition (each map layer)
         """
         self.RemoveQueryLayer()
         
@@ -539,8 +539,8 @@ class MapFrame(SingleMapFrame):
         self.StatusbarUpdate()
 
     def OnPointer(self, event):
-        """!Pointer button clicked
-        """        
+        """Pointer button clicked
+        """      
         self.MapWindow.SetModePointer()
 
         if self.GetToolbar('vdigit'):
@@ -548,7 +548,7 @@ class MapFrame(SingleMapFrame):
             self.toolbars['vdigit'].action['desc']=''
 
     def OnRotate(self, event):
-        """!Rotate 3D view
+        """Rotate 3D view
         """
         self.MapWindow.mouse['use'] = "rotate"
         
@@ -556,7 +556,7 @@ class MapFrame(SingleMapFrame):
         self.MapWindow.SetNamedCursor('hand')
 
     def OnFlyThrough(self, event):
-        """!Fly-through mode
+        """Fly-through mode
         """
         self.MapWindow.mouse['use'] = "fly"
         
@@ -565,7 +565,7 @@ class MapFrame(SingleMapFrame):
         self.MapWindow.SetFocus()
 
     def SaveToFile(self, event):
-        """!Save map to image
+        """Save map to image
         """
         filetype, ltype = self._prepareSaveToFile()
         if not ltype:
@@ -605,7 +605,7 @@ class MapFrame(SingleMapFrame):
         dlg.Destroy()
 
     def DOutFile(self, command):
-        """!Saves map to image by running d.out.file from gui or d.mon.
+        """Saves map to image by running d.out.file from gui or d.mon.
         Command is expected to be validated by parser.        
         """
         filetype, ltype = self._prepareSaveToFile()
@@ -641,7 +641,7 @@ class MapFrame(SingleMapFrame):
         self.MapWindow.SaveToFile(name, bitmapType, int(width), int(height))
 
     def DOutFileOptData(self, dcmd, layer, params, propwin):
-        """!Dummy function which is called when d.out.file is called
+        """Dummy function which is called when d.out.file is called
         and returns parsed and validated command which is then passed
         to DOutFile method."""
         if not dcmd:
@@ -720,7 +720,7 @@ class MapFrame(SingleMapFrame):
         self.DToRast(dcmd)
 
     def _prepareSaveToFile(self):
-        """!Get wildcards and format extensions."""
+        """Get wildcards and format extensions."""
         if self.IsPaneShown('3d'):
             filetype = "TIF file (*.tif)|*.tif|PPM file (*.ppm)|*.ppm"
             ltype = [{ 'ext' : 'tif', 'type' : 'tif' },
@@ -758,7 +758,7 @@ class MapFrame(SingleMapFrame):
         printmenu.Destroy()
 
     def OnCloseWindow(self, event):
-        """!Window closed.
+        """Window closed.
         Also close associated layer tree page
         """
         Debug.msg(2, "MapFrame.OnCloseWindow(): function starts")
@@ -782,10 +782,9 @@ class MapFrame(SingleMapFrame):
         Debug.msg(2, "MapFrame.OnCloseWindow(): function ends")
 
     def Query(self, x, y):
-        """!Query selected layers. 
+        """Query selected layers. 
 
-        @param x,y coordinates
-        @param layers selected tree item layers
+        :param x,y: coordinates
         """
         if self._vectQueryLayers or self._rastQueryLayers:
             rast = self._rastQueryLayers
@@ -840,7 +839,7 @@ class MapFrame(SingleMapFrame):
                 self.QueryMap(east, north, qdist, rast = [], vect = vect)
 
     def SetQueryLayersAndActivate(self, ltype, maps):
-        """!Activate query mode and set layers to query.
+        """Activate query mode and set layers to query.
         This method is used for querying in d.mon using d.what.rast/vect"""
         self.toolbars['map'].SelectTool(self.toolbars['map'].query)
         if ltype == 'vect':
@@ -849,12 +848,12 @@ class MapFrame(SingleMapFrame):
             self._rastQueryLayers = maps
 
     def QueryMap(self, east, north, qdist, rast, vect):
-        """!Query raster or vector map layers by r/v.what
+        """Query raster or vector map layers by r/v.what
         
-        @param east,north coordinates
-        @param qdist query distance
-        @param rast raster map names
-        @param vect vector map names
+        :param east,north: coordinates
+        :param qdist: query distance
+        :param rast: raster map names
+        :param vect: vector map names
         """
         Debug.msg(1, "QueryMap(): raster=%s vector=%s" % (','.join(rast),
                                                           ','.join(vect)))
@@ -868,7 +867,9 @@ class MapFrame(SingleMapFrame):
         if rast:
             rastQuery = grass.raster_what(map=rast, coord=(east, north))
         if vect:
-            vectQuery = grass.vector_what(map=vect, coord=(east, north), distance=qdist)
+            encoding = UserSettings.Get(group='atm', key='encoding', subkey='value')
+            vectQuery = grass.vector_what(map=vect, coord=(east, north), distance=qdist,
+                                          encoding=encoding)
         self._QueryMapDone()
         if 'Id' in vectQuery:
             self._queryHighlight(vectQuery)
@@ -891,14 +892,14 @@ class MapFrame(SingleMapFrame):
         event.Skip()
 
     def _onRedirectQueryOutput(self, output, style='log'):
-        """!Writes query output into console"""
+        """Writes query output into console"""
         if style == 'log':
             self._giface.WriteLog(output, notification=Notification.MAKE_VISIBLE)
         elif style == 'cmd':
             self._giface.WriteCmdLog(output)
 
     def _queryHighlight(self, vectQuery):
-        """!Highlight category from query."""
+        """Highlight category from query."""
         cats = name = None
         for res in vectQuery:
             cats = {res['Layer']: [res['Category']]}
@@ -931,7 +932,7 @@ class MapFrame(SingleMapFrame):
             self.MapWindow.UpdateMap(render = False, renderVector = False)
 
     def _QueryMapDone(self):
-        """!Restore settings after querying (restore GRASS_REGION)
+        """Restore settings after querying (restore GRASS_REGION)
         """
         if hasattr(self, "tmpreg"):
             if self.tmpreg:
@@ -945,7 +946,7 @@ class MapFrame(SingleMapFrame):
             del self.tmpreg
         
     def OnQuery(self, event):
-        """!Query tools menu"""
+        """Query tools menu"""
         self.MapWindow.mouse['use'] = "query"
         self.MapWindow.mouse['box'] = "point"
         self.MapWindow.zoomtype = 0
@@ -954,10 +955,10 @@ class MapFrame(SingleMapFrame):
         self.MapWindow.SetNamedCursor('cross')
         
     def AddTmpVectorMapLayer(self, name, cats, useId = False, addLayer = True):
-        """!Add temporal vector map layer to map composition
+        """Add temporal vector map layer to map composition
 
-        @param name name of map layer
-        @param useId use feature id instead of category 
+        :param name: name of map layer
+        :param useId: use feature id instead of category 
         """
         # color settings from ATM
         color = UserSettings.Get(group = 'atm', key = 'highlight', subkey = 'color')
@@ -1015,9 +1016,9 @@ class MapFrame(SingleMapFrame):
         self._onMeasure(MeasureAreaController)
 
     def _onMeasure(self, controller):
-        """!Starts measurement mode.
+        """Starts measurement mode.
 
-        @param controller measurement class (MeasureDistanceController, MeasureAreaController)
+        :param controller: measurement class (MeasureDistanceController, MeasureAreaController)
         """
         self.measureController = controller(self._giface, mapWindow=self.GetMapWindow())
         # assure that the mode is ended and lines are cleared whenever other tool is selected
@@ -1025,7 +1026,7 @@ class MapFrame(SingleMapFrame):
         self.measureController.Start()
 
     def OnProfile(self, event):
-        """!Launch profile tool
+        """Launch profile tool
         """
         rasters = []
         layers = self._giface.GetLayerList().GetSelectedLayers()
@@ -1035,7 +1036,7 @@ class MapFrame(SingleMapFrame):
         self.Profile(rasters=rasters)
 
     def Profile(self, rasters=None):
-        """!Launch profile tool"""
+        """Launch profile tool"""
         self.profileController = ProfileController(self._giface,
                                                    mapWindow=self.GetMapWindow())
         win = ProfileFrame(parent=self, rasterList=rasters,
@@ -1047,7 +1048,7 @@ class MapFrame(SingleMapFrame):
         win.OnSelectRaster(None)
 
     def OnHistogramPyPlot(self, event):
-        """!Init PyPlot histogram display canvas and tools
+        """Init PyPlot histogram display canvas and tools
         """
         raster = []
 
@@ -1060,7 +1061,7 @@ class MapFrame(SingleMapFrame):
         win.Show()
         
     def OnScatterplot(self, event):
-        """!Init PyPlot scatterplot display canvas and tools
+        """Init PyPlot scatterplot display canvas and tools
         """
         raster = []
 
@@ -1077,7 +1078,7 @@ class MapFrame(SingleMapFrame):
         win.OnSelectRaster(None)
 
     def OnHistogram(self, event):
-        """!Init histogram display canvas and tools
+        """Init histogram display canvas and tools
         """
         win = HistogramFrame(self, giface=self._giface)
         
@@ -1087,9 +1088,9 @@ class MapFrame(SingleMapFrame):
         win.Update()
 
     def _activateOverlay(self, overlayId):
-        """!Launch decoration dialog according to overlay id.
+        """Launch decoration dialog according to overlay id.
 
-        @param overlayId id of overlay        
+        :param overlayId: id of overlay        
         """
         if overlayId > 100:
             self.OnAddText(None)
@@ -1101,14 +1102,14 @@ class MapFrame(SingleMapFrame):
             self.AddArrow(showDialog=True)
 
     def _hideOverlay(self, overlayId):
-        """!Hide overlay.
+        """Hide overlay.
 
-        @param overlayId id of overlay        
+        :param overlayId: id of overlay        
         """
         self.decorations[overlayId].Hide()
 
     def AddBarscale(self, cmd=None, showDialog=None):
-        """!Handler for scale bar map decoration menu selection."""
+        """Handler for scale bar map decoration menu selection."""
         if self.IsPaneShown('3d'):
             self.MapWindow3D.SetDrawScalebar((70, 70))
             return
@@ -1147,7 +1148,7 @@ class MapFrame(SingleMapFrame):
         self.MapWindow.mouse['use'] = 'pointer'
 
     def AddLegend(self, cmd=None, showDialog=None):
-        """!Handler for legend map decoration menu selection."""
+        """Handler for legend map decoration menu selection."""
         if self.legend.IsShown() and showDialog is None:
             self.legend.Hide()
             return
@@ -1197,7 +1198,7 @@ class MapFrame(SingleMapFrame):
         self.MapWindow.mouse['use'] = 'pointer'
 
     def AddArrow(self, cmd=None, showDialog=None):
-        """!Handler for north arrow menu selection."""
+        """Handler for north arrow menu selection."""
         if self.IsPaneShown('3d'):
             # here was opening of appearance page of nviz notebook
             # but now moved to MapWindow3D where are other problematic nviz calls
@@ -1229,7 +1230,7 @@ class MapFrame(SingleMapFrame):
         self.MapWindow.mouse['use'] = 'pointer'
 
     def OnAddText(self, event):
-        """!Handler for text decoration menu selection.
+        """Handler for text decoration menu selection.
         """
         if self.MapWindow.dragid > -1:
             id = self.MapWindow.dragid
@@ -1280,7 +1281,7 @@ class MapFrame(SingleMapFrame):
         self.MapWindow.mouse['use'] = 'pointer'
         
     def GetOptData(self, dcmd, type, params, propwin):
-        """!Callback method for decoration overlay command generated by
+        """Callback method for decoration overlay command generated by
         dialog created in menuform.py
         """
         # Reset comand and rendering options in render.Map. Always render decoration.
@@ -1291,7 +1292,7 @@ class MapFrame(SingleMapFrame):
         self.propwin[type] = propwin
 
     def OnZoomToMap(self, event):
-        """!Set display extents to match selected raster (including
+        """Set display extents to match selected raster (including
         NULLs) or vector map.
         """
         Debug.msg(3, "MapFrame.OnZoomToMap()")
@@ -1302,44 +1303,44 @@ class MapFrame(SingleMapFrame):
         self.MapWindow.ZoomToMap(layers = layers)
 
     def OnZoomToRaster(self, event):
-        """!Set display extents to match selected raster map (ignore NULLs)
+        """Set display extents to match selected raster map (ignore NULLs)
         """
         self.MapWindow.ZoomToMap(ignoreNulls = True)
         
     def OnZoomToSaved(self, event):
-        """!Set display geometry to match extents in
+        """Set display geometry to match extents in
         saved region file
         """
         self.MapWindow.SetRegion(zoomOnly=True)
         
     def OnSetDisplayToWind(self, event):
-        """!Set computational region (WIND file) to match display
+        """Set computational region (WIND file) to match display
         extents
         """
         self.MapWindow.DisplayToWind()
 
     def OnSetWindToRegion(self, event):
-        """!Set computational region (WIND file) from named region
+        """Set computational region (WIND file) from named region
         file
         """
         self.MapWindow.SetRegion(zoomOnly=False)
  
     def OnSetExtentToWind(self, event):
-        """!Set compulational region extent interactively"""
+        """Set compulational region extent interactively"""
         self.MapWindow.SetModeDrawRegion()
 
     def OnSaveDisplayRegion(self, event):
-        """!Save display extents to named region file.
+        """Save display extents to named region file.
         """
         self.MapWindow.SaveRegion(display = True)
 
     def OnSaveWindRegion(self, event):
-        """!Save computational region to named region file.
+        """Save computational region to named region file.
         """
         self.MapWindow.SaveRegion(display = False)
         
     def OnZoomMenu(self, event):
-        """!Popup Zoom menu
+        """Popup Zoom menu
         """
         zoommenu = wx.Menu()
         
@@ -1366,7 +1367,7 @@ class MapFrame(SingleMapFrame):
 
     def SetProperties(self, render = False, mode = 0, showCompExtent = False,
                       constrainRes = False, projection = False, alignExtent = True):
-        """!Set properies of map display window"""
+        """Set properies of map display window"""
         self.mapWindowProperties.autoRender = render
         self.statusbarManager.SetMode(mode)
         self.StatusbarUpdate()
@@ -1376,9 +1377,9 @@ class MapFrame(SingleMapFrame):
         self.SetProperty('projection', projection)
         
     def IsStandalone(self):
-        """!Check if Map display is standalone
+        """Check if Map display is standalone
 
-        @depreciated
+        .. 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)
@@ -1388,28 +1389,28 @@ class MapFrame(SingleMapFrame):
                   " Signals or giface")
         if self._layerManager:
             return False
-        
+
         return True
-    
+
     def GetLayerManager(self):
-        """!Get reference to Layer Manager
+        """Get reference to Layer Manager
 
-        @return window reference
-        @return None (if standalone)
+        :return: window reference
+        :return: None (if standalone)
 
-        @depreciated
+        .. 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"""
+        """Returns toolbar with zooming tools"""
         return self.toolbars['map']
 
     def OnVNet(self, event):
-        """!Dialog for v.net* modules 
+        """Dialog for v.net* modules 
         """
         if self.dialogs['vnet']:
             self.dialogs['vnet'].Raise()
@@ -1429,7 +1430,7 @@ class MapFrame(SingleMapFrame):
         self.GetMapToolbar().SelectDefault()
 
     def _switchMapWindow(self, map_win):
-        """!Notifies activated and disactivated map_wins."""
+        """Notifies activated and disactivated map_wins."""
         self.MapWindow.DisactivateWin()
         map_win.ActivateWin()
 

+ 1 - 1
gui/wxpython/mapdisp/gprint.py

@@ -1,4 +1,4 @@
-"""!
+"""
 @package mapdisp.gprint
 
 @brief Print context and utility functions for printing

+ 0 - 0
gui/wxpython/mapdisp/main.py


Some files were not shown because too many files changed in this diff