Could not obtain dvipng version

Sorry about that, I didnt see that one coming. This

    > should be fixed in svn 2278.

We seem to be repeatedly bitten by this type of bug in texmanager:
first with subprocess and now with the dvipng version check. I think
it would be worthwhile to refactor backend_ps and backend_agg to only
import the texmanager when needed. There is no reason a person with
usetex=False should fail.

I suggest something like (in backend_ps and backend_agg).

class RendererPS:
    def __init__(self, blah):
        self.texmanager = None

    def get_texmanager(self):
        if self.texmanager is not None: return self.texmanager
        from matplotlib.texmanager import TexManager
        self.texmanager = TexManager()

and then only call get_texmanager if rcParams['text.usetex']. We
could also put this functionality in backend_bases.RendererBase

BTW, do we need renderer specific texmanagers. Would anything break
if we used module level texmanagers? Something tells me I've thought
about this before and concluded we needed renderer (ie figure) level
managers, but am now drawing a blank.

JDH

    > Sorry about that, I didnt see that one coming. This
    > should be fixed in svn 2278.

We seem to be repeatedly bitten by this type of bug in texmanager:
first with subprocess and now with the dvipng version check. I think
it would be worthwhile to refactor backend_ps and backend_agg to only
import the texmanager when needed. There is no reason a person with
usetex=False should fail.

I suggest something like (in backend_ps and backend_agg).

class RendererPS:
    def __init__(self, blah):
        self.texmanager = None

    def get_texmanager(self):
        if self.texmanager is not None: return self.texmanager
        from matplotlib.texmanager import TexManager
        self.texmanager = TexManager()

and then only call get_texmanager if rcParams['text.usetex']. We
could also put this functionality in backend_bases.RendererBase

Ok, I just committed this. get_texmanager is in backend_bases.

BTW, do we need renderer specific texmanagers. Would anything break
if we used module level texmanagers? Something tells me I've thought
about this before and concluded we needed renderer (ie figure) level
managers, but am now drawing a blank.

I need to think about this. I'm pretty sure we can use module-level
texmanagers, since texmanagers dont keep any state info (no args to __init__,
no set_* functions ...). On the other-hand, module-level texmanagers may be a
problem for someone who wants to do rcParams['text.usetex']=True after they
have imported pylab.

···

On Monday 10 April 2006 12:26, John Hunter wrote: