Patch for adding version info for Extensions
    Jan-Oliver Wagner 
    jan at intevation.de
       
    Sun Sep 19 00:00:29 CEST 2004
    
    
  
On Fri, Sep 17, 2004 at 08:19:49PM +0200, Bernhard Herzog wrote:
> 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.
Done.
> >> > +            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)
well, it must be def __iter__
but then it worked.
I also then was able to drop the Get() method.
	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)