dabo Commit
Revision 3193
Date: 2007-06-21 13:39:18 -0700 (Thu, 21 Jun 2007)
Author: Paul
Trac: http://svn.dabodev.com/trac/dabo/changeset/3193

Changed:
U   trunk/dabo/dReportWriter.py
U   trunk/dabo/ui/uiwx/dPdfWindow.py

Log:
Fixed dReportWriter test to work (at some point, I changed the testcursor to 
not use literal strings). Made dPdfWindow's test run the dReportWriter test to 
have a test pdf file to display.

Diff:
Modified: trunk/dabo/dReportWriter.py
===================================================================
--- trunk/dabo/dReportWriter.py 2007-06-21 20:29:13 UTC (rev 3192)
+++ trunk/dabo/dReportWriter.py 2007-06-21 20:39:18 UTC (rev 3193)
@@ -24,7 +24,11 @@
                try:
                        v = self._encoding
                except AttributeError:
-                       v = self._encoding = self.Application.Encoding
+                       if self.Application:
+                               v = self.Application.Encoding
+                       else:
+                               v = "utf-8"
+                       self._encoding = v
                return v
 
        def _setEncoding(self, val):
@@ -66,10 +70,10 @@
        <title>Test Report from dReportWriter</title>
 
        <testcursor iid="int" cArtist="str">
-               <record iid="1" cArtist="The Clash" />
-               <record iid="2" cArtist="Queen" />
-               <record iid="3" cArtist="Metallica" />
-               <record iid="3" cArtist="The Boomtown Rats" />
+               <record iid="1" cArtist='"The Clash"' />
+               <record iid="2" cArtist='"Queen"' />
+               <record iid="3" cArtist='"Metallica"' />
+               <record iid="3" cArtist='"The Boomtown Rats"' />
        </testcursor>
 
        <page>

Modified: trunk/dabo/ui/uiwx/dPdfWindow.py
===================================================================
--- trunk/dabo/ui/uiwx/dPdfWindow.py    2007-06-21 20:29:13 UTC (rev 3192)
+++ trunk/dabo/ui/uiwx/dPdfWindow.py    2007-06-21 20:39:18 UTC (rev 3193)
@@ -1,4 +1,5 @@
 # -*- coding: utf-8 -*-
+import os
 import wx
 import dabo
 
@@ -36,7 +37,11 @@
 
 
 class _dPdfWindow_test(dPdfWindow):
-       pass
+       def afterInit(self):
+               # Run the dReportWriter test, which will output a test 
+               # pdf in this directory, and load that into the dPdfWindow:
+               os.system("python ../../dReportWriter.py")
+               self.LoadFile(os.path.abspath("dRW-test.pdf"))
 
 
 if __name__ == "__main__":




_______________________________________________
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/dabo-dev/[EMAIL PROTECTED]

Reply via email to