Hi there

I'm trying out the new mesh_as_bitmap writer option (current svn), 
because gv and printer disagree with evince about the pdfs I generate.

I use g.writeEPSfile() and such on a graph instance g which inherits 
from canvas.

Friendly python says

     g.writeEPSfile(__file__[:-3],mesh_as_bitmap=1)
   File "/home/mjg/lib/python/PyX-git/pyx/canvas.py", line 285, in 
wrappedindocument
     d = document.document([document.page(self, **kwargs)])
TypeError: __init__() got an unexpected keyword argument 'mesh_as_bitmap'

I suspect the culprit in the following snippet from canvas.py. While I 
can't possibly wrap my brain around ingenious code like that I reckon 
that the "kwargs" it passes to the document.page constructor are rather 
meant to be passed to "method", because they ultimately stem from a call 
to the wrapped writer method. Making that change results in success for 
my case, but I'm not sure about the full implications.

Michael

N.B.: In fact I think evince got it wrong for the (shaded, not 
bitmapped) pdf. The surface looks semi-transparent with a stroked mesh. 
So, I guess printer and gs are both correct here, which is not a 
coincidence...

def _wrappedindocument(method):
     def wrappedindocument(self, file=None, **kwargs):
         d = document.document([document.page(self, **kwargs)])
         self.__name__ = method.__name__
         self.__doc__ = method.__doc__
         return method(d, file)
     return wrappedindocument


class canvas(_canvas):

     """a canvas holds a collection of canvasitems"""

     writeEPSfile = _wrappedindocument(document.document.writeEPSfile)
     writePSfile = _wrappedindocument(document.document.writePSfile)
     writePDFfile = _wrappedindocument(document.document.writePDFfile)
     writetofile = _wrappedindocument(document.document.writetofile)


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
PyX-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-devel

Reply via email to