[GRASS-SVN] r74102 - in grass/trunk/gui/wxpython: iscatt tplot

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Feb 17 14:32:26 PST 2019


Author: annakrat
Date: 2019-02-17 14:32:26 -0800 (Sun, 17 Feb 2019)
New Revision: 74102

Modified:
   grass/trunk/gui/wxpython/iscatt/plots.py
   grass/trunk/gui/wxpython/tplot/frame.py
Log:
wxGUI: fix using zip function in Python 3

Modified: grass/trunk/gui/wxpython/iscatt/plots.py
===================================================================
--- grass/trunk/gui/wxpython/iscatt/plots.py	2019-02-17 20:53:15 UTC (rev 74101)
+++ grass/trunk/gui/wxpython/iscatt/plots.py	2019-02-17 22:32:26 UTC (rev 74102)
@@ -836,7 +836,7 @@
             coords.append(tup)
 
         self.pol.xy = coords
-        self.line.set_data(zip(*self.pol.xy))
+        self.line.set_data(list(zip(*self.pol.xy)))
 
         self.Redraw()
 
@@ -856,7 +856,7 @@
                     list(self.pol.xy[:i + 1]) +
                     [(event.xdata, event.ydata)] +
                     list(self.pol.xy[i + 1:]))
-                self.line.set_data(zip(*self.pol.xy))
+                self.line.set_data(list(zip(*self.pol.xy)))
                 break
 
         self.Redraw()
@@ -874,7 +874,7 @@
                 list(self.pol.xy[1:]) +
                 [(event.xdata, event.ydata)])
 
-        self.line.set_data(zip(*self.pol.xy))
+        self.line.set_data(list(zip(*self.pol.xy)))
 
         self.Redraw()
 
@@ -903,7 +903,7 @@
         elif self.moving_ver_idx == len(self.pol.xy) - 1:
             self.pol.xy[0] = x, y
 
-        self.line.set_data(zip(*self.pol.xy))
+        self.line.set_data(list(zip(*self.pol.xy)))
 
         self.canvas.restore_region(self.background)
 

Modified: grass/trunk/gui/wxpython/tplot/frame.py
===================================================================
--- grass/trunk/gui/wxpython/tplot/frame.py	2019-02-17 20:53:15 UTC (rev 74101)
+++ grass/trunk/gui/wxpython/tplot/frame.py	2019-02-17 22:32:26 UTC (rev 74102)
@@ -650,9 +650,9 @@
         """Used to write CSV file of plotted data"""
         import csv
         if isinstance(y[0], list):
-            zipped = zip(x, *y)
+            zipped = list(zip(x, *y))
         else:
-            zipped = zip(x, y)
+            zipped = list(zip(x, y))
         with open(self.csvpath, "wb") as fi:
             writer = csv.writer(fi)
             if self.header:
@@ -1186,7 +1186,7 @@
                 x = xData[np.argmin(abs(xData - x))]
 
             info = self.lookUp.GetInformation(x)
-            ys = zip(*info[1].values())[1]
+            ys = list(zip(*info[1].values()))[1]
             if not info:
                 return
             # Update the annotation in the current axis..



More information about the grass-commit mailing list