[GRASS-SVN] r54455 - in grass/trunk/gui/wxpython: core gcp gui_core iclass lmgr mapdisp mapswipe modules nviz vdigit
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Dec 29 03:27:07 PST 2012
Author: martinl
Date: 2012-12-29 03:27:07 -0800 (Sat, 29 Dec 2012)
New Revision: 54455
Modified:
grass/trunk/gui/wxpython/core/render.py
grass/trunk/gui/wxpython/gcp/manager.py
grass/trunk/gui/wxpython/gcp/mapdisplay.py
grass/trunk/gui/wxpython/gui_core/dialogs.py
grass/trunk/gui/wxpython/iclass/frame.py
grass/trunk/gui/wxpython/lmgr/frame.py
grass/trunk/gui/wxpython/lmgr/layertree.py
grass/trunk/gui/wxpython/mapdisp/frame.py
grass/trunk/gui/wxpython/mapdisp/main.py
grass/trunk/gui/wxpython/mapdisp/mapwindow.py
grass/trunk/gui/wxpython/mapdisp/statusbar.py
grass/trunk/gui/wxpython/mapswipe/frame.py
grass/trunk/gui/wxpython/modules/colorrules.py
grass/trunk/gui/wxpython/modules/histogram.py
grass/trunk/gui/wxpython/modules/mcalc_builder.py
grass/trunk/gui/wxpython/nviz/tools.py
grass/trunk/gui/wxpython/vdigit/g.gui.vdigit.py
grass/trunk/gui/wxpython/vdigit/mapwindow.py
grass/trunk/gui/wxpython/vdigit/toolbars.py
Log:
wxGUI: rename layer attributes (no l_ prefix)
Modified: grass/trunk/gui/wxpython/core/render.py
===================================================================
--- grass/trunk/gui/wxpython/core/render.py 2012-12-29 10:45:35 UTC (rev 54454)
+++ grass/trunk/gui/wxpython/core/render.py 2012-12-29 11:27:07 UTC (rev 54455)
@@ -54,13 +54,13 @@
@todo needs refactoring (avoid parent)
"""
- def __init__(self, type, cmd, parent, name = None,
+ def __init__(self, ltype, cmd, parent, name = None,
active = True, hidden = False, opacity = 1.0):
"""!Create new instance
@todo pass cmd as tuple instead of list
- @param type layer type ('raster', 'vector', 'overlay', 'command', etc.)
+ @param ltype layer type ('raster', 'vector', 'overlay', 'command', etc.)
@param cmd GRASS command to render layer,
given as list, e.g. ['d.rast', 'map=elevation at PERMANENT']
@param name layer name, e.g. 'elevation at PERMANENT' (for layer tree)
@@ -71,10 +71,10 @@
self.parent = parent
# generated file for each layer
- if USE_GPNMCOMP or type == 'overlay':
+ if USE_GPNMCOMP or ltype == 'overlay':
tmpfile = tempfile.mkstemp()[1]
self.maskfile = tmpfile + '.pgm'
- if type == 'overlay':
+ if ltype == 'overlay':
self.mapfile = tmpfile + '.png'
else:
self.mapfile = tmpfile + '.ppm'
@@ -84,8 +84,8 @@
# stores class which manages rendering instead of simple command - e. g. wms
self.renderMgr = None
-
- self.SetType(type)
+ self.type = None
+ self.SetType(ltype)
self.name = name
if self.type == 'command':
@@ -323,11 +323,11 @@
self.renderMgr.Abort()
class MapLayer(Layer):
- def __init__(self, type, cmd, parent, name = None,
+ def __init__(self, ltype, cmd, parent, name = None,
active = True, hidden = False, opacity = 1.0):
"""!Represents map layer in the map canvas
- @param type layer type ('raster', 'vector', 'command', etc.)
+ @param ltype layer type ('raster', 'vector', 'command', etc.)
@param cmd GRASS command to render layer,
given as list, e.g. ['d.rast', 'map=elevation at PERMANENT']
@param name layer name, e.g. 'elevation at PERMANENT' (for layer tree) or None
@@ -335,7 +335,7 @@
@param hidden layer is hidden, won't be listed in Layer Manager if True
@param opacity layer opacity <0;1>
"""
- Layer.__init__(self, type, cmd, parent, name,
+ Layer.__init__(self, ltype, cmd, parent, name,
active, hidden, opacity)
def GetMapset(self):
@@ -353,7 +353,7 @@
return self.name
class Overlay(Layer):
- def __init__(self, id, type, cmd, parent,
+ def __init__(self, id, ltype, cmd, parent,
active = True, hidden = True, opacity = 1.0):
"""!Represents overlay displayed in map canvas
@@ -365,7 +365,7 @@
@param hidden layer is hidden, won't be listed in Layer Manager if True
@param opacity layer opacity <0;1>
"""
- Layer.__init__(self, 'overlay', cmd, parent, type,
+ Layer.__init__(self, 'overlay', cmd, parent, ltype,
active, hidden, opacity)
self.id = id
@@ -797,27 +797,27 @@
except:
return None
- def GetListOfLayers(self, l_type = None, l_mapset = None, l_name = None,
- l_active = None, l_hidden = None):
+ def GetListOfLayers(self, ltype = None, mapset = None, name = None,
+ active = None, hidden = None):
"""!Returns list of layers of selected properties or list of
all layers.
- @param l_type layer type, e.g. raster/vector/wms/overlay (value or tuple of values)
- @param l_mapset all layers from given mapset (only for maplayers)
- @param l_name all layers with given name
- @param l_active only layers with 'active' attribute set to True or False
- @param l_hidden only layers with 'hidden' attribute set to True or False
+ @param ltype layer type, e.g. raster/vector/wms/overlay (value or tuple of values)
+ @param mapset all layers from given mapset (only for maplayers)
+ @param name all layers with given name
+ @param active only layers with 'active' attribute set to True or False
+ @param hidden only layers with 'hidden' attribute set to True or False
@return list of selected layers
"""
selected = []
- if type(l_type) == types.StringType:
+ if type(ltype) == types.StringType:
one_type = True
else:
one_type = False
- if one_type and l_type == 'overlay':
+ if one_type and ltype == 'overlay':
llist = self.overlays
else:
llist = self.layers
@@ -825,36 +825,36 @@
# ["raster", "vector", "wms", ... ]
for layer in llist:
# specified type only
- if l_type != None:
- if one_type and layer.type != l_type:
+ if ltype != None:
+ if one_type and layer.type != ltype:
continue
- elif not one_type and layer.type not in l_type:
+ elif not one_type and layer.type not in ltype:
continue
# mapset
- if (l_mapset != None and l_type != 'overlay') and \
- layer.GetMapset() != l_mapset:
+ if (mapset != None and ltype != 'overlay') and \
+ layer.GetMapset() != mapset:
continue
# name
- if l_name != None and layer.name != l_name:
+ if name != None and layer.name != name:
continue
# hidden and active layers
- if l_active != None and \
- l_hidden != None:
- if layer.active == l_active and \
- layer.hidden == l_hidden:
+ if active != None and \
+ hidden != None:
+ if layer.active == active and \
+ layer.hidden == hidden:
selected.append(layer)
# active layers
- elif l_active != None:
- if layer.active == l_active:
+ elif active != None:
+ if layer.active == active:
selected.append(layer)
# hidden layers
- elif l_hidden != None:
- if layer.hidden == l_hidden:
+ elif hidden != None:
+ if layer.hidden == hidden:
selected.append(layer)
# all layers
@@ -1014,31 +1014,31 @@
return self.mapfile
- def AddLayer(self, type, command, name = None,
- l_active = True, l_hidden = False, l_opacity = 1.0, l_render = False,
+ def AddLayer(self, ltype, command, name = None,
+ active = True, hidden = False, opacity = 1.0, render = False,
pos = -1):
"""!Adds generic map layer to list of layers
- @param type layer type ('raster', 'vector', etc.)
+ @param ltype layer type ('raster', 'vector', etc.)
@param command GRASS command given as list
@param name layer name
- @param l_active layer render only if True
- @param l_hidden layer not displayed in layer tree if True
- @param l_opacity opacity level range from 0(transparent) - 1(not transparent)
- @param l_render render an image if True
+ @param active layer render only if True
+ @param hidden layer not displayed in layer tree if True
+ @param opacity opacity level range from 0(transparent) - 1(not transparent)
+ @param render render an image if True
@param pos position in layer list (-1 for append)
@return new layer on success
@return None on failure
"""
wx.BeginBusyCursor()
- # l_opacity must be <0;1>
- if l_opacity < 0:
- l_opacity = 0
- elif l_opacity > 1:
- l_opacity = 1
- layer = MapLayer(type = type, name = name, cmd = command, parent = self,
- active = l_active, hidden = l_hidden, opacity = l_opacity)
+ # opacity must be <0;1>
+ if opacity < 0:
+ opacity = 0
+ elif opacity > 1:
+ opacity = 1
+ layer = MapLayer(ltype = ltype, name = name, cmd = command, parent = self,
+ active = active, hidden = hidden, opacity = opacity)
# add maplayer to the list of layers
if pos > -1:
@@ -1047,7 +1047,7 @@
self.layers.append(layer)
Debug.msg (3, "Map.AddLayer(): layer=%s" % layer.name)
- if l_render:
+ if render:
if not layer.Render():
raise GException(_("Unable to render map layer <%s>.") % name)
@@ -1113,7 +1113,7 @@
"""!Change map layer properties
@param layer map layer instance
- @param type layer type ('raster', 'vector', etc.)
+ @param ltype layer type ('raster', 'vector', etc.)
@param command GRASS command given as list
@param name layer name
@param active layer render only if True
@@ -1123,8 +1123,8 @@
"""
Debug.msg (3, "Map.ChangeLayer(): layer=%s" % layer.name)
- if 'type' in kargs:
- layer.SetType(kargs['type']) # check type
+ if 'ltype' in kargs:
+ layer.SetType(kargs['ltype']) # check type
if 'command' in kargs:
layer.SetCmd(kargs['command'])
@@ -1147,17 +1147,17 @@
return layer
- def ChangeOpacity(self, layer, l_opacity):
+ def ChangeOpacity(self, layer, opacity):
"""!Changes opacity value of map layer
@param layer layer instance in layer tree
- @param l_opacity opacity level <0;1>
+ @param opacity opacity level <0;1>
"""
- # l_opacity must be <0;1>
- if l_opacity < 0: l_opacity = 0
- elif l_opacity > 1: l_opacity = 1
+ # opacity must be <0;1>
+ if opacity < 0: opacity = 0
+ elif opacity > 1: opacity = 1
- layer.opacity = l_opacity
+ layer.opacity = opacity
Debug.msg (3, "Map.ChangeOpacity(): layer=%s, opacity=%f" % \
(layer.name, layer.opacity))
@@ -1228,31 +1228,31 @@
return -1
- def AddOverlay(self, id, type, command,
- l_active = True, l_hidden = True, l_opacity = 1.0, l_render = False):
+ def AddOverlay(self, id, ltype, command,
+ active = True, hidden = True, opacity = 1.0, render = False):
"""!Adds overlay (grid, barscale, legend, etc.) to list of
overlays
@param id overlay id (PseudoDC)
- @param type overlay type (barscale, legend)
+ @param ltype overlay type (barscale, legend)
@param command GRASS command to render overlay
- @param l_active overlay activated (True) or disabled (False)
- @param l_hidden overlay is not shown in layer tree (if True)
- @param l_render render an image (if True)
+ @param active overlay activated (True) or disabled (False)
+ @param hidden overlay is not shown in layer tree (if True)
+ @param render render an image (if True)
@return new layer on success
@return None on failure
"""
- Debug.msg (2, "Map.AddOverlay(): cmd=%s, render=%d" % (command, l_render))
- overlay = Overlay(id = id, type = type, cmd = command, parent = self,
- active = l_active, hidden = l_hidden, opacity = l_opacity)
+ Debug.msg (2, "Map.AddOverlay(): cmd=%s, render=%d" % (command, render))
+ overlay = Overlay(id = id, ltype = ltype, cmd = command, parent = self,
+ active = active, hidden = hidden, opacity = opacity)
# add maplayer to the list of layers
self.overlays.append(overlay)
- if l_render and command != '' and not overlay.Render():
+ if render and command != '' and not overlay.Render():
raise GException(_("Unable to render overlay <%s>.") %
- type)
+ ltype)
return self.overlays[-1]
@@ -1262,20 +1262,20 @@
Add new overlay if overlay with 'id' doesn't exist.
@param id overlay id (PseudoDC)
- @param type overlay type (barscale, legend)
+ @param ltype overlay ltype (barscale, legend)
@param command GRASS command to render overlay
- @param l_active overlay activated (True) or disabled (False)
- @param l_hidden overlay is not shown in layer tree (if True)
- @param l_render render an image (if True)
+ @param active overlay activated (True) or disabled (False)
+ @param hidden overlay is not shown in layer tree (if True)
+ @param render render an image (if True)
@return new layer on success
"""
overlay = self.GetOverlay(id, list = False)
if overlay is None:
- overlay = Overlay(id, type = None, cmd = None)
+ overlay = Overlay(id, ltype = None, cmd = None)
- if 'type' in kargs:
- overlay.SetName(kargs['type']) # type -> overlay
+ if 'ltype' in kargs:
+ overlay.SetName(kargs['ltype']) # ltype -> overlay
if 'command' in kargs:
overlay.SetCmd(kargs['command'])
Modified: grass/trunk/gui/wxpython/gcp/manager.py
===================================================================
--- grass/trunk/gui/wxpython/gcp/manager.py 2012-12-29 10:45:35 UTC (rev 54454)
+++ grass/trunk/gui/wxpython/gcp/manager.py 2012-12-29 11:27:07 UTC (rev 54455)
@@ -194,8 +194,8 @@
self.SwitchEnv('source')
name, found = utils.GetLayerNameFromCmd(cmdlist)
- self.SrcMap.AddLayer(type=rendertype, command=cmdlist, l_active=True,
- name=name, l_hidden=False, l_opacity=1.0, l_render=False)
+ self.SrcMap.AddLayer(ltype=rendertype, command=cmdlist, active=True,
+ name=name, hidden=False, opacity=1.0, render=False)
self.SwitchEnv('target')
if tgt_map['raster']:
@@ -206,8 +206,8 @@
cmdlist = ['d.rast', 'map=%s' % tgt_map['raster']]
name, found = utils.GetLayerNameFromCmd(cmdlist)
- self.TgtMap.AddLayer(type=rendertype, command=cmdlist, l_active=True,
- name=name, l_hidden=False, l_opacity=1.0, l_render=False)
+ self.TgtMap.AddLayer(ltype=rendertype, command=cmdlist, active=True,
+ name=name, hidden=False, opacity=1.0, render=False)
if tgt_map['vector']:
#
@@ -217,8 +217,8 @@
cmdlist = ['d.vect', 'map=%s' % tgt_map['vector']]
name, found = utils.GetLayerNameFromCmd(cmdlist)
- self.TgtMap.AddLayer(type=rendertype, command=cmdlist, l_active=True,
- name=name, l_hidden=False, l_opacity=1.0, l_render=False)
+ self.TgtMap.AddLayer(ltype=rendertype, command=cmdlist, active=True,
+ name=name, hidden=False, opacity=1.0, render=False)
#
# start GCP Manager
@@ -2765,8 +2765,8 @@
srcrenderVector = True
self.parent.grwiz.SwitchEnv('source')
name, found = utils.GetLayerNameFromCmd(cmdlist)
- self.parent.grwiz.SrcMap.AddLayer(type=maptype, command=cmdlist, l_active=True,
- name=name, l_hidden=False, l_opacity=1.0, l_render=False)
+ self.parent.grwiz.SrcMap.AddLayer(ltype=maptype, command=cmdlist, active=True,
+ name=name, hidden=False, opacity=1.0, render=False)
self.parent.grwiz.SwitchEnv('target')
@@ -2786,16 +2786,16 @@
if tgt_map['raster'] != '':
cmdlist = ['d.rast', 'map=%s' % tgt_map['raster']]
name, found = utils.GetLayerNameFromCmd(cmdlist)
- self.parent.grwiz.TgtMap.AddLayer(type='raster', command=cmdlist, l_active=True,
- name=name, l_hidden=False, l_opacity=1.0, l_render=False)
+ self.parent.grwiz.TgtMap.AddLayer(ltype='raster', command=cmdlist, active=True,
+ name=name, hidden=False, opacity=1.0, render=False)
tgtrender = True
if tgt_map['vector'] != '':
cmdlist = ['d.vect', 'map=%s' % tgt_map['vector']]
name, found = utils.GetLayerNameFromCmd(cmdlist)
- self.parent.grwiz.TgtMap.AddLayer(type='vector', command=cmdlist, l_active=True,
- name=name, l_hidden=False, l_opacity=1.0, l_render=False)
+ self.parent.grwiz.TgtMap.AddLayer(ltype='vector', command=cmdlist, active=True,
+ name=name, hidden=False, opacity=1.0, render=False)
tgtrenderVector = True
Modified: grass/trunk/gui/wxpython/gcp/mapdisplay.py
===================================================================
--- grass/trunk/gui/wxpython/gcp/mapdisplay.py 2012-12-29 10:45:35 UTC (rev 54454)
+++ grass/trunk/gui/wxpython/gcp/mapdisplay.py 2012-12-29 11:27:07 UTC (rev 54455)
@@ -290,7 +290,7 @@
"""
# FIXME: remove qlayer code or use RemoveQueryLayer() now in mapdisp.frame
# delete tmp map layers (queries)
- qlayer = self.Map.GetListOfLayers(l_name=globalvar.QUERYLAYER)
+ qlayer = self.Map.GetListOfLayers(name=globalvar.QUERYLAYER)
for layer in qlayer:
self.Map.DeleteLayer(layer)
Modified: grass/trunk/gui/wxpython/gui_core/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/dialogs.py 2012-12-29 10:45:35 UTC (rev 54454)
+++ grass/trunk/gui/wxpython/gui_core/dialogs.py 2012-12-29 11:27:07 UTC (rev 54455)
@@ -665,9 +665,9 @@
def _createOverlay(self):
"""!Creates overlay"""
if not self.parent.GetMap().GetOverlay(self.ovlId):
- self.newOverlay = self.parent.Map.AddOverlay(id = self.ovlId, type = self.name,
+ self.newOverlay = self.parent.Map.AddOverlay(id = self.ovlId, ltype = self.name,
command = self.cmd,
- l_active = False, l_render = False, l_hidden = True)
+ active = False, render = False, hidden = True)
prop = { 'layer' : self.newOverlay,
'params' : None,
'propwin' : None,
@@ -751,10 +751,10 @@
except ValueError:
pass
- self.parent.Map.ChangeOverlay(id = self.ovlId, type = self.name,
+ self.parent.Map.ChangeOverlay(id = self.ovlId, ltype = self.name,
command = self.parent.MapWindow.overlays[self.ovlId]['cmd'],
- l_active = self.parent.MapWindow.overlays[self.ovlId]['layer'].IsActive(),
- l_render = False, l_hidden = True)
+ active = self.parent.MapWindow.overlays[self.ovlId]['layer'].IsActive(),
+ render = False, hidden = True)
if self.name == 'legend':
if params and not self.btnOK.IsEnabled():
self.btnOK.Enable()
Modified: grass/trunk/gui/wxpython/iclass/frame.py
===================================================================
--- grass/trunk/gui/wxpython/iclass/frame.py 2012-12-29 10:45:35 UTC (rev 54454)
+++ grass/trunk/gui/wxpython/iclass/frame.py 2012-12-29 11:27:07 UTC (rev 54455)
@@ -808,12 +808,12 @@
"""!Add raster map to Map"""
cmdlist = ['d.rast', 'map=%s' % name]
if firstMap:
- self.GetFirstMap().AddLayer(type='raster', command=cmdlist, l_active=True,
- name=name, l_hidden=False, l_opacity=1.0, l_render=False)
+ self.GetFirstMap().AddLayer(ltype='raster', command=cmdlist, active=True,
+ name=name, hidden=False, opacity=1.0, render=False)
self.Render(self.GetFirstWindow())
if secondMap:
- self.GetSecondMap().AddLayer(type='raster', command=cmdlist, l_active=True,
- name=name, l_hidden=False, l_opacity=1.0, l_render=False)
+ self.GetSecondMap().AddLayer(ltype='raster', command=cmdlist, active=True,
+ name=name, hidden=False, opacity=1.0, render=False)
self.Render(self.GetSecondWindow())
def AddTrainingAreaMap(self):
@@ -826,9 +826,9 @@
GMessage(parent = self, message = _("Failed to create temporary vector map."))
return
- mapLayer = self.GetFirstMap().AddLayer(type = 'vector',
+ mapLayer = self.GetFirstMap().AddLayer(ltype = 'vector',
command = ['d.vect', 'map=%s' % vname],
- name = vname, l_active = False)
+ name = vname, active = False)
self.toolbars['vdigit'].StartEditing(mapLayer)
self.poMapInfo = self.GetFirstWindow().digit.GetDisplay().poMapInfo
@@ -1105,13 +1105,13 @@
@param 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(l_name = name)]):
+ name in [l.GetName() for l in self.map.GetListOfLayers(name = name)]):
self.frame.Render(self.mapWindow)
return
cmdlist = ['d.rast', 'map=%s' % name]
- self.map.AddLayer(type = 'raster', command = cmdlist, l_active = True,
- name = name, l_hidden = False, l_opacity = 1.0, l_render = True)
+ self.map.AddLayer(ltype = 'raster', command = cmdlist, active = True,
+ name = name, hidden = False, opacity = 1.0, render = True)
self.frame.Render(self.mapWindow)
if alias is not None:
@@ -1134,8 +1134,8 @@
if '=' in param:
name.append(param.split('=')[1])
name = ','.join(name)
- self.map.AddLayer(type = 'rgb', command = cmd, l_active = True,
- name = name, l_hidden = False, l_opacity = 1.0, l_render = True)
+ self.map.AddLayer(ltype = 'rgb', command = cmd, active = True,
+ name = name, hidden = False, opacity = 1.0, render = True)
self.frame.Render(self.mapWindow)
self.layerName[name] = name
self.toolbar.choice.Insert(name, 0)
@@ -1147,7 +1147,7 @@
@param name real name of layer
"""
# check if layer is loaded
- layers = self.map.GetListOfLayers(l_type = 'raster')
+ layers = self.map.GetListOfLayers(ltype = 'raster')
idx = None
for i, layer in enumerate(layers):
if name == layer.GetName():
@@ -1186,8 +1186,8 @@
def SelectLayer(self, name):
"""!Moves selected layer to top"""
- layers = self.map.GetListOfLayers(l_type = 'raster') + \
- self.map.GetListOfLayers(l_type = 'rgb')
+ layers = self.map.GetListOfLayers(ltype = 'raster') + \
+ self.map.GetListOfLayers(ltype = 'rgb')
idx = None
for i, layer in enumerate(layers):
if self.layerName[name] == layer.GetName():
@@ -1210,7 +1210,7 @@
def SetOpacity(self, name):
"""!Sets opacity of layers."""
name = self.layerName[name]
- layers = self.map.GetListOfLayers(l_name = name)
+ layers = self.map.GetListOfLayers(name = name)
if not layers:
return
@@ -1219,7 +1219,7 @@
dlg = SetOpacityDialog(self.frame, opacity = oldOpacity)
if dlg.ShowModal() == wx.ID_OK:
- self.map.ChangeOpacity(layer = layers[0], l_opacity = dlg.GetOpacity())
+ self.map.ChangeOpacity(layer = layers[0], opacity = dlg.GetOpacity())
dlg.Destroy()
Modified: grass/trunk/gui/wxpython/lmgr/frame.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/frame.py 2012-12-29 10:45:35 UTC (rev 54454)
+++ grass/trunk/gui/wxpython/lmgr/frame.py 2012-12-29 11:27:07 UTC (rev 54455)
@@ -1716,7 +1716,7 @@
else:
display = self.GetMapDisplay()
mapLayers = map(lambda x: x.GetName(),
- display.GetMap().GetListOfLayers(l_type = ltype))
+ display.GetMap().GetListOfLayers(ltype = ltype))
if mapName in mapLayers:
display.GetWindow().UpdateMap(render = True)
else:
Modified: grass/trunk/gui/wxpython/lmgr/layertree.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/layertree.py 2012-12-29 10:45:35 UTC (rev 54454)
+++ grass/trunk/gui/wxpython/lmgr/layertree.py 2012-12-29 11:27:07 UTC (rev 54455)
@@ -998,9 +998,9 @@
pos = -1
maplayer = self.Map.AddLayer(pos = pos,
- type = ltype, command = self.GetLayerInfo(prevItem, key = 'cmd'), name = name,
- l_active = checked, l_hidden = False,
- l_opacity = lopacity, l_render = render)
+ ltype = ltype, command = self.GetLayerInfo(prevItem, key = 'cmd'), name = name,
+ active = checked, hidden = False,
+ opacity = lopacity, render = render)
self.SetLayerInfo(layer, key = 'maplayer', value = maplayer)
# run properties dialog if no properties given
@@ -1550,8 +1550,8 @@
mapWin.LoadVector(layer)
# reset view when first layer loaded
- nlayers = len(mapWin.Map.GetListOfLayers(l_type = ('raster', '3d-raster', 'vector'),
- l_active = True))
+ nlayers = len(mapWin.Map.GetListOfLayers(ltype = ('raster', '3d-raster', 'vector'),
+ active = True))
if nlayers < 2:
mapWin.ResetView()
@@ -1616,7 +1616,7 @@
maplayer = self.Map.ChangeLayer(layer = self.GetLayerInfo(item, key = 'maplayer'), type = type,
command = cmdlist, name = layerName,
- l_active = chk, l_hidden = hidden, l_opacity = opac, l_render = False)
+ active = chk, hidden = hidden, opacity = opac, render = False)
self.SetLayerInfo(item, key = 'maplayer', value = maplayer)
Modified: grass/trunk/gui/wxpython/mapdisp/frame.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/frame.py 2012-12-29 10:45:35 UTC (rev 54454)
+++ grass/trunk/gui/wxpython/mapdisp/frame.py 2012-12-29 11:27:07 UTC (rev 54455)
@@ -444,7 +444,7 @@
def RemoveQueryLayer(self):
"""!Removes temporary map layers (queries)"""
- qlayer = self.GetMap().GetListOfLayers(l_name = globalvar.QUERYLAYER)
+ qlayer = self.GetMap().GetListOfLayers(name = globalvar.QUERYLAYER)
for layer in qlayer:
self.GetMap().DeleteLayer(layer)
@@ -816,7 +816,7 @@
qlayer = None
if not self.IsPaneShown('3d') and self.IsAutoRendered():
try:
- qlayer = self.Map.GetListOfLayers(l_name = globalvar.QUERYLAYER)[0]
+ qlayer = self.Map.GetListOfLayers(name = globalvar.QUERYLAYER)[0]
except IndexError:
pass
@@ -908,11 +908,11 @@
if addLayer:
if useId:
- return self.Map.AddLayer(type = 'vector', name = globalvar.QUERYLAYER, command = cmd,
- l_active = True, l_hidden = True, l_opacity = 1.0)
+ return self.Map.AddLayer(ltype = 'vector', name = globalvar.QUERYLAYER, command = cmd,
+ active = True, hidden = True, opacity = 1.0)
else:
- return self.Map.AddLayer(type = 'command', name = globalvar.QUERYLAYER, command = cmd,
- l_active = True, l_hidden = True, l_opacity = 1.0)
+ return self.Map.AddLayer(ltype = 'command', name = globalvar.QUERYLAYER, command = cmd,
+ active = True, hidden = True, opacity = 1.0)
else:
return cmd
@@ -1244,7 +1244,7 @@
# Reset comand and rendering options in render.Map. Always render decoration.
# Showing/hiding handled by PseudoDC
self.Map.ChangeOverlay(ovltype = type, type = 'overlay', name = '', command = dcmd,
- l_active = True, l_render = False)
+ active = True, render = False)
self.params[type] = params
self.propwin[type] = propwin
@@ -1254,7 +1254,7 @@
"""
layers = None
if self.IsStandalone():
- layers = self.MapWindow.GetMap().GetListOfLayers(l_active = False)
+ layers = self.MapWindow.GetMap().GetListOfLayers(active = False)
self.MapWindow.ZoomToMap(layers = layers)
Modified: grass/trunk/gui/wxpython/mapdisp/main.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/main.py 2012-12-29 10:45:35 UTC (rev 54454)
+++ grass/trunk/gui/wxpython/mapdisp/main.py 2012-12-29 11:27:07 UTC (rev 54455)
@@ -98,7 +98,7 @@
name = utils.GetLayerNameFromCmd(cmd, fullyQualified = True,
layerType = ltype)[0]
- self.AddLayer(type = ltype, command = cmd, l_active = False, name = name)
+ self.AddLayer(ltype = ltype, command = cmd, active = False, name = name)
nlayers += 1
except IOError, e:
grass.warning(_("Unable to read cmdfile '%(cmd)s'. Details: %(det)s") % \
Modified: grass/trunk/gui/wxpython/mapdisp/mapwindow.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/mapwindow.py 2012-12-29 10:45:35 UTC (rev 54454)
+++ grass/trunk/gui/wxpython/mapdisp/mapwindow.py 2012-12-29 11:27:07 UTC (rev 54455)
@@ -528,7 +528,7 @@
@return list of images
"""
imgs = []
- for overlay in self.Map.GetListOfLayers(l_type = "overlay", l_active = True):
+ for overlay in self.Map.GetListOfLayers(ltype = "overlay", active = True):
if overlay.mapfile is not None \
and os.path.isfile(overlay.mapfile) and os.path.getsize(overlay.mapfile):
img = wx.Image(overlay.mapfile, wx.BITMAP_TYPE_ANY)
@@ -759,7 +759,7 @@
self.Draw(self.pdcDec, pdctype = 'clear')
self.Draw(self.pdcTmp, pdctype = 'clear')
- for layer in self.Map.GetListOfLayers(l_active = True):
+ for layer in self.Map.GetListOfLayers(active = True):
layer.AbortDownload()
def DragMap(self, moveto):
Modified: grass/trunk/gui/wxpython/mapdisp/statusbar.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/statusbar.py 2012-12-29 10:45:35 UTC (rev 54454)
+++ grass/trunk/gui/wxpython/mapdisp/statusbar.py 2012-12-29 11:27:07 UTC (rev 54455)
@@ -1001,7 +1001,7 @@
self.maps[map] = {'progresVal' : 0, # current progress value
'downloading' : [], # layers, which are downloading data
'rendered' : [], # already rendered layers
- 'range' : len(map.GetListOfLayers(l_active = True))}
+ 'range' : len(map.GetListOfLayers(active = True))}
else:
if layer not in self.maps[map]['rendered']:
self.maps[map]['rendered'].append(layer)
Modified: grass/trunk/gui/wxpython/mapswipe/frame.py
===================================================================
--- grass/trunk/gui/wxpython/mapswipe/frame.py 2012-12-29 10:45:35 UTC (rev 54454)
+++ grass/trunk/gui/wxpython/mapswipe/frame.py 2012-12-29 11:27:07 UTC (rev 54455)
@@ -342,9 +342,9 @@
mapInstance.DeleteAllLayers()
cmdlist = ['d.rast', 'map=%s' % name]
# add layer to Map instance (core.render)
- newLayer = mapInstance.AddLayer(type = 'raster', command = cmdlist, l_active = True,
- name = name, l_hidden = False, l_opacity = 1.0,
- l_render = True)
+ newLayer = mapInstance.AddLayer(ltype = 'raster', command = cmdlist, active = True,
+ name = name, hidden = False, opacity = 1.0,
+ render = True)
def OnSwitchWindows(self, event):
"""!Switch windows position."""
Modified: grass/trunk/gui/wxpython/modules/colorrules.py
===================================================================
--- grass/trunk/gui/wxpython/modules/colorrules.py 2012-12-29 10:45:35 UTC (rev 54454)
+++ grass/trunk/gui/wxpython/modules/colorrules.py 2012-12-29 11:27:07 UTC (rev 54455)
@@ -746,9 +746,9 @@
"""!Update preview (based on computational region)"""
if not self.layer:
- self.layer = self.Map.AddLayer(type = ltype, name = 'preview', command = cmdlist,
- l_active = True, l_hidden = False, l_opacity = 1.0,
- l_render = False)
+ self.layer = self.Map.AddLayer(ltype = ltype, name = 'preview', command = cmdlist,
+ active = True, hidden = False, opacity = 1.0,
+ render = False)
else:
self.layer.SetCmd(cmdlist)
Modified: grass/trunk/gui/wxpython/modules/histogram.py
===================================================================
--- grass/trunk/gui/wxpython/modules/histogram.py 2012-12-29 10:45:35 UTC (rev 54454)
+++ grass/trunk/gui/wxpython/modules/histogram.py 2012-12-29 11:27:07 UTC (rev 54455)
@@ -310,8 +310,8 @@
self.printopt = PrintOptions(self, self.HistWindow)
# Add layer to the map
- self.layer = self.Map.AddLayer(type = "command", name = 'histogram', command = [['d.histogram']],
- l_active = False, l_hidden = False, l_opacity = 1, l_render = False)
+ self.layer = self.Map.AddLayer(ltype = "command", name = 'histogram', command = [['d.histogram']],
+ active = False, hidden = False, opacity = 1, render = False)
if self.mapname:
self.SetHistLayer(self.mapname, None)
else:
Modified: grass/trunk/gui/wxpython/modules/mcalc_builder.py
===================================================================
--- grass/trunk/gui/wxpython/modules/mcalc_builder.py 2012-12-29 10:45:35 UTC (rev 54454)
+++ grass/trunk/gui/wxpython/modules/mcalc_builder.py 2012-12-29 11:27:07 UTC (rev 54455)
@@ -514,7 +514,7 @@
return
name = self.newmaptxt.GetValue().strip(' "') + '@' + grass.gisenv()['MAPSET']
mapTree = self.parent.GetLayerTree()
- if not mapTree.GetMap().GetListOfLayers(l_name = name):
+ if not mapTree.GetMap().GetListOfLayers(name = name):
mapTree.AddLayer(ltype = 'raster',
lname = name,
lcmd = ['d.rast', 'map=%s' % name],
Modified: grass/trunk/gui/wxpython/nviz/tools.py
===================================================================
--- grass/trunk/gui/wxpython/nviz/tools.py 2012-12-29 10:45:35 UTC (rev 54454)
+++ grass/trunk/gui/wxpython/nviz/tools.py 2012-12-29 11:27:07 UTC (rev 54455)
@@ -128,10 +128,10 @@
def SetInitialMaps(self):
"""!Set initial raster and vector map"""
- for l_type in ('raster', 'vector', '3d-raster'):
+ for ltype in ('raster', 'vector', '3d-raster'):
selectedLayer = self.parent.GetLayerTree().GetSelectedLayer(multi = False, checkedOnly = True)
selectedLayer = self.parent.GetLayerTree().GetLayerInfo(selectedLayer, key = 'maplayer')
- layers = self.mapWindow.Map.GetListOfLayers(l_type = l_type, l_active = True)
+ layers = self.mapWindow.Map.GetListOfLayers(ltype = ltype, active = True)
if selectedLayer in layers:
selection = selectedLayer.GetName()
else:
@@ -139,12 +139,12 @@
selection = layers[0].GetName()
except:
continue
- if l_type == 'raster':
+ if ltype == 'raster':
self.FindWindowById(self.win['surface']['map']).SetValue(selection)
self.FindWindowById(self.win['fringe']['map']).SetValue(selection)
- elif l_type == 'vector':
+ elif ltype == 'vector':
self.FindWindowById(self.win['vector']['map']).SetValue(selection)
- elif l_type == '3d-raster':
+ elif ltype == '3d-raster':
self.FindWindowById(self.win['volume']['map']).SetValue(selection)
def UpdateState(self, **kwargs):
@@ -1506,7 +1506,7 @@
def GselectOnPopup(self, ltype, exclude = False):
"""Update gselect.Select() items"""
maps = list()
- for layer in self.mapWindow.Map.GetListOfLayers(l_type = ltype, l_active = True):
+ for layer in self.mapWindow.Map.GetListOfLayers(ltype = ltype, active = True):
maps.append(layer.GetName())
return maps, exclude
@@ -2054,7 +2054,7 @@
@param name layer name
@param mapType map type (raster, vector, 3d-raster)
"""
- layers = self.mapWindow.Map.GetListOfLayers(l_type = mapType, l_name = name)
+ layers = self.mapWindow.Map.GetListOfLayers(ltype = mapType, name = name)
if layers:
return layers[0]
return None
Modified: grass/trunk/gui/wxpython/vdigit/g.gui.vdigit.py
===================================================================
--- grass/trunk/gui/wxpython/vdigit/g.gui.vdigit.py 2012-12-29 10:45:35 UTC (rev 54454)
+++ grass/trunk/gui/wxpython/vdigit/g.gui.vdigit.py 2012-12-29 11:27:07 UTC (rev 54455)
@@ -52,10 +52,10 @@
title = _("GRASS GIS Vector Digitizer"), size = (850, 600))
# load vector map
- mapLayer = self.GetMap().AddLayer(type = 'vector',
+ mapLayer = self.GetMap().AddLayer(ltype = 'vector',
command = ['d.vect', 'map=%s' % vectorMap],
- l_active = True, name = vectorMap, l_hidden = False, l_opacity = 1.0,
- l_render = True)
+ active = True, name = vectorMap, hidden = False, opacity = 1.0,
+ render = True)
# switch toolbar
self.AddToolbar('vdigit', fixed = True)
Modified: grass/trunk/gui/wxpython/vdigit/mapwindow.py
===================================================================
--- grass/trunk/gui/wxpython/vdigit/mapwindow.py 2012-12-29 10:45:35 UTC (rev 54454)
+++ grass/trunk/gui/wxpython/vdigit/mapwindow.py 2012-12-29 11:27:07 UTC (rev 54455)
@@ -755,7 +755,7 @@
'width=2']
if not self.layerTmp:
- self.layerTmp = self.Map.AddLayer(type = 'vector',
+ self.layerTmp = self.Map.AddLayer(ltype = 'vector',
name = QUERYLAYER,
command = dVectTmp)
else:
Modified: grass/trunk/gui/wxpython/vdigit/toolbars.py
===================================================================
--- grass/trunk/gui/wxpython/vdigit/toolbars.py 2012-12-29 10:45:35 UTC (rev 54454)
+++ grass/trunk/gui/wxpython/vdigit/toolbars.py 2012-12-29 11:27:07 UTC (rev 54455)
@@ -899,8 +899,8 @@
# select vector map layer in the current mapset
layerNameList = []
- self.layers = self.Map.GetListOfLayers(l_type = "vector",
- l_mapset = grass.gisenv()['MAPSET'])
+ self.layers = self.Map.GetListOfLayers(ltype = "vector",
+ mapset = grass.gisenv()['MAPSET'])
for layer in self.layers:
if not layer.name in layerNameList: # do not duplicate layer
More information about the grass-commit
mailing list