dabo Commit
Revision 6535
Date: 2011-04-05 15:18:02 -0700 (Tue, 05 Apr 2011)
Author: Paul
Trac: http://trac.dabodev.com/changeset/6535
Changed:
U trunk/dabo/lib/reportWriter.py
Log:
Fixed some sections of my recent commit that could result in errors.
Diff:
Modified: trunk/dabo/lib/reportWriter.py
===================================================================
--- trunk/dabo/lib/reportWriter.py 2011-04-05 18:35:02 UTC (rev 6534)
+++ trunk/dabo/lib/reportWriter.py 2011-04-05 22:18:02 UTC (rev 6535)
@@ -253,14 +253,16 @@
If there isn't a default, an exception will be raised as the
object isn't
set up to have the passed prop.
"""
- def getDefault():
+ def getDefault(prop):
if prop[-4:] != "_def":
# First try the default (<prop>_def) value:
try:
return eval(self["%s_def" % prop])
except StandardError:
pass
-
+ else:
+ prop = prop[:-4]
+
# Fall back to defaults for base prop:
if prop in self.AvailableProps:
val = self.AvailableProps[prop]["default"]
@@ -280,10 +282,10 @@
# eval() failed. Return the default or the
exception string.
if returnException:
return e
- return getDefault()
+ return getDefault(prop)
else:
# The prop isn't defined, use the default.
- return getDefault()
+ return getDefault(prop)
def setProp(self, prop, val, logUndo=True):
_______________________________________________
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]