def default(self, line): #################################################################### """If we don't have a proper subcommand passed""" #################################################################### LOGGER.error( "Command '%s' not found, see help (?) for available commands", line) return False
def do_fn(self, _): ############################################ """Use -h or --help for information""" ############################################ try: pk_class = [ o for o in getmembers(globals()[module_name], isclass) if str(o[0]) == class_name ][0][1] pk_class(self, pwdb=self.pwdb) for mesg in self.actions[swap_name].run(self.parser.parse_args()): if mesg: print(mesg) return False except PKPassError as err: LOGGER.error(err) return False except SystemExit: return False
def _reload_config(self): #################################################################### """Change affected globals in interpreter""" #################################################################### # We still need to be able to reload other things like recipients # database config = self.args["config"] config_args = self.args try: config_args = collect_args({"config": config}) if not config_args: config_args = self.args except ParserError: LOGGER.error("Error parsing config file") config_args = self.args finally: self.args = config_args self.args["config"] = config self.args = handle_filepath_args(self.args) self._change_pwstore() self._load_pwdb()