|
From: John H. <jdh...@ac...> - 2005-06-21 20:10:26
|
>>>>> "Fernando" == Fernando Perez <Fer...@co...> writes:
Fernando> This was in a long-running session with very large
Fernando> memory allocations, but it dawned on me that
Fernando> get_dvipng_version(self) should cache its return value.
Fernando> There's no point in forcing a popen() call every single
Fernando> time, is there?
It already does cache the version
def get_dvipng_version(self):
if self.dvipngVersion is not None: return self.dvipngVersion
sin, sout = os.popen2('dvipng --version')
...snip...
I think the reason it is failing in your case is that is each renderer
creation creates a new TexManager instance. The cache should be on a
class basis and not on a per instance basis (slaps self on head).
Moving
self.dvipngVersion = None
to the class level and out of __init__ should suffice. I made this
change, and similar changes in texmanager and backend_agg, so that
caching is shared between instances. Update from CVS and let me know
if everything still works :-)
Fernando> I also just saw pylab crash when a user was trying to
Fernando> run with $PWD being something he didn't have write
Fernando> access to. Are there any checks in the code to fall
Fernando> back to /tmp or something sensible if texmanager can't
Fernando> write the temp files it needs? Sorry for not giving a
Fernando> traceback, but I only saw this on someone else's screen
Fernando> while helping them, and for some odd reason it's not
Fernando> happening on my box.
This is probably failing on the tex/latex temporary files. I spent
some time initially trying to figure out how to get these to go into
~/.tex.cache but didn't succeed. If anyone knows how to direct
tex/latex to put the various *.aux, *.log, etc, files in a specified
directory, pass it my way.
Thanks,
JDH
|