Esempio n. 1
0
 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)
Esempio n. 2
0
 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)
Esempio n. 3
0
    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)