Finishing the extension registry feature

Bernhard Reiter bernhard at intevation.de
Fri Feb 18 18:17:30 CET 2005


Am 17. Feb 2005 um 12:25:39 schrieb Jan-Oliver Wagner:
> finally I really aim to finish the extension registry
> feature.
> 
> The most important remianing problem was that the __init__.py
> of a extension should not contain any GUI relevant imports
> or otherweise the test suite has a problem.
> 
> On the other hand I wanted a single standard line in
> thubanstart.py for each extension to load completely.
> 
> My proposal now is to define a filename (Extensions/myname/all.py)
> where all imports are done to fully integrate the extension
> into Thuban.
> Then, in ~/.thuban/thubanstart.py there are lines like:
> import Extensions.gns2shp.all
> 
> This allows for later automized loading of all available Extensions
> (which is one of  my goals).
> 
> What do you think?

Using a file has the advantage that this works similiar to how tests
are found (magic filename).

We could also change both to use a magic function in the package.
Doing this for registration first and then later for tests.

I tend to favour the magic function solution a little bit over the
other, as we can later invent new magic functions for wx-dependent
test or what ever without changing names all the time.

On the other hand if there is a magic function then thuban needs to
scan all packages in the Extensions directory and at least try to
import the package to see what magic funcations it has.
Seems okay to me.

Note that will all solutions it should not be necessary to add an ".all"
or prefix a "Entensions." to the import command.

This is all very theoretic as you can just go an and improve it, 
I would say.

	Bernhard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.intevation.de/pipermail/thuban-devel/attachments/20050218/71c1c484/attachment.bin


More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)