Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
    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)
Exemplo n.º 3
0
    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)
Exemplo n.º 4
0
    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)
Exemplo n.º 5
0
    def test_init(self):
        output = ConsoleOutput(Output.VERBOSITY_QUIET, True)

        self.assertEqual(Output.VERBOSITY_QUIET, output.get_verbosity())
Exemplo n.º 6
0
def main():
    application = Application("mlcli", __version__)
    application.add(InfoCommand())
    application.run(ArgvInput(), ConsoleOutput())