示例#1
0
 def upgrade(self, default_config_file):
     '''Upgrade the configuration based on a new default config file.
     '''
     pcp = PythonConfigParser()
     pcp.read(default_config_file)
     for section in pcp.sections():
         self.setdefaults(section, dict(pcp.items(section)))
     self.write()
示例#2
0
文件: config.py 项目: gedonder/kivy
 def update_config(self, filename, overwrite=False):
     '''Upgrade the configuration based on a new default config file.
        Overwrite any existing values if overwrite is True.
     '''
     pcp = PythonConfigParser()
     pcp.read(filename)
     confset = self.setall if overwrite else self.setdefaults
     for section in pcp.sections():
         confset(section, dict(pcp.items(section)))
     self.write()