Преглед изворни кода

wxGUI: fix python -3 compilation warnings

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@57221 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová пре 11 година
родитељ
комит
834da79eed

+ 3 - 3
gui/wxpython/core/render.py

@@ -579,14 +579,14 @@ class Map(object):
             self.region['n'] = min(self.region['n'], 90.0)
             self.region['s'] = max(self.region['s'], -90.0)
         
-    def ChangeMapSize(self, (width, height)):
+    def ChangeMapSize(self, size):
         """!Change size of rendered map.
         
         @param width,height map size given as tuple
         """
         try:
-            self.width  = int(width)
-            self.height = int(height)
+            self.width  = int(size[0])
+            self.height = int(size[1])
             if self.width < 1 or self.height < 1:
                 sys.stderr.write(_("Invalid map size %d,%d\n") % (self.width, self.height))
                 raise ValueError

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

@@ -212,10 +212,10 @@ class MapWindow(object):
         
         return True
     
-    def Pixel2Cell(self, (x, y)):
+    def Pixel2Cell(self, xyCoords):
         raise NotImplementedError()
     
-    def Cell2Pixel(self, (east, north)):
+    def Cell2Pixel(self, enCoords):
         raise NotImplementedError()
 
     def OnMotion(self, event):

+ 6 - 6
gui/wxpython/mapdisp/mapwindow.py

@@ -1361,7 +1361,7 @@ class BufferedWindow(MapWindow, wx.Window):
         
         return True
 
-    def Pixel2Cell(self, (x, y)):
+    def Pixel2Cell(self, xyCoords):
         """!Convert image coordinates to real word coordinates
         
         @param x, y image coordinates
@@ -1370,8 +1370,8 @@ class BufferedWindow(MapWindow, wx.Window):
         @return None on error
         """
         try:
-            x = int(x)
-            y = int(y)
+            x = int(xyCoords[0])
+            y = int(xyCoords[1])
         except:
             return None
         
@@ -1388,12 +1388,12 @@ class BufferedWindow(MapWindow, wx.Window):
         
         return (east, north)
     
-    def Cell2Pixel(self, (east, north)):
+    def Cell2Pixel(self, enCoords):
         """!Convert real word coordinates to image coordinates
         """
         try:
-            east  = float(east)
-            north = float(north)
+            east  = float(enCoords[0])
+            north = float(enCoords[1])
         except:
             return None
         

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

@@ -749,7 +749,7 @@ class GLWindow(MapWindow, glcanvas.GLCanvas):
                 
         event.Skip()
             
-    def Pixel2Cell(self, (x, y)):
+    def Pixel2Cell(self, xyCoords):
         """!Convert image coordinates to real word coordinates
 
         @param x, y image coordinates
@@ -759,6 +759,7 @@ class GLWindow(MapWindow, glcanvas.GLCanvas):
         """
         size = self.GetClientSize()
         # UL -> LL
+        x, y = xyCoords
         sid, x, y, z = self._display.GetPointOnSurface(x, size[1] - y)
         
         if not sid: