Esempio n. 1
0
 def _run_config(self):
     " Handle `pybombs config' "
     if self.args.config_only:
         cfg_data = PBConfigFile(self.cfg_file).get('config')
     else:
         cfg_data = self.cfg
     keys = [self.args.key]
     if self.args.key is None:
         keys = cfg_data.keys()
     elif self.args.value is not None:
         self.cfg.set(self.args.key, self.args.value)
         self.cfg.update_cfg_file(
             new_data={'config': {self.args.key: self.args.value}},
             cfg_file=self.cfg_file,
         )
     for key in keys:
         print("{key}: {value}".format(key=key, value=cfg_data.get(key, "")))
         print("  - {help}".format(help=self.cfg.get_help(key) or " Undocumented config option"))
Esempio n. 2
0
 def _run_config(self):
     " Handle `pybombs config' "
     if self.args.config_only:
         cfg_data = PBConfigFile(self.cfg_file).get('config')
     else:
         cfg_data = self.cfg
     keys = [self.args.key]
     if self.args.key is None:
         keys = cfg_data.keys()
     elif self.args.value is not None:
         self.cfg.set(self.args.key, self.args.value)
         self.cfg.update_cfg_file(
             new_data={'config': {
                 self.args.key: self.args.value
             }},
             cfg_file=self.cfg_file,
         )
     for key in keys:
         print("{key}: {value}".format(key=key, value=cfg_data.get(key,
                                                                   "")))
         print("  - {help}".format(
             help=self.cfg.get_help(key) or " Undocumented config option"))