dabo Commit
Revision 6075
Date: 2010-10-05 14:47:01 -0700 (Tue, 05 Oct 2010)
Author: Paul
Trac: http://trac.dabodev.com/changeset/6075

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

Log:
Added NoneDisplay to reportWriter, thanks to patch submitted by Jacek.


Diff:
Modified: trunk/dabo/lib/reportWriter.py
===================================================================
--- trunk/dabo/lib/reportWriter.py      2010-10-05 17:31:04 UTC (rev 6074)
+++ trunk/dabo/lib/reportWriter.py      2010-10-05 21:47:01 UTC (rev 6075)
@@ -48,6 +48,7 @@
 import reportlab.lib.styles as styles
 import reportlab.platypus as platypus
 #import reportlab.lib.colors as colors
+import dabo
 from dabo import getEncoding
 from dabo.lib.xmltodict import xmltodict
 from dabo.lib.xmltodict import dicttoxml
@@ -1328,6 +1329,8 @@
                        else:
                                s = obj.getProp("expr", returnException=True)
 
+                       if s is None:
+                               s = self.NoneDisplay
                        if isinstance(s, basestring):
                                try:
                                        s = s.encode(self.Encoding)
@@ -2532,6 +2535,19 @@
                self._homeDirectory = val
 
 
+       def _getNoneDisplay(self):
+               ret = getattr(self, "_noneDisplay", None)
+               if ret is None:
+                       try:
+                               ret = dabo.dAppRef.NoneDisplay
+                       except AttributeError:
+                               ret = _("< None >")
+               return ret
+ 
+       def _setNoneDisplay(self, val):
+               self._noneDisplay = val
+
+
        def _getPrintStatus(self):
                try:
                        v = self._printStatus
@@ -2704,6 +2720,12 @@
                be the directory that contains the report form file. If you set
                self.ReportFormFile, HomeDirectory will be set for you 
automatically."""))
 
+       NoneDisplay = property(_getNoneDisplay, _setNoneDisplay, None,
+               _("""Specifies the string displayed if Value is None  (str or 
None)
+
+               If None, self.Application.NoneDisplay will be used. If there's 
no 
+               instantiated dApp, then "< None >" will be used."""))
+
        PrintStatus = property(_getPrintStatus, _setPrintStatus, None,
                _("""Specifies whether status info is printed to stdout."""))
 



_______________________________________________
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