[Greater-commits] r3666 - in branches/3.0.0-all-models/GREAT-ER: . Greater/Modules

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Jul 25 16:18:34 CEST 2011


Author: aheinecke
Date: 2011-07-25 16:18:33 +0200 (Mon, 25 Jul 2011)
New Revision: 3666

Modified:
   branches/3.0.0-all-models/GREAT-ER/
   branches/3.0.0-all-models/GREAT-ER/ChangeLog
   branches/3.0.0-all-models/GREAT-ER/Greater/Modules/results.py
Log:
Merged revisions 400 via svnmerge from 
svn+ssh://wald.intevation.org/greater/trunk/GREAT-ER

........
  r400 | bricks | 2011-07-11 12:24:03 +0200 (Mon, 11 Jul 2011) | 3 lines
  
  check if bin obj has a file_obj before trying to evaluate the
  results
........



Property changes on: branches/3.0.0-all-models/GREAT-ER
___________________________________________________________________
Name: svnmerge-integrated
   - /trunk/GREAT-ER:1-232,310,312-315,319,322,327,333,335,340-344,346-347,368,375,397-398
   + /trunk/GREAT-ER:1-232,310,312-315,319,322,327,333,335,340-344,346-347,368,375,397-398,400

Modified: branches/3.0.0-all-models/GREAT-ER/ChangeLog
===================================================================
--- branches/3.0.0-all-models/GREAT-ER/ChangeLog	2011-07-25 14:15:20 UTC (rev 3665)
+++ branches/3.0.0-all-models/GREAT-ER/ChangeLog	2011-07-25 14:18:33 UTC (rev 3666)
@@ -36,6 +36,7 @@
 		  this fixes and exception during load.
 	* Greater/Modules/results.py:
 		- Fix typo
+		- Check if a binary object has a file_obj before accessing it
 
 2006-05-10  Frank Koormann   <frank at intevation.de>
 

Modified: branches/3.0.0-all-models/GREAT-ER/Greater/Modules/results.py
===================================================================
--- branches/3.0.0-all-models/GREAT-ER/Greater/Modules/results.py	2011-07-25 14:15:20 UTC (rev 3665)
+++ branches/3.0.0-all-models/GREAT-ER/Greater/Modules/results.py	2011-07-25 14:18:33 UTC (rev 3666)
@@ -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