Hi,

I found some issues when updating to z3c.rml 0.8. Patches with more information attached.

For the zope.pagetemplate issue I'm not sure if I'm missing something but to me it looks like the alternative code can not work by any means. Probably I'm missing something obvious as there is even pagetemplate.txt which mentions that z3c.rml should work even without zope.pagetemplate...

Unfortunately I was unable to resolve main my issue: There seem to be some problems with the auto-discovery of certain elements like b, br and the new pageNumber: None of them is present in the autogenerated rml.dtd and they are also not documented in the pdf reference.

Any ideas how to fix that?

fs

diff -r ce121af654e7 src/z3c/rml/pagetemplate.py
--- a/src/z3c/rml/pagetemplate.py       Sat May 09 19:17:43 2009 +0200
+++ b/src/z3c/rml/pagetemplate.py       Sat May 09 19:33:22 2009 +0200
@@ -19,15 +19,8 @@
 import zope
 from z3c.rml import rml2pdf
 
-try:
-    import zope.pagetemplate.pagetemplatefile
-except ImportError:
-    # zope.pagetemplate package has not been installed
-    import types
-    zope.pagetemplate = types.ModuleType('barcode')
-    zope.pagetemplate.pagetemplatefile = types.ModuleType('barcode')
-    zope.pagetemplate.pagetemplatefile.PageTemplateFile = object
-
+import zope.pagetemplate.pagetemplatefile
+    
 
 class RMLPageTemplateFile(zope.pagetemplate.pagetemplatefile.PageTemplateFile):
 
diff -r d508a0aeb7d1 src/z3c/rml/reference.pt
--- a/src/z3c/rml/reference.pt  Sat May 09 19:16:08 2009 +0200
+++ b/src/z3c/rml/reference.pt  Sat May 09 19:17:43 2009 +0200
@@ -112,7 +112,7 @@
         </drawCenteredString>
         <setFont name="Helvetica" size="24" />
         <drawCenteredString x="10.5cm" y="18.5cm">
-          Version 0.7
+          Version 0.8
         </drawCenteredString>
       </pageGraphics>
       <frame id="main" x1="3cm" y1="2cm" width="17cm" height="25.7cm" />
This problem was actually spotted by Werner Thie:
http://two.pairlist.net/pipermail/reportlab-users/2008-March/006819.html

diff -r 9e9f3227b467 src/z3c/rml/document.py
--- a/src/z3c/rml/document.py   Sat May 09 20:14:05 2009 +0200
+++ b/src/z3c/rml/document.py   Sat May 09 20:15:28 2009 +0200
@@ -259,7 +259,7 @@
         """Process document"""
         if outputFile is None:
             # TODO: This is relative to the input file *not* the CWD!!!
-            outputFile = open(self.element.get('filename'), 'w')
+            outputFile = open(self.element.get('filename'), 'wb')
 
         # Create a temporary output file, so that post-processors can
         # massage the output
$ python reference.py 
Traceback (most recent call last):
  File "reference.py", line 254, in <module>
    main()
  File "reference.py", line 241, in main
    examples = extractExamples(EXAMPLES_DIRECTORY)
  File "reference.py", line 215, in extractExamples
    {'doc': EXAMPLE_NS})
  File "lxml.etree.pyx", line 1321, in lxml.etree._Element.xpath 
(src/lxml/lxml.etree.c:14487)
TypeError: xpath() takes exactly 1 positional argument (2 given)

$ rpm -q python-lxml
python-lxml-2.1.5-1.fc10.x86_64

diff -r c05982b33b77 src/z3c/rml/reference.py
--- a/src/z3c/rml/reference.py  Sat May 09 19:15:42 2009 +0200
+++ b/src/z3c/rml/reference.py  Sat May 09 19:16:08 2009 +0200
@@ -211,7 +211,7 @@
         rmlFile = open(os.path.join(directory, filename), 'r')
         root = etree.parse(rmlFile).getroot()
         elements = root.xpath('//@doc:example/parent::*',
-                              {'doc': EXAMPLE_NS})
+                              namespaces={'doc': EXAMPLE_NS})
         # Phase 1: Collect all elements
         for elem in elements:
             demoTag = elem.get(EXAMPLE_ATTR_NAME) or elem.tag

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to