Commits

Mihai Ibanescu committed 0e23277

Using the conary 2.5 config infrastructure now

  • Participants
  • Parent commits e423117

Comments (0)

Files changed (2)

File updatebot/build/cvc.py

 
     def __init__(self, cfg, ccfg, inputFormatter, dispatcher):
         self._cfg = cfg
-        self._ccfg = copy.deepcopy(ccfg)
+        # Since there's no clone method on a cfg object, use the pickle protocol
+        self._ccfg = ccfg.__class__()
+        self._ccfg.__setstate__(ccfg.__getstate__())
         self._dispatcher = dispatcher
         self._formatInput = inputFormatter
 
         # Restet dbPath to the default value for local cooking.
-        self._ccfg.dbPath = conarycfg.ConaryContext.dbPath
+        self._ccfg.resetToDefault('dbPath')
 
         self._client = conaryclient.ConaryClient(self._ccfg)
 

File updatebot/config.py

     """
 
     _defaultSectionType = UpdateBotConfigSection
-
-    def __init__(self):
-        cfg.SectionedConfigFile.__init__(self)
-        for info in self._defaultSectionType._getConfigOptions():
-            if info[0] not in self:
-                self.addConfigOption(*info)
+    _cfg_bases = [ UpdateBotConfigSection ]
 
     def read(self, *args, **kwargs):
         """