dabo Commit
Revision 6023
Date: 2010-09-22 14:03:04 -0700 (Wed, 22 Sep 2010)
Author: Paul
Trac: http://trac.dabodev.com/changeset/6023

Changed:
U   trunk/dabo/lib/reportWriter.py

Log:
This fixes the recursion warnings we started receiving in python 2.6, as well 
as Jacek's 
recursion problem in python 2.5.4 per ticket #1381.

Thanks Jacek for finding this. I fixed it by initializing attributes referenced 
in __getattr__
to None or {}.



Diff:
Modified: trunk/dabo/lib/reportWriter.py
===================================================================
--- trunk/dabo/lib/reportWriter.py      2010-09-21 12:07:20 UTC (rev 6022)
+++ trunk/dabo/lib/reportWriter.py      2010-09-22 21:03:04 UTC (rev 6023)
@@ -318,9 +318,10 @@
 
 
        def _getRecord(self):
-               if hasattr(self.Report, "_liveRecord"):
-                       return self.Report._liveRecord
-               return {}
+               if self.Report.reportWriter is not None:
+                       if hasattr(self.Report, "_liveRecord"):
+                               return self.Report._liveRecord
+               return CaselessDict()
 
 
        def _getReport(self):
@@ -331,6 +332,9 @@
 
 
        def _getVariables(self):
+               rw = self.Report.reportWriter
+               if rw is None:
+                       return CaselessDict()
                return self.Report.reportWriter.Variables
 
 
@@ -418,6 +422,10 @@
 class Report(ReportObject):
        """Represents the report."""
 
+       def __init__(self, *args, **kwargs):
+               self.reportWriter = None
+               super(Report, self).__init__(*args, **kwargs)
+
        def initAvailableProps(self):
                super(Report, self).initAvailableProps()
 



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to