dabo Commit
Revision 5988
Date: 2010-09-10 14:34:29 -0700 (Fri, 10 Sep 2010)
Author: Nate
Trac: http://trac.dabodev.com/changeset/5988

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

Log:
Added the reports folder to the resolvePathAndUpdate method in the utils 
module.  Added a conditional check in the reportWriter to call the 
resolvePathAndUpdate method if the path is a valid absolute path.  So, now you 
can specify the ReportFormFile property of the ReportWriter object is a 
relative path.

Diff:
Modified: trunk/dabo/lib/reportWriter.py
===================================================================
--- trunk/dabo/lib/reportWriter.py      2010-09-10 16:59:07 UTC (rev 5987)
+++ trunk/dabo/lib/reportWriter.py      2010-09-10 21:34:29 UTC (rev 5988)
@@ -53,7 +53,7 @@
 from dabo.dLocalize import _
 from dabo.lib.caselessDict import CaselessDict
 from reportlab.lib.utils import ImageReader
-from dabo.lib.utils import ustr
+from dabo.lib.utils import ustr, resolvePathAndUpdate
 import Image as PILImage
 import reportUtils
 
@@ -2608,7 +2608,11 @@
                        self._reportForm = None
                        self._setMemento()
                        return
-
+               
+               if not os.path.exists(val):
+                       # Might be a relative path so let's try resolving it.
+                       val = resolvePathAndUpdate(val)
+                               
                if os.path.exists(val):
                        ext = os.path.splitext(val)[1] 
                        if ext == ".py":

Modified: trunk/dabo/lib/utils.py
===================================================================
--- trunk/dabo/lib/utils.py     2010-09-10 16:59:07 UTC (rev 5987)
+++ trunk/dabo/lib/utils.py     2010-09-10 21:34:29 UTC (rev 5988)
@@ -303,7 +303,7 @@
                keepLooping = True
                while keepLooping:
                        keepLooping = False
-                       for subd in ("ui", "forms", "menus", "resources", "db", 
"biz"):
+                       for subd in ("ui", "forms", "menus", "resources", "db", 
"biz", "reports"):
                                newpth = os.path.join(hd, subd, fname)
                                if opexists(newpth):
                                        srcFile = newpth



_______________________________________________
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