def __init__(self, _root): self.root = _root self.parser = ArgumentParser() self.args = self.parser.parse() if 'action' not in self.args: self.parser.print_help() exit(1) self.args['root'] = self.root self.controller = Controller(self.parser, **self.args)
def __init__(self): #项目目录绝对路径 self.script_path = (os.path.dirname(os.path.realpath(__file__))) self.arguments = ArgumentParser(self.script_path) self.output = CLIOutput() self.controller = Controller(self.script_path, self.arguments, self.output)
def __init__(self): self.script_path = os.path.dirname(os.path.realpath(__file__)) self.arguments = ArgumentParser(self.script_path) if self.arguments.quiet: self.output = PrintOutput(self.arguments.color) else: self.output = CLIOutput(self.arguments.color) self.controller = Controller(self.script_path, self.arguments, self.output)