[GRASS-SVN] r30208 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Feb 17 00:52:15 EST 2008
Author: cmbarton
Date: 2008-02-17 00:52:15 -0500 (Sun, 17 Feb 2008)
New Revision: 30208
Modified:
grass/trunk/gui/wxpython/gui_modules/mcalc_builder.py
Log:
Added docstrings.
Modified: grass/trunk/gui/wxpython/gui_modules/mcalc_builder.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mcalc_builder.py 2008-02-17 05:44:13 UTC (rev 30207)
+++ grass/trunk/gui/wxpython/gui_modules/mcalc_builder.py 2008-02-17 05:52:15 UTC (rev 30208)
@@ -35,17 +35,17 @@
sys.path.append(imagepath)
class MapCalcFrame(wx.Frame):
- """Mapcalc Frame class"""
+ """
+ Mapcalc Frame class. Calculator-style window to create
+ and run r.mapcalc statements
+ """
def __init__(self, parent, id, title, pos=wx.DefaultPosition,
size=wx.DefaultSize, style=wx.TAB_TRAVERSAL|wx.DEFAULT_FRAME_STYLE):
wx.Frame.__init__(self, parent, id, title, pos=pos, size=size, style=style)
self.Centre(wx.BOTH)
- self.SetTitle(_("GRASS Mapcalc Statement Builder") )
- #self.SetIcon(wx.Icon(os.path.join(imagepath,
- # 'grass_sql.png'),
- # wx.BITMAP_TYPE_ANY))
+ self.SetTitle(_("GRASS Map Calculator") )
#
# variables
@@ -95,9 +95,6 @@
'null()'
]
- # Init
-
-
#
# Buttons
#
@@ -225,10 +222,6 @@
self.__doLayout()
def __doLayout(self):
- #mcalc_box = wx.StaticBox(self, -1, "%s" % self.heading)
- #mcalc_boxsizer = wx.StaticBoxSizer(mcalc_box,wx.VERTICAL)
- #mcalc_boxsizer.Add(self.text_mcalc, flag=wx.EXPAND)
-
pagesizer = wx.BoxSizer(wx.VERTICAL)
controlsizer = wx.BoxSizer(wx.HORIZONTAL)
@@ -297,6 +290,10 @@
self.Show(True)
def AddMark(self,event):
+ """
+ Sends operators to insertion method
+ """
+
if event.GetId() == self.btn_compl.GetId(): mark = "~"
elif event.GetId() == self.btn_not.GetId(): mark = "!"
elif event.GetId() == self.btn_pow.GetId(): mark = "^"
@@ -328,11 +325,17 @@
self.newmap = event.GetString()
def OnSelect(self, event):
+ """
+ Gets raster map or function selection and send it to insertion method
+ """
item = event.GetString()
self.__addSomething(item)
self.text_mcalc.SetFocus()
def __addSomething(self,what):
+ """
+ Inserts operators, map names, and functions into text area
+ """
self.text_mcalc.SetFocus()
mcalcstr = self.text_mcalc.GetValue()
newmcalcstr = ''
@@ -356,6 +359,9 @@
self.text_mcalc.Update()
def OnMCalcRun(self,event):
+ """
+ Builds and runs r.mapcalc statement
+ """
if self.newmap == '':
wx.MessageBox("You must enter the name of a new map to create")
return
@@ -375,9 +381,15 @@
pass
def OnClear(self, event):
+ """
+ Clears text area
+ """
self.text_mcalc.SetValue("")
def OnHelp(self, event):
+ """
+ Launches r.mapcalc help
+ """
cmdlist = ['g.manual','r.mapcalc']
gcmd.Command(cmdlist)
More information about the grass-commit
mailing list