Пример #1
0
def configure(parser, args):
    parser.usage="usage: %prog configure"
    options, args = parser.parse_args(args)
    
    cfg = MainConfig(os.getcwd(), failinpc=True)
    man = pmodules.ModuleManager(cfg.fullSource())
    man.initModules(cfg.targets)
    path = os.path.join(cfg.config_dir, _PC_CCF)
    config = dict()
    if os.path.isfile(path):
        config = pfile.loadConfigFile(path)
    else:
        logging.warning("Default configuration does not exist")
    man.loadNodes(config=config)
    ctrl = cfgcontrol.ConfigController(Pbgui, man)
    save_settings = ctrl.mainloop()
    if save_settings:
        print("Is fully configured: "
             , man.isFullyConfigured(warning=True))
        print(man.collectConfig())
        pfile.saveConfigFile(path, man.collectConfig())
Пример #2
0
 def saveConfig(self, path):
     config = self._mman.collectConfig()
     pfile.saveConfigFile(path, config)