[Checkins] SVN: zopyx.convert2/trunk/src/zopyx/convert2/ fixes

Andreas Jung andreas at andreas-jung.com
Mon Sep 7 04:02:35 EDT 2009


Log message for revision 103607:
  fixes
  

Changed:
  U   zopyx.convert2/trunk/src/zopyx/convert2/convert.py
  U   zopyx.convert2/trunk/src/zopyx/convert2/prince.py

-=-
Modified: zopyx.convert2/trunk/src/zopyx/convert2/convert.py
===================================================================
--- zopyx.convert2/trunk/src/zopyx/convert2/convert.py	2009-09-07 08:01:27 UTC (rev 103606)
+++ zopyx.convert2/trunk/src/zopyx/convert2/convert.py	2009-09-07 08:02:35 UTC (rev 103607)
@@ -17,7 +17,7 @@
         self.cleanup = cleanup
         self.verbose = verbose
 
-    def convert(self, format, output_filename=None, **options):
+    def convert(self, format, output_filename=None, options={}):
 
         converter = registry.converter_registry.get(format)
         if converter is None:
@@ -30,7 +30,7 @@
                                         encoding=self.encoding)
         else:
             c = converter(self.filename, self.encoding, self.cleanup, self.verbose)
-            output_filename = c.convert(output_filename)
+            output_filename = c.convert(output_filename, **options)
         return output_filename
 
     __call__ = convert

Modified: zopyx.convert2/trunk/src/zopyx/convert2/prince.py
===================================================================
--- zopyx.convert2/trunk/src/zopyx/convert2/prince.py	2009-09-07 08:01:27 UTC (rev 103606)
+++ zopyx.convert2/trunk/src/zopyx/convert2/prince.py	2009-09-07 08:02:35 UTC (rev 103607)
@@ -29,17 +29,17 @@
     if not prince_available:
         raise RuntimeError("The external PrinceXML converter isn't available")
 
-    options = list()
+    cmd_options = list()
     for k,v in options.items():
         if v is None:
-            options.append('--%s ' % k)
+            cmd_options.append('--%s ' % k)
         else:
-            options.append('--%s="%s" ' % (k, v)) 
+            cmd_options.append('--%s="%s" ' % (k, v)) 
 
     if sys.platform == 'win32':
         raise NotImplementedError('No support for PrinceXML on Windows available')
     else:
-        cmd = 'sh "prince" "%s" %s -o "%s"' % (html_filename, ' '.join(options), output_filename)
+        cmd = 'sh "prince" "%s" %s -o "%s"' % (html_filename, ' '.join(cmd_options), output_filename)
     
     status, output = runcmd(cmd)
     if status != 0:



More information about the checkins mailing list