Browse Source

wxGUI/mapwindow: remove unused constructor parameters

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@54037 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 12 years ago
parent
commit
7446b9117e

+ 3 - 6
gui/wxpython/gui_core/mapwindow.py

@@ -36,13 +36,10 @@ class MapWindow(object):
      - Pixel2Cell
      - Cell2Pixel (if it is possible)
     """
-    def __init__(self, parent, giface, Map, frame,
-                 tree = None, lmgr = None, **kwargs):
-        self.parent = parent # MapFrame
-        self.Map    = Map
+    def __init__(self, parent, giface, Map, frame, **kwargs):
+        self.parent = parent
+        self.Map = Map
         self.frame = frame
-        self.tree   = tree
-        self.lmgr   = lmgr
         self._giface = giface
         
         # mouse attributes -- position on the screen, begin and end of

+ 2 - 1
gui/wxpython/mapdisp/mapwindow.py

@@ -55,9 +55,10 @@ class BufferedWindow(MapWindow, wx.Window):
                  id = wx.ID_ANY, tree = None, lmgr = None,
                  style = wx.NO_FULL_REPAINT_ON_RESIZE, **kwargs):
         MapWindow.__init__(self, parent = parent, giface = giface, Map = Map,
-                           frame = frame, tree = tree, lmgr = lmgr, **kwargs)
+                           frame = frame, **kwargs)
         wx.Window.__init__(self, parent = parent, id = id, style = style, **kwargs)
         
+        self.tree = tree
         # flags
         self.resize = False # indicates whether or not a resize event has taken place
         self.dragimg = None # initialize variable for map panning

+ 2 - 2
gui/wxpython/mapswipe/mapwindow.py

@@ -36,9 +36,9 @@ class SwipeBufferedWindow(BufferedWindow):
     Special mouse events with changed coordinates are used.
     """
     def __init__(self, parent, giface, Map, frame,
-                 tree = None, lmgr = None, **kwargs):
+                 tree = None, **kwargs):
         BufferedWindow.__init__(self, parent = parent, giface = giface,
-                                Map = Map, frame = frame, tree = tree, lmgr = lmgr, **kwargs)
+                                Map = Map, frame = frame, tree = tree, **kwargs)
         Debug.msg(2, "SwipeBufferedWindow.__init__()")
 
         self.specialSize = super(SwipeBufferedWindow, self).GetClientSize()

+ 4 - 2
gui/wxpython/nviz/mapwindow.py

@@ -70,10 +70,12 @@ class GLWindow(MapWindow, glcanvas.GLCanvas):
     def __init__(self, parent, giface, id = wx.ID_ANY, frame = None,
                  Map = None, tree = None, lmgr = None):
         self.parent = parent # MapFrame
-        
+        self.tree = tree
+        self.lmgr = lmgr
+
         glcanvas.GLCanvas.__init__(self, parent, id)
         MapWindow.__init__(self, parent = parent, giface = giface, frame = frame,
-                           Map = Map, tree = tree, lmgr = lmgr)
+                           Map = Map)
         self.Hide()
         
         self.init = False

+ 2 - 0
gui/wxpython/nviz/tools.py

@@ -2057,6 +2057,8 @@ class NvizToolWindow(FN.FlatNotebook):
         """
         tree = self.parent.GetLayerTree()
         items = tree.FindItemByData(key = 'name', value = name)
+        if not items:
+            return None
         for item in items:
             if tree.GetLayerInfo(item, key = 'type') == mapType:
                 return tree.GetLayerInfo(item, key = 'nviz')

+ 2 - 2
gui/wxpython/vdigit/mapwindow.py

@@ -32,8 +32,8 @@ class VDigitWindow(BufferedWindow):
                  id = wx.ID_ANY, tree = None, lmgr = None,
                  style = wx.NO_FULL_REPAINT_ON_RESIZE, **kwargs):
         BufferedWindow.__init__(self, parent = parent, giface = giface, id = id, Map = Map,
-                                frame = frame, tree = tree, lmgr = lmgr, style = style, **kwargs)
-        
+                                frame = frame, tree = tree, style = style, **kwargs)
+        self.lmgr = lmgr
         self.pdcVector = wx.PseudoDC()
         self.toolbar   = self.parent.GetToolbar('vdigit')
         self.digit     = None # wxvdigit.IVDigit