[Greater-commits] r400 - trunk/GREAT-ER/Greater/Modules

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Jul 11 12:24:03 CEST 2011


Author: bricks
Date: 2011-07-11 12:24:03 +0200 (Mon, 11 Jul 2011)
New Revision: 400

Modified:
   trunk/GREAT-ER/Greater/Modules/results.py
Log:
check if bin obj has a file_obj before trying to evaluate the
results


Modified: trunk/GREAT-ER/Greater/Modules/results.py
===================================================================
--- trunk/GREAT-ER/Greater/Modules/results.py	2011-07-11 10:22:53 UTC (rev 399)
+++ trunk/GREAT-ER/Greater/Modules/results.py	2011-07-11 10:24:03 UTC (rev 400)
@@ -81,8 +81,8 @@
 
         return "Results:", list
 
-    def _create_table_from_csv_binobj(self, object, unit_factor = 1):
-        """Create a MemoryTable from the object which must
+    def _create_table_from_csv_binobj(self, bin_obj, unit_factor = 1):
+        """Create a MemoryTable from the bin_obj which must
         be a CSV file where the first line starts with a #
         and contains the fieldnames (also comma-separated)
 
@@ -94,8 +94,12 @@
 
         Return a MemoryTable or None if something fails.
         """
-        rows = object.file_obj.split('\n')
+        file_obj = bin_obj.file_obj
+        if not file_obj:
+            return
 
+        rows = file_obj.split('\n')
+
         if len(rows) == 0:
             return None
 



More information about the Greater-commits mailing list