Christian Delfosse venit, vidit, dixit 09.11.2008 12:52:
> Consider the example "minimal.py" with a minor mod
> at the last line :
> 
>     g.writePDFfile("minimal",title="Minimal")
> 
> Although writePDFfile equates to pdfwriter.PDFwriter,
> and class PDFwriter allows a "title" parameter,
> one has the following error message :
> 
>  $python minimal.py
> Traceback (most recent call last):
>   File "minimal.py", line 5, in <module>
>     g.writePDFfile("minimal",title="Minimal")
>   File "/usr/lib/python2.5/site-packages/pyx/canvas.py", line 327, in 
> wrappedindocument
>     d = document.document([document.page(self, *args, **kwargs)])
> TypeError: __init__() got an unexpected keyword argument 'title'

This is a reappearance of a similar problem with other writer
parameters. You're not telling us what your g is, but most probably it's
a canvas (such as a graph's canvas). If you call the writePDFfile method
it creates a page instance and a document instance (as you can see in
the error message). Any parameters passed to canvas.writePDFfile are
passed on to the page creator (__init__), none are passed to the
document creator, and none are passed to the writer method of document
(which you would need), even though you think you're calling the writer
method with parameters...

Michael


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to