def run(self, i=None, o=None): # type: (...) -> int if i is None: i = ArgvInput() if o is None: o = ConsoleOutput() o.set_formatter(self._formatter) name = i.get_first_argument() if name in ['run', 'script']: self._skip_io_configuration = True i = RawArgvInput() return super(Application, self).run(i, o)
def run(self, i=None, o=None): # type: (...) -> int if i is None: i = ArgvInput() if o is None: o = ConsoleOutput() self._formatter.with_colors(o.is_decorated()) o.set_formatter(self._formatter) name = i.get_first_argument() if name in ["run", "script"]: self._skip_io_configuration = True i = RawArgvInput() return super(Application, self).run(i, o)
def run(self, i=None, o=None) -> int: if i is None: i = ArgvInput() if o is None: o = ConsoleOutput() name = i.get_first_argument() if name == 'run': self._skip_io_configuration = True i = RawArgvInput() return super().run(i, o)
def test_init(self): output = ConsoleOutput(Output.VERBOSITY_QUIET, True) self.assertEqual(Output.VERBOSITY_QUIET, output.get_verbosity())
def main(): application = Application("mlcli", __version__) application.add(InfoCommand()) application.run(ArgvInput(), ConsoleOutput())