VirtualMailManager/Handler.py
branchv0.6.x
changeset 280 db35d2eec518
parent 278 5d229a50b115
child 281 59ff7c719697
equal deleted inserted replaced
279:74d94b867348 280:db35d2eec518
    72         if not skip_some_checks:
    72         if not skip_some_checks:
    73             self._Cfg.check()
    73             self._Cfg.check()
    74             self._chkenv()
    74             self._chkenv()
    75             # will be moved to the Alias module
    75             # will be moved to the Alias module
    76             #self._postconf = Postconf(self._Cfg.dget('bin.postconf'))
    76             #self._postconf = Postconf(self._Cfg.dget('bin.postconf'))
    77         self._Cfg.install()
       
    78 
    77 
    79     def __findCfgFile(self):
    78     def __findCfgFile(self):
    80         for path in ['/root', '/usr/local/etc', '/etc']:
    79         for path in ['/root', '/usr/local/etc', '/etc']:
    81             tmp = os.path.join(path, 'vmm.cfg')
    80             tmp = os.path.join(path, 'vmm.cfg')
    82             if os.path.isfile(tmp):
    81             if os.path.isfile(tmp):
   343 
   342 
   344     def cfg_pget(self, option):
   343     def cfg_pget(self, option):
   345         """Get the configured value of the *option* (section.option)."""
   344         """Get the configured value of the *option* (section.option)."""
   346         return self._Cfg.pget(option)
   345         return self._Cfg.pget(option)
   347 
   346 
       
   347     def cfg_install(self):
       
   348         """Installs the cfg_dget method as ``cfg_dget`` into the built-in
       
   349         namespace."""
       
   350         import __builtin__
       
   351         assert 'cfg_dget' not in __builtin__.__dict__
       
   352         __builtin__.__dict__['cfg_dget'] = self._Cfg.dget
       
   353 
   348     def domainAdd(self, domainname, transport=None):
   354     def domainAdd(self, domainname, transport=None):
   349         dom = self.__getDomain(domainname)
   355         dom = self.__getDomain(domainname)
   350         if transport is None:
   356         if transport is None:
   351             dom.set_transport(Transport(self._dbh,
   357             dom.set_transport(Transport(self._dbh,
   352                               transport=self._Cfg.dget('misc.transport')))
   358                               transport=self._Cfg.dget('misc.transport')))