Beispiel #1
0
def main():
    try:
        shell = Shell(sys.stdin, sys.stdout)
    except ShellError as e:
        print(e.error)
        return 1
    shell.run()
Beispiel #2
0
def start(argv=None, **kwds):
    """general-purpose entry point for applications"""
    cls = kwds.get('applicationClass')
    kwds = dict(**kwds)
    kwds['argv'] = argv
    app = cls()
    shell = Shell(app)
    shell.run(**kwds)
    return 0
Beispiel #3
0
def start(argv=None, **kwds):
    """general-purpose entry point for applications"""
    cls = kwds.get('applicationClass')
    kwds = dict(**kwds)
    kwds['argv'] = argv
    app = cls()
    shell = Shell(app)
    shell.run(**kwds)
    return 0
Beispiel #4
0
    def test(self, _, input_string, output_string):
        input_stream = io.StringIO(input_string)
        output_stream = io.StringIO()

        # noinspection PyTypeChecker
        shell = Shell(input_stream, output_stream)

        shell.run()

        self.assertEqual(output_string, output_stream.getvalue())
Beispiel #5
0
 def run(self, *args, **kwds):
     from Shell import Shell
     shell = Shell(self)
     shell.run(*args, **kwds)
     return
Beispiel #6
0
 def run(self, *args, **kwds):
     from Shell import Shell
     shell = Shell(self)
     shell.run(*args, **kwds)
     return
Beispiel #7
0
 def getContainerIds(self) -> typing.List[str]:
     containersString = Shell.run("docker ps -a -q")
     if (containersString == ''):
         return list()
     return containersString.split("\n")
Beispiel #8
0
 def stopContainer(self, id):
     return Shell.run("docker stop " + id, True)
Beispiel #9
0
 def getContainerInfo(self, id) -> str:
     return Shell.run("docker inspect " + id)
Beispiel #10
0
from Shell import Shell

sh = Shell()
sh.run()