[GRASS-SVN] r62225 - grass/branches/releasebranch_7_0/gui/wxpython/rlisetup

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Oct 9 07:47:42 PDT 2014


Author: neteler
Date: 2014-10-09 07:47:42 -0700 (Thu, 09 Oct 2014)
New Revision: 62225

Modified:
   grass/branches/releasebranch_7_0/gui/wxpython/rlisetup/frame.py
   grass/branches/releasebranch_7_0/gui/wxpython/rlisetup/functions.py
   grass/branches/releasebranch_7_0/gui/wxpython/rlisetup/g.gui.rlisetup.html
   grass/branches/releasebranch_7_0/gui/wxpython/rlisetup/sampling_frame.py
   grass/branches/releasebranch_7_0/gui/wxpython/rlisetup/wizard.py
Log:
wxrlisetup: sync comments to trunk

Modified: grass/branches/releasebranch_7_0/gui/wxpython/rlisetup/frame.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/rlisetup/frame.py	2014-10-09 12:49:24 UTC (rev 62224)
+++ grass/branches/releasebranch_7_0/gui/wxpython/rlisetup/frame.py	2014-10-09 14:47:42 UTC (rev 62225)
@@ -75,11 +75,11 @@
         self.Layout()
 
     def OnClose(self, event):
-        """!Close window"""
+        """Close window"""
         self.Destroy()
 
     def OnOk(self, event):
-        """!Launches help"""
+        """Launches help"""
         dlg = wx.MessageDialog(parent=self.parent,
                                 message=_("Are you sure that you want modify" \
                                           " r.li configuration file {name}?" \
@@ -188,7 +188,7 @@
         self.Layout()
 
     def ListFiles(self):
-        """!Check the configuration files inside the path"""
+        """Check the configuration files inside the path"""
         # list of configuration file
         listfiles = []
         #return all the configuration files in self.rlipath, check if there are
@@ -199,15 +199,15 @@
         return sorted(listfiles)
 
     def OnClose(self, event):
-        """!Close window"""
+        """Close window"""
         self.Destroy()
 
     def OnHelp(self, event):
-        """!Launches help"""
+        """Launches help"""
         gcmd.RunCommand('g.manual', parent=self, entry='wxGUI.rlisetup')
 
     def OnRemove(self, event):
-        """!Remove configuration file from path and update the list"""
+        """Remove configuration file from path and update the list"""
         confile = self.listfiles[self.listfileBox.GetSelections()[0]]
         dlg = wx.MessageDialog(parent=self.parent,
                                 message=_("Do you want remove r.li " \
@@ -223,14 +223,14 @@
         return
 
     def OnNew(self, event):
-        """!Remove configuration file from path and update the list"""
+        """Remove configuration file from path and update the list"""
         RLIWizard(self)
         self.listfiles = self.ListFiles()
         self.listfileBox.Clear()
         self.listfileBox.Set(self.listfiles)
 
     def OnRename(self, event):
-        """!Rename an existing configuration file"""
+        """Rename an existing configuration file"""
         try:
             confile = self.listfiles[self.listfileBox.GetSelections()[0]]
         except:
@@ -250,7 +250,7 @@
             self.listfileBox.Set(self.listfiles)
 
     def OnView(self, event):
-        """!Show and edit a configuration file"""
+        """Show and edit a configuration file"""
         try:
             confile = self.listfiles[self.listfileBox.GetSelections()[0]]
         except:

Modified: grass/branches/releasebranch_7_0/gui/wxpython/rlisetup/functions.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/rlisetup/functions.py	2014-10-09 12:49:24 UTC (rev 62224)
+++ grass/branches/releasebranch_7_0/gui/wxpython/rlisetup/functions.py	2014-10-09 14:47:42 UTC (rev 62225)
@@ -67,7 +67,7 @@
 
 
 def checkMapExists(name, typ='rast'):
-    """!Check if a map already exist in the working mapset"""
+    """Check if a map already exist in the working mapset"""
     env = grass.gisenv()
     mapset = env['MAPSET']
     mapp = grass.find_file(name, typ, mapset)

Modified: grass/branches/releasebranch_7_0/gui/wxpython/rlisetup/g.gui.rlisetup.html
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/rlisetup/g.gui.rlisetup.html	2014-10-09 12:49:24 UTC (rev 62224)
+++ grass/branches/releasebranch_7_0/gui/wxpython/rlisetup/g.gui.rlisetup.html	2014-10-09 14:47:42 UTC (rev 62225)
@@ -36,6 +36,7 @@
 
 <img src="g_gui_rlisetup_sampleAreas.jpg" alt="Sampling area definitions">
 
+<p>
 Definition of region for analysis:
 <ul>
   <li> Whole map layer: entire map (current region),</li>
@@ -165,7 +166,7 @@
 Screenshots of the wizard window frames:
 
 <center>
-  <table border=1>
+  <table border=0>
   <tr>
     <td align=center>
        <img src="g_gui_rlisetup_1.png" alt="g.gui.rlisetup: First frame of wizard for selecting existing configuration files or creating a new one">

Modified: grass/branches/releasebranch_7_0/gui/wxpython/rlisetup/sampling_frame.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/rlisetup/sampling_frame.py	2014-10-09 12:49:24 UTC (rev 62224)
+++ grass/branches/releasebranch_7_0/gui/wxpython/rlisetup/sampling_frame.py	2014-10-09 14:47:42 UTC (rev 62225)
@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-"""!
+"""
 @package rlisetup.sampling_frame
 
 @brief r.li.setup - draw sample frame
@@ -64,7 +64,7 @@
 
 
 class RLiSetupMapPanel(wx.Panel):
-    """!Panel with mapwindow used in r.li.setup"""
+    """Panel with mapwindow used in r.li.setup"""
     def __init__(self, parent, samplingType, icon=None, map_=None):
         wx.Panel.__init__(self, parent=parent)
 
@@ -127,15 +127,15 @@
         return self.map_
 
     def OnPan(self, event):
-        """!Panning, set mouse to drag."""
+        """Panning, set mouse to drag."""
         self.mapWindow.SetModePan()
 
     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 OnZoomToMap(self, event):
@@ -143,7 +143,7 @@
         self.mapWindow.ZoomToMap(layers=layers, ignoreNulls=False, render=True)
 
     def OnDrawRadius(self, event):
-        """!Start draw mode"""
+        """Start draw mode"""
         self.mapWindow.mouse['use'] = "None"
         self.mapWindow.mouse['box'] = "line"
         self.mapWindow.pen = wx.Pen(colour=wx.RED, width=1,
@@ -152,7 +152,7 @@
         self.mapWindow.mouseLeftUp.connect(self._radiusDrawn)
 
     def OnDigitizeRegion(self, event):
-        """!Start draw mode"""
+        """Start draw mode"""
         self.mapWindow.mouse['use'] = "None"
         self.mapWindow.mouse['box'] = "line"
         self.mapWindow.pen = wx.Pen(colour=wx.RED, width=1,
@@ -164,7 +164,7 @@
         self._registeredGraphics.GetItem(0).SetCoords([])
 
     def OnDraw(self, event):
-        """!Start draw mode"""
+        """Start draw mode"""
         self.mapWindow.mouse['use'] = "None"
         self.mapWindow.mouse['box'] = "box"
         self.mapWindow.pen = wx.Pen(colour=wx.RED, width=2,
@@ -270,7 +270,7 @@
         return marea
 
     def _onToolChanged(self):
-        """!Helper function to disconnect drawing"""
+        """Helper function to disconnect drawing"""
         try:
             self.mapWindow.mouseLeftUp.disconnect(self._rectangleDrawn)
             self.mapWindow.mouseLeftUp.disconnect(self._radiusDrawn)
@@ -281,7 +281,7 @@
             pass
 
     def _radiusDrawn(self, x, y):
-        """!When drawing finished, get region values"""
+        """When drawing finished, get region values"""
         mouse = self.mapWindow.mouse
         item = self._registeredGraphics.GetItem(0)
         p1 = mouse['begin']
@@ -340,7 +340,7 @@
         return marea
 
     def _rectangleDrawn(self):
-        """!When drawing finished, get region values"""
+        """When drawing finished, get region values"""
         mouse = self.mapWindow.mouse
         item = self._registeredGraphics.GetItem(0)
         p1 = self.mapWindow.Pixel2Cell(mouse['begin'])
@@ -375,7 +375,7 @@
             dlg.Destroy()
 
         elif self.samplingtype != SamplingType.WHOLE:
-            """!When drawing finished, get region values"""
+            """When drawing finished, get region values"""
             self.sampleFrameChanged.emit(region=region)
 
 icons = {'draw': MetaIcon(img='edit',
@@ -393,10 +393,10 @@
 
 
 class RLiSetupToolbar(BaseToolbar):
-    """!IClass toolbar
+    """IClass toolbar
     """
     def __init__(self, parent, toolSwitcher):
-        """!RLiSetup toolbar constructor
+        """RLiSetup toolbar constructor
         """
 
         BaseToolbar.__init__(self, parent, toolSwitcher,
@@ -426,7 +426,7 @@
         self.Realize()
 
     def _toolbarData(self):
-        """!Toolbar data"""
+        """Toolbar data"""
         if self.parent.samplingtype == SamplingType.REGIONS:
             drawTool = ('digitizeregion', icons['digitizeregion'],
                         self.parent.OnDigitizeRegion, wx.ITEM_CHECK)

Modified: grass/branches/releasebranch_7_0/gui/wxpython/rlisetup/wizard.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/rlisetup/wizard.py	2014-10-09 12:49:24 UTC (rev 62224)
+++ grass/branches/releasebranch_7_0/gui/wxpython/rlisetup/wizard.py	2014-10-09 14:47:42 UTC (rev 62225)
@@ -36,11 +36,7 @@
 from functions import SamplingType, sampleAreaVector, convertFeature, obtainAreaVector
 from core.gcmd import GError, GMessage, RunCommand
 
-#@NOTE: r.li.setup writes in the settings file with
-## r.li.windows.tcl:
-#exec echo "SAMPLINGFRAME $per_x|$per_y|$per_rl|$per_cl" >> $env(TMP).set
 
-
 class RLIWizard(object):
     """
     !Start wizard here and finish wizard here
@@ -54,7 +50,7 @@
         self.rlipath = retRLiPath()
 
         self.msAreaList = []
-        #pages
+        # pages
         self.startpage = FirstPage(self.wizard, self)
         self.drawsampleframepage = DrawSampleFramePage(self.wizard, self)
         self.keyboardpage = KeyboardPage(self.wizard, self)
@@ -67,7 +63,7 @@
         self.moving = MovingKeyPage(self.wizard, self)
         self.regions = DrawRegionsPage(self.wizard, self)
 
-        #order of pages
+        # order of pages
         self.startpage.SetNext(self.samplingareapage)
         self.keyboardpage.SetPrev(self.startpage)
         self.keyboardpage.SetNext(self.samplingareapage)
@@ -96,7 +92,7 @@
 
         self.summarypage.SetPrev(self.samplingareapage)
 
-        #layout
+        # layout
         self.startpage.DoLayout()
         self.drawsampleframepage.DoLayout()
         self.keyboardpage.DoLayout()
@@ -110,7 +106,7 @@
         self.vectorareas.DoLayout()
 
         self.wizard.FitToPage(self.startpage)
-        #run_wizard
+        # run_wizard
         if self.wizard.RunWizard(self.startpage):
             dlg = wx.MessageDialog(parent=self.parent,
                                 message=_("Do you want to create r.li "
@@ -132,7 +128,7 @@
             self._cleanup()
 
     def _write_confile(self):
-        """!Write the configuration file"""
+        """Write the configuration file"""
         f = open(os.path.join(self.rlipath, self.startpage.conf_name), 'wb')
         self.rasterinfo = grast.raster_info(self.startpage.rast)
         self._write_region(f)
@@ -150,16 +146,16 @@
         self.SF_EWRES = self.gregion['ewres']
 
     def _write_region(self, fil):
-        """!Write the region"""
+        """Write the region"""
         if self.startpage.region == 'whole':
             fil.write("SAMPLINGFRAME 0|0|1|1\n")
             self._temp_region()
             self.SF_X = 0.0
             self.SF_Y = 0.0
             self.SF_RL = abs(int(float(self.gregion['s'] - self.gregion['n'])
-                        / float(self.gregion['nsres'])))
+                                 / float(self.gregion['nsres'])))
             self.SF_CL = abs(int(float(self.gregion['e'] - self.gregion['w'])
-                        / float(self.gregion['ewres'])))
+                                 / float(self.gregion['ewres'])))
             self.SF_N = self.gregion['n']
             self.SF_S = self.gregion['s']
             self.SF_E = self.gregion['e']
@@ -226,7 +222,7 @@
         return
 
     def _circle(self, radius, mask):
-        """!Create a circle mask"""
+        """Create a circle mask"""
         self._value_for_circle(radius)
         eastEdge = float(self.SF_W + (self.CIR_RL * self.SF_EWRES))
         southEdge = float(self.SF_N - (self.CIR_CL * self.SF_NSRES))
@@ -243,7 +239,7 @@
         grass.run_command('g.region', rast=self.startpage.rast)
 
     def getSamplingType(self):
-        """!Obtain the sampling type"""
+        """Obtain the sampling type"""
         devicetype = self.samplingareapage.regionbox
         samplingtype = self.samplingareapage.samplingtype
         shapetype = self.units.boxtype
@@ -281,7 +277,7 @@
         return samtype
 
     def _write_area(self, fil):
-        """!Write the area according the type"""
+        """Write the area according the type"""
         samtype = self.getSamplingType()
 
         #sampling type is whole
@@ -402,7 +398,7 @@
             fil.write("VECTORMAP {name}\n".format(name=self.startpage.vect))
 
     def _cleanup(self):
-        """!Clean all the variables to save into configuration file"""
+        """Clean all the variables to save into configuration file"""
         self.startpage.conf_name = ''
         self.startpage.rast = ''
         self.startpage.vect = ''
@@ -492,7 +488,7 @@
         wx.CallAfter(wx.FindWindowById(wx.ID_FORWARD).Enable, False)
 
     def OnSampling(self, event):
-        """!Change region type"""
+        """Change region type"""
         if event.GetInt() == 0:
             self.region = 'whole'
             self.SetNext(self.parent.samplingareapage)
@@ -504,7 +500,7 @@
             self.SetNext(self.parent.drawsampleframepage)
 
     def OnName(self, event):
-        """!Sets the name of configuration file"""
+        """Sets the name of configuration file"""
         if self.conf_name in self.parent.parent.listfiles:
             GMessage(parent=self, message=_("The configuration file %s "
                      "already exists, please change name") % self.conf_name)
@@ -512,41 +508,42 @@
             self.conf_name = ''
 
     def OnNameChanged(self, event):
-        """!Name of configuration file has changed"""
+        """Name of configuration file has changed"""
         self.conf_name = self.newconftxt.GetValue()
         next = wx.FindWindowById(wx.ID_FORWARD)
         next.Enable(self.CheckInput())
 
     def OnRast(self, event):
-        """!Sets raster map"""
+        """Sets raster map"""
         self.rast = event.GetString()
         next = wx.FindWindowById(wx.ID_FORWARD)
         next.Enable(self.CheckInput())
 
     def OnVector(self, event):
-        """!Sets vector map"""
+        """Sets vector map"""
         self.vect = event.GetString()
         next = wx.FindWindowById(wx.ID_FORWARD)
         next.Enable(self.CheckInput())
 
     def OnEnterPage(self, event):
-        """!Sets the default values, for the entire map
+        """Sets the default values, for the entire map
         """
         next = wx.FindWindowById(wx.ID_FORWARD)
         next.Enable(self.CheckInput())
-        wx.CallAfter(wx.FindWindowById(wx.ID_FORWARD).Enable, self.CheckInput())
+        wx.CallAfter(wx.FindWindowById(wx.ID_FORWARD).Enable,
+                     self.CheckInput())
 
     def CheckInput(self):
-        """!Check input fields.
+        """Check input fields.
 
-        @return True if configuration file is given and raster xor vector map,
-        False otherwise
+        :return: True if configuration file is given and raster xor vector map,
+                 False otherwise
         """
         #R#return bool(self.conf_name and (bool(self.rast) != bool(self.vect)))
         return bool(self.conf_name and bool(self.rast))
 
     def OnExitPage(self, event=None):
-        """!Function during exiting"""
+        """Function during exiting"""
         next = wx.FindWindowById(wx.ID_FORWARD)
         next.Enable(self.CheckInput())
         if event.GetDirection():
@@ -570,7 +567,6 @@
         TitledPage.__init__(self, wizard, _("Insert sampling frame parameter"))
 
         self.parent = parent
-        self.sizer.AddGrowableCol(2)
         self.col_len = ''
         self.row_len = ''
         self.col_up = '0'
@@ -589,6 +585,7 @@
                        flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL)
         self.sizer.Add(item=self.ColUpLefttxt, border=5, pos=(1, 2),
                        flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL)
+        self.sizer.AddGrowableCol(2)
         #row up/left
         self.RowUpLeftlabel = wx.StaticText(parent=self, id=wx.ID_ANY,
                                             label=_('Row of upper left corner'))
@@ -637,27 +634,27 @@
         self.Bind(wiz.EVT_WIZARD_PAGE_CHANGING, self.OnExitPage)
 
     def OnColLeft(self, event):
-        """!Sets the name of configuration file"""
+        """Sets the name of configuration file"""
         self.col_up = self.ColUpLefttxt.GetValue()
         checkValue(self.col_up)
 
     def OnRowLeft(self, event):
-        """!Sets the name of configuration file"""
+        """Sets the name of configuration file"""
         self.row_up = self.RowUpLefttxt.GetValue()
         checkValue(self.row_up)
 
     def OnColLen(self, event):
-        """!Sets the name of configuration file"""
+        """Sets the name of configuration file"""
         self.col_len = self.ColLentxt.GetValue()
         checkValue(self.col_len)
 
     def OnRowLen(self, event):
-        """!Sets the name of configuration file"""
+        """Sets the name of configuration file"""
         self.row_len = self.RowLentxt.GetValue()
         checkValue(self.row_len)
 
     def OnEnterPage(self, event):
-        """!Sets the default values, for the entire map
+        """Sets the default values, for the entire map
         """
         #R# check if raster exists before anything
         if self.col_len == '' and self.row_len == '':
@@ -669,7 +666,7 @@
         self.RowLentxt.SetValue(self.row_len)
 
     def OnExitPage(self, event=None):
-        """!Function during exiting"""
+        """Function during exiting"""
         if self.row_len == '' or self.col_len == '' or self.row_up == '' or self.col_up == '':
             wx.FindWindowById(wx.ID_FORWARD).Enable(False)
         else:
@@ -677,7 +674,7 @@
 
 
 class DrawSampleFramePage(TitledPage):
-    """!Choose the region setting the values drawing a box"""
+    """Choose the region setting the values drawing a box"""
     def __init__(self, wizard, parent):
         TitledPage.__init__(self, wizard, _("Draw sampling frame"))
         self.parent = parent
@@ -687,7 +684,7 @@
         self.Bind(wiz.EVT_WIZARD_PAGE_CHANGING, self.OnExitPage)
 
     def SampleFrameChanged(self, region):
-        """"!Enables the next dialog when region is set"""
+        """"Enables the next dialog when region is set"""
         if region:
             self.tregion = region
             wx.FindWindowById(wx.ID_FORWARD).Enable(True)
@@ -695,7 +692,7 @@
             wx.FindWindowById(wx.ID_FORWARD).Enable(False)
 
     def OnEnterPage(self, event):
-        """!Function during entering"""
+        """Function during entering"""
         if self.mapPanel is None:
             self.mapPanel = RLiSetupMapPanel(self, samplingType='drawFrame')
             self.mapPanel.sampleFrameChanged.connect(self.SampleFrameChanged)
@@ -716,7 +713,7 @@
                           name=rast, hidden=False, opacity=1.0, render=True)
 
     def OnExitPage(self, event=None):
-        """!Function during exiting"""
+        """Function during exiting"""
         if event.GetDirection():
             self.SetNext(self.parent.samplingareapage)
             self.parent.samplingareapage.SetPrev(self)
@@ -803,7 +800,7 @@
         self.Bind(wiz.EVT_WIZARD_PAGE_CHANGED, self.OnEnterPage)
 
     def OnNumRegions(self, event):
-        """!Obtain the number of regions"""
+        """Obtain the number of regions"""
         if event.GetString():
             self.SetNext(self.parent.regions)
             wx.FindWindowById(wx.ID_FORWARD).Enable(True)
@@ -812,7 +809,7 @@
             wx.FindWindowById(wx.ID_FORWARD).Enable(False)
 
     def OnEnterPage(self, event):
-        """!Insert values into text controls for summary of location
+        """Insert values into text controls for summary of location
         creation options
         """
         self.SetVal(None)
@@ -825,7 +822,7 @@
         wx.FindWindowById(wx.ID_FORWARD).Enable(True)
 
     def SetVal(self, event):
-        """!Choose method"""
+        """Choose method"""
         radio = self.radioBox.GetSelection()
         wx.FindWindowById(wx.ID_FORWARD).Enable(True)
         if radio == 0:
@@ -848,7 +845,7 @@
         self.ShowExtraOptions(self.samplingtype)
 
     def ShowExtraOptions(self, samtype):
-        """!Show some extra options for some sampling type"""
+        """Show some extra options for some sampling type"""
         if samtype == SamplingType.REGIONS:
             self.sizer.Hide(self.regionBox)
             self.sizer.Hide(self.areaPanel)
@@ -871,14 +868,14 @@
         return
 
     def OnVectYes(self, event):
-        """!The user choose to select the vector areas, this function set the
+        """The user choose to select the vector areas, this function set the
         next page to VectorAreasPage"""
         self.SetNext(self.parent.vectorareas)
         wx.FindWindowById(wx.ID_FORWARD).Enable(True)
         self.parent.wizard.ShowPage(self.parent.vectorareas)
 
     def OnVectNo(self, event):
-        """!The user choose to use all the vector areas, this function analyses
+        """The user choose to use all the vector areas, this function analyses
         all the vector areas and fill the msAreaList variable"""
         self.sizer.Show(self.calculatingAreas)
         self.sizer.Hide(self.regionNumPanel)
@@ -911,7 +908,7 @@
         self._progressDlg = None
 
     def RegionDraw(self, regtype):
-        """!Set the next page to units or drawunits"""
+        """Set the next page to units or drawunits"""
         if regtype == 0:
             self.regionbox = 'keyboard'
             if self.samplingtype == SamplingType.UNITS:
@@ -960,7 +957,7 @@
             wx.FindWindowById(wx.ID_FORWARD).Enable(False)
 
     def OnEnterPage(self, event):
-        """!Function during entering"""
+        """Function during entering"""
         if self.parent.samplingareapage.samplingtype == SamplingType.WHOLE:
             self.title.SetLabel(_("Draw moving windows region"))
         elif self.parent.samplingareapage.samplingtype == SamplingType.UNITS:
@@ -995,7 +992,7 @@
 
 
 class SampleUnitsKeyPage(TitledPage):
-    """!Set values from keyboard for sample units
+    """Set values from keyboard for sample units
        It is used if you choose keyboard from Sampling Units or Moving windows
        in sampling areas page
     """
@@ -1091,20 +1088,20 @@
         self.OnType(None)
 
     def OnEnterPage(self, event=None):
-        """!Function during entering"""
+        """Function during entering"""
         # This is an hack to force the user to choose Rectangle or Circle
         self.typeBox.SetSelection(2),
         self.typeBox.ShowItem(2, False)
         self.panelSizer.Layout()
 
     def OnExitPage(self, event=None):
-        """!Function during exiting"""
+        """Function during exiting"""
         if event.GetDirection():
             self.SetNext(self.parent.summarypage)
             self.SetPrev(self.parent.samplingareapage)
 
     def OnType(self, event):
-        """!Set if rectangle or circle will be used"""
+        """Set if rectangle or circle will be used"""
         chosen = self.typeBox.GetSelection()
         self.widthLabel.SetLabel(self.widthLabels[chosen])
         self.heightLabel.SetLabel(self.heightLabels[chosen])
@@ -1166,13 +1163,12 @@
 
 
 class MovingKeyPage(TitledPage):
-    """!Set values from keyboard for sample units"""
+    """Set values from keyboard for sample units"""
 
     def __init__(self, wizard, parent):
         TitledPage.__init__(self, wizard, _("Set sample units"))
 
         self.parent = parent
-        self.sizer.AddGrowableCol(2)
         self.width = ''
         self.height = ''
         self.boxtype = 'rectangle'
@@ -1204,6 +1200,7 @@
         self.sizer.Add(item=self.heightTxt, border=5, pos=(3, 2),
                        flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL)
 
+        self.sizer.AddGrowableCol(2)
         self.widthLabels = [_('Width size (in cells) ?'),
                             _('What radius size (in meters) ?')]
         self.heightLabels = [_('Height size (in cells) ?'),
@@ -1227,23 +1224,17 @@
         self.heightLabel.SetLabel(self.heightLabels[chosen])
         self.sizer.Layout()
         if chosen == 0:
-            if self.parent.samplingareapage.samplingtype == SamplingType.MVWIN:
-                self.parent.samplingareapage.samplingtype = SamplingType.KMVWINR
-            else:
-                self.parent.samplingareapage.samplingtype = SamplingType.KMVWINC
+            self.parent.samplingareapage.samplingtype = SamplingType.KMVWINR
             self.boxtype = 'rectangle'
         elif chosen == 1:
-            if self.parent.samplingareapage.samplingtype == SamplingType.MVWIN:
-                self.parent.samplingareapage.samplingtype = SamplingType.KMVWINC
-            else:
-                self.parent.samplingareapage.samplingtype = SamplingType.MMVWINC
+            self.parent.samplingareapage.samplingtype = SamplingType.KMVWINC
             self.boxtype = 'circle'
 
     def CheckInput(self):
-        """!Check input fields.
+        """Check input fields.
 
-        @return True if configuration file is given and raster xor vector map,
-        False otherwise
+        :return: True if configuration file is given and raster xor
+                 vector map, False otherwise
         """
         return bool(self.width and bool(self.height))
 
@@ -1259,7 +1250,7 @@
 
 
 class UnitsMousePage(TitledPage):
-    """!Choose the sampling area setting the values using the mouse drawing the
+    """Choose the sampling area setting the values using the mouse drawing the
        areas with rectangle or circle. It is used both from 'Moving windows'
        and 'Sample units'.
     """
@@ -1305,7 +1296,7 @@
         self.regionNumTxt.SetValue('')
 
     def OnEnterPage(self, event):
-        """!Function during entering"""
+        """Function during entering"""
         if self.numregions:
             wx.FindWindowById(wx.ID_FORWARD).Enable(True)
         else:
@@ -1347,7 +1338,7 @@
             self.drawtype = 'circle'
 
     def OnNumRegions(self, event):
-        """!Set the number of region"""
+        """Set the number of region"""
         if event.GetString():
             self.SetNext(self.parent.drawsampleunitspage)
             wx.FindWindowById(wx.ID_FORWARD).Enable(True)
@@ -1356,14 +1347,14 @@
             wx.FindWindowById(wx.ID_FORWARD).Enable(False)
 
     def OnExitPage(self, event=None):
-        """!Function during exiting"""
+        """Function during exiting"""
         if event.GetDirection():
             self.SetNext(self.drawsampleunitspage)
             self.SetPrev(self.samplingareapage)
 
 
 class DrawSampleUnitsPage(TitledPage):
-    """!Choose the sampling area drawing them"""
+    """Choose the sampling area drawing them"""
     def __init__(self, wizard, parent):
         TitledPage.__init__(self, wizard, _("Draw sampling units"))
         self.parent = parent
@@ -1388,7 +1379,7 @@
             wx.FindWindowById(wx.ID_FORWARD).Enable(False)
 
     def OnEnterPage(self, event):
-        """!Function during entering"""
+        """Function during entering"""
 
         if self.parent.samplingareapage.samplingtype in [SamplingType.MVWIN,
                                                          SamplingType.MMVWINC,
@@ -1402,7 +1393,7 @@
 
         gtype = self.parent.drawunits.drawtype
         self.mapPanel = RLiSetupMapPanel(self,
-                                         samplingType=self.parent.samplingareapage.samplingtype, 
+                                         samplingType=self.parent.samplingareapage.samplingtype,
                                          )
         if gtype == 'circle':
             self.mapPanel.afterCircleDrawn.connect(self.SampleFrameChanged)
@@ -1434,7 +1425,7 @@
 
 
 class VectorAreasPage(TitledPage):
-    """!Choose the sampling area using the vector features"""
+    """Choose the sampling area using the vector features"""
     def __init__(self, wizard, parent):
         TitledPage.__init__(self, wizard, _("Select sampling areas"))
         self.parent = parent
@@ -1460,7 +1451,7 @@
         self.sizer.Add(self.areaPanel, flag=wx.ALIGN_CENTER, pos=(2, 0))
 
     def afterRegionDrawn(self):
-        """!Function to update the title and the number of selected area"""
+        """Function to update the title and the number of selected area"""
         self.areascount = self.areascount + 1
         if self.areascount == self.areanum:
             wx.FindWindowById(wx.ID_FORWARD).Enable(True)
@@ -1472,19 +1463,19 @@
             return False
 
     def OnYes(self, event):
-        """!Function to create the string for the conf file if the area
+        """Function to create the string for the conf file if the area
         is selected"""
         self.parent.msAreaList.append(obtainAreaVector(self.outname))
         if not self.afterRegionDrawn():
             self.newCat()
 
     def OnNo(self, event):
-        """!Function to pass to the next feature if it is not selected"""
+        """Function to pass to the next feature if it is not selected"""
         if not self.afterRegionDrawn():
             self.newCat()
 
     def newCat(self):
-        """!Convert to raster and draw the new feature"""
+        """Convert to raster and draw the new feature"""
         cat = self.vect_cats[self.areascount]
         self.outname = "{name}_{cat}".format(name=self.vect.split('@')[0],
                                              cat=cat)
@@ -1502,7 +1493,7 @@
         self.areaText.SetLabel("Is this area (cat={n}) ok?".format(n=cat))
 
     def OnEnterPage(self, event):
-        """!Function during entering: draw the raster map and the first vector
+        """Function during entering: draw the raster map and the first vector
         feature"""
         if self.mapPanel is None:
             self.mapPanel = RLiSetupMapPanel(self, samplingType=self.parent.samplingareapage.samplingtype,
@@ -1535,7 +1526,7 @@
         self.newCat()
 
     def OnExitPage(self, event=None):
-        """!Function during exiting"""
+        """Function during exiting"""
         grass.del_temp_region()
 #        if event.GetDirection():
 #            self.SetNext(self.parent.samplingareapage)
@@ -1543,13 +1534,12 @@
 
 
 class SummaryPage(TitledPage):
-    """!Shows summary result of choosing data"""
+    """Shows summary result of choosing data"""
     def __init__(self, wizard, parent):
         TitledPage.__init__(self, wizard, _("Summary"))
         global rlisettings
 
         self.parent = parent
-        self.sizer.AddGrowableCol(2)
 
         #configuration file name
         self.conflabel = wx.StaticText(parent=self, id=wx.ID_ANY,
@@ -1560,7 +1550,6 @@
                        flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL)
         self.sizer.Add(item=self.conftxt, border=5, pos=(0, 1),
                        flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL)
-
         #raster name
         self.rastlabel = wx.StaticText(parent=self, id=wx.ID_ANY,
                                        label=_('Raster name:'))
@@ -1652,8 +1641,9 @@
         self.sizer.Add(item=self.unitsmoretxt2, border=5, pos=(11, 1),
                        flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL)
 
+
     def OnEnterPage(self, event):
-        """!Insert values into text controls for summary of location
+        """Insert values into text controls for summary of location
         creation options
         """
         self.conftxt.SetLabel(self.parent.startpage.conf_name)



More information about the grass-commit mailing list