[Thuban-devel] Re: Patch for adding version info for Extensions

Bernhard Herzog bh at intevation.de
Fri Sep 17 20:19:49 CEST 2004


Jan-Oliver Wagner <jan at intevation.de> writes:

>> >         min_thuban_versions -- Minimum Thuban versions required to
>> >                                run the extension. This is a dictionary
>> >                                where the major release numbers ('X.Y')
>> >                                are the keys and the minor release
>> >                                number is the contents (e.g. 'Z').
>> >                                Example: { '1.0' : '0' }
[...]
> I opt for 1. and would like to remove this part.
> Its more like a solution looking for a problem.
> Better lets wait until we face a real problem.
> Ok to drop this again?

Yes.

>> > +            text += _('\tNone registered.\n')
>> > +        else:
>> > +            for ext in ext_registry.Get():
>> 
>> And this would be easier written as 
>> 
>>     for ext in ext_registry:
>> 
>> by implementing a suitable iter method as e.g. a generator.
>
> can you give me an example?

With a generator (untested):

    def iter(self):
        for item in self.registry:
            yield item

In this case it's easier to do this, though (also untested):

    def iter(self):
        return iter(self.registry)


-- 
Intevation GmbH                                 http://intevation.de/
Skencil                                http://sketch.sourceforge.net/
Thuban                                  http://thuban.intevation.org/




More information about the Thuban-devel mailing list

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