Explorar el Código

g.gui.tplot: fixed bug with strds and csv output

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@72529 15284696-431f-4ddb-bdfa-cd5b030d7da7
Luca Delucchi hace 7 años
padre
commit
38b1cc996f
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      gui/wxpython/tplot/frame.py

+ 2 - 2
gui/wxpython/tplot/frame.py

@@ -647,7 +647,7 @@ class TplotFrame(wx.Frame):
     def _writeCSV(self, x, y):
         """Used to write CSV file of plotted data"""
         import csv
-        if len(y) > 1:
+        if isinstance(y[0], list):
             zipped = zip(x, *y)
         else:
             zipped = zip(x, y)
@@ -661,6 +661,7 @@ class TplotFrame(wx.Frame):
         
     def drawR(self):
         ycsv = []
+        xcsv = []
         for i, name in enumerate(self.datasetsR):
             name = name[0]
             # just name; with mapset it would be long
@@ -668,7 +669,6 @@ class TplotFrame(wx.Frame):
             self.yticksPos.append(1)  # TODO
             xdata = []
             ydata = []
-            xcsv = []
             for keys, values in self.timeDataR[name].iteritems():
                 if keys in ['temporalType', 'granularity', 'validTopology',
                             'unit', 'temporalDataType']: