[GRASS-SVN] r57221 - in grass/trunk/gui/wxpython: core gui_core mapdisp nviz

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jul 18 10:22:56 PDT 2013


Author: annakrat
Date: 2013-07-18 10:22:56 -0700 (Thu, 18 Jul 2013)
New Revision: 57221

Modified:
   grass/trunk/gui/wxpython/core/render.py
   grass/trunk/gui/wxpython/gui_core/mapwindow.py
   grass/trunk/gui/wxpython/mapdisp/mapwindow.py
   grass/trunk/gui/wxpython/nviz/mapwindow.py
Log:
wxGUI: fix python -3 compilation warnings

Modified: grass/trunk/gui/wxpython/core/render.py
===================================================================
--- grass/trunk/gui/wxpython/core/render.py	2013-07-18 17:01:39 UTC (rev 57220)
+++ grass/trunk/gui/wxpython/core/render.py	2013-07-18 17:22:56 UTC (rev 57221)
@@ -579,14 +579,14 @@
             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

Modified: grass/trunk/gui/wxpython/gui_core/mapwindow.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/mapwindow.py	2013-07-18 17:01:39 UTC (rev 57220)
+++ grass/trunk/gui/wxpython/gui_core/mapwindow.py	2013-07-18 17:22:56 UTC (rev 57221)
@@ -212,10 +212,10 @@
         
         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):

Modified: grass/trunk/gui/wxpython/mapdisp/mapwindow.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/mapwindow.py	2013-07-18 17:01:39 UTC (rev 57220)
+++ grass/trunk/gui/wxpython/mapdisp/mapwindow.py	2013-07-18 17:22:56 UTC (rev 57221)
@@ -1361,7 +1361,7 @@
         
         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 @@
         @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 @@
         
         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
         

Modified: grass/trunk/gui/wxpython/nviz/mapwindow.py
===================================================================
--- grass/trunk/gui/wxpython/nviz/mapwindow.py	2013-07-18 17:01:39 UTC (rev 57220)
+++ grass/trunk/gui/wxpython/nviz/mapwindow.py	2013-07-18 17:22:56 UTC (rev 57221)
@@ -749,7 +749,7 @@
                 
         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 @@
         """
         size = self.GetClientSize()
         # UL -> LL
+        x, y = xyCoords
         sid, x, y, z = self._display.GetPointOnSurface(x, size[1] - y)
         
         if not sid:



More information about the grass-commit mailing list