Changeset 2225

Show
Ignore:
Timestamp:
09/07/06 21:55:18 (4 years ago)
Author:
desai
Message:

Switch to new calling scheme (Frame.Verify -> Tool.Verify)

Location:
branches/refactor/client/src/lib/Client
Files:
1 added
3 modified

Legend:

Unmodified
Added
Removed
  • branches/refactor/client/src/lib/Client/Tools/Bases.py

    r2224 r2225  
    6767                raise toolInstantiationError 
    6868 
    69     def VerifyEntry(self, entry, modlist): 
    70         '''VerifyEntry dispatches to the proper method per-class\nReturns True/False''' 
    71         return False 
     69    def Verify(self): 
     70        '''Verify all pertinent entries''' 
     71        pass 
    7272 
    73     def InstallEntry(self, entry): 
    74         '''InstallEntry dispatches to the proper install method call\nReturns True/False''' 
    75         return False 
     73    def Install(self, whitelist = []): 
     74        '''Install all supported entries in sublist, if specified''' 
     75        pass 
    7676 
    77     def FindExtra(self): 
    78         '''Find per-type extra entries that are not reflected in the configuration''' 
    79         return [] 
     77    def handlesEntry(self, entry): 
     78        '''return if entry is handled by this Tool''' 
     79        return (entry.tag, entry.get('type')) in self.__handles__ 
    8080 
    81     def Install(self, subset = []): 
    82         '''Install all supported entries in sublist, if specified''' 
    83         return False 
     81    def buildModlist(self, entry, struct): 
     82        '''Build a list of potentially modified POSIX paths for this entry''' 
     83        if entry.tag != 'Package' or struct.tag != 'Bundle': 
     84            return [] 
     85        return [sentry.get('name') for sentry in struct if sentry.tag in \ 
     86                ['ConfigFile', 'SymLink', 'Directory']] 
  • branches/refactor/client/src/lib/Client/Tools/POSIX.py

    r2224 r2225  
    2929                   ('SymLink', None)] 
    3030 
    31     def VerifyEntry(self, entry, modlist): 
     31    def Verify(self, entry): 
    3232        '''Dispatch verify calls to underlying methods''' 
    33         func = getattr(self, "Verify%s" % (entry.tag)) 
    34         self.states[entry] = func(entry, modlist) 
     33        for entry in [entry for struct in self.config.getchildren() for entry in struct.getchildren() \ 
     34                      if self.handlesEntry(entry)]: 
     35            func = getattr(self, "Verify%s" % (entry.tag)) 
     36            self.states[entry] = func(entry, modlist) 
    3537 
    3638    def VerifySymLink(self, entry): 
  • branches/refactor/client/src/lib/Client/__init__.py

    r2223 r2225  
    22__revision__ = '$Revision$' 
    33 
    4 __all__ = ["Proxy", "Toolset", "Debian", "Solaris", "Redhat", "Gentoo", "XML", "Tools"] 
     4__all__ = ["Frame", "Proxy", "Tools", 'XML"]