[Thuban-devel] Re: jan: thuban/Extensions/svgexport __init__.py, 1.2, 1.3
Jan-Oliver Wagner
jan at intevation.de
Fri Nov 26 17:02:20 CET 2004
On Thu, Nov 25, 2004 at 10:13:34PM +0100, Bernhard Herzog wrote:
> cvs at intevation.de writes:
>
> > +# import the actual modules
> > +from os import environ
> > +try:
> > + dummy = environ["DISPLAY"]
> > + import svgsaver
> > + import maplegend
> > +except:
> > + pass # we don't have a DISPLAY, so don't import the modules
> > + # (we probably are in test-mode)
>
> That's not the right solution IMO. No code should check whether it's
> running under the test suite or not.
yes. I was unhappy about this too, but this way I was able to have
the test suite run again quickly. Better solution definititly due.
> I'm not sure yet what the best
> solution is, but as a first step, I'd say that the __init__ module in
> the extension packages should not import the GUI parts of the extension
> automatically.
What I want for Thuban is a standard rule to import everything
from a Extension. I don't bother how this is technically done
except that it is simple and a general rule.
"import Extensions.extensionname" fullfilled this, but just
let me know alternatives.
Jan
--
Jan-Oliver Wagner http://intevation.de/~jan/
Intevation GmbH http://intevation.de/
FreeGIS http://freegis.org/
More information about the Thuban-devel
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)