def main(): try: shell = Shell(sys.stdin, sys.stdout) except ShellError as e: print(e.error) return 1 shell.run()
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
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())
def run(self, *args, **kwds): from Shell import Shell shell = Shell(self) shell.run(*args, **kwds) return
def getContainerIds(self) -> typing.List[str]: containersString = Shell.run("docker ps -a -q") if (containersString == ''): return list() return containersString.split("\n")
def stopContainer(self, id): return Shell.run("docker stop " + id, True)
def getContainerInfo(self, id) -> str: return Shell.run("docker inspect " + id)
from Shell import Shell sh = Shell() sh.run()