Beispiel #1
0
    def run(self, i=None, o=None):  # type: (...) -> int
        if i is None:
            i = ArgvInput()

        if o is None:
            o = ConsoleOutput()

        name = i.get_first_argument()
        if name in ['run', 'script']:
            self._skip_io_configuration = True
            i = RawArgvInput()

        return super(Application, self).run(i, o)
Beispiel #2
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)
Beispiel #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)
Beispiel #4
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)
Beispiel #5
0
    def test_get_first_argument(self):
        input_ = ArgvInput(['cli.py', '-fbbar'])
        self.assertEqual(None, input_.get_first_argument())

        input_ = ArgvInput(['cli.py', '-fbbar', 'foo'])
        self.assertEqual('foo', input_.get_first_argument())
Beispiel #6
0
    def test_get_first_argument(self):
        input_ = ArgvInput(['cli.py', '-fbbar'])
        self.assertEqual(None, input_.get_first_argument())

        input_ = ArgvInput(['cli.py', '-fbbar', 'foo'])
        self.assertEqual('foo', input_.get_first_argument())