diff options
Diffstat (limited to 'testapp/exam/code_server.py')
-rwxr-xr-x | testapp/exam/code_server.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/testapp/exam/code_server.py b/testapp/exam/code_server.py index 8f53425..2593752 100755 --- a/testapp/exam/code_server.py +++ b/testapp/exam/code_server.py @@ -147,15 +147,16 @@ class ServerPool(object): ############################################################################### -def main(): +def main(args=None): run_as_nobody() - if len(sys.argv) == 1: - ports = SERVER_PORTS + if args: + ports = [int(x) for x in args[1:]] else: - ports = [int(x) for x in sys.argv[1:]] + ports = SERVER_PORTS server_pool = ServerPool(ports=ports, pool_port=SERVER_POOL_PORT) server_pool.run() if __name__ == '__main__': - main() + args = sys.argv[1:] + main(args) |