[Thuban-devel] Proposed change for Extensions import and Extension registry

Jan-Oliver Wagner jan at intevation.de
Tue Nov 16 22:38:14 CET 2004


Hi,

I now started to perform this change.
There is another advantage: The __init__.py
can catch exception on importing the actual module and feed this info
into the registry :-)

	Jan

On Thu, Nov 11, 2004 at 09:01:52PM +0100, Jan-Oliver Wagner wrote:
> after some thinking about how the extension are important
> and registered I came to the conclusion that it
> is better to have the extension registry entry in the
> __init__.py file of the extensions' main directory
> instead of in one of the files.
> 
> Also, in the __init__.py file the actual modules
> could be imported. Thus, in ~/.thuban/thubanstart.py
> you can write:
> import Extensions.gns2shp
> instead of
> import Extensions.gns2shp.gns2shp
> 
> This is even more interesting if you have to
> import more than one file like for the umn_mapserver
> extension.
> 
> The good thing is that this is compatible with already
> existing thubanstart.py files. You just don't have the
> registry done.
> 
> Attached is a patch for gns2shp that illustrates what
> I mean.
> 
> This is the last issue to complete the registry feature.
> And I really want to remove this from my todo list soon.
> It can easily be backported to 1.0 btw.

-- 
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)