On Tue, Feb 14, 2006 at 11:26:16AM +0100, Christian Hoenig wrote: > Hi, > > attached is a patch for emaint contained in the sys-apps/portage-2.1_pre4-r1 > package that adds support for checking and fixing redundant entries in > package.keywords and package.unmask. > > Fixing those files is done by commenting out corresponding lines (as > suggested > by Simon Stelling, thanks!) > > I added two handlers, one for package.keywords, one for package.unmask, as I > like to check and fix them seperately. Though I don't think, that I shared > their code pretty nice. I have experience in c++ but ... > > CODING DISCLAIMER > ... I am pretty new to portage and python coding, so please forgive me my > quirks and critizise me constructive :-).
Few things... -(self.noneInstalled , self.noneAffected) = checkDict( cfg.punmaskdict ) +self.nonInstalled, self.noneAffected = checkDict(cfg.punmaskdict) is a bit more normal check should actually do the checks, rather then having the work done during instantiation of the checker... potentially have a base class those checkers inherit from instead of having the funcs unbound (although this is definitely debatable). Also... errors = [] errors += map.... just do errors = map... map returns a list, no point instatiating an empty list then updating it with another list :) ~harring
pgpLK17H6lXxv.pgp
Description: PGP signature
