On 08/25/2010 11:57 AM, Fernando Perez wrote: > Hi folks, > > I'd like to know if the fix below looks reasonable to you, this is a > diff against current svn trunk: > > dreamweaver[matplotlib]> svn diff > Index: __init__.py > =================================================================== > --- __init__.py (revision 8656) > +++ __init__.py (working copy) > @@ -880,10 +880,14 @@ > if 'matplotlib.backends' in sys.modules: > if warn: warnings.warn(_use_error_msg) > return > - arg = arg.lower() > if arg.startswith('module://'): > name = arg > else: > + # For non-module backends, normalize name to lowercase. Note that > this > + # must NOT be done to module backends, because those need to be valid > + # Python module specifications that can be imported, and Python > module > + # names *are* case sensitive. > + arg = arg.lower() > be_parts = arg.split('.') > name = validate_backend(be_parts[0]) > if len(be_parts)> 1: > > ##### END PATCH > > I hope the comments explain clearly enough the problem. For a bit of > context, this is biting us in ipython where we're building a custom > backend for Qt terminals that inline mpl figures (very neat [1]), but > our backend's name is module://IPython.zmq.pylab.backend_payload_svg. > If you lowercase that, it won't import later. I know we shouldn't > have called IPython's module with that funny capitalization, but it's > a bit late to change now, I'm afraid. > > Do you foresee any problems with the above change? > > If everyone OK's it, I'm happy to commit it, but I won't do anything > until others better informed than I reply.
Looks fine to me. It's fixing a bug. I don't think the comment is even necessary--the rationale looks pretty obvious, and the code is clear. Eric > > Regards, > > f > > [1] teaser for the curious: > http://fperez.org/tmp/ipython_qt_pylab.png. All code is in the > 'newkernel' github branch. Special credits to Evan Patterson from > Enthought, the Qt brains behind the magic. > > ------------------------------------------------------------------------------ > Sell apps to millions through the Intel(R) Atom(Tm) Developer Program > Be part of this innovative community and reach millions of netbook users > worldwide. Take advantage of special opportunities to increase revenue and > speed time-to-market. Join now, and jumpstart your future. > http://p.sf.net/sfu/intel-atom-d2d > _______________________________________________ > Matplotlib-devel mailing list > Matplotlib-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel ------------------------------------------------------------------------------ Sell apps to millions through the Intel(R) Atom(Tm) Developer Program Be part of this innovative community and reach millions of netbook users worldwide. Take advantage of special opportunities to increase revenue and speed time-to-market. Join now, and jumpstart your future. http://p.sf.net/sfu/intel-atom-d2d _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel