diff options
author | Prabhu Ramachandran | 2015-09-01 13:02:43 +0530 |
---|---|---|
committer | Prabhu Ramachandran | 2015-09-01 13:02:43 +0530 |
commit | 44cb800dec3fb81fa084ef59ebe4b54f0b389bc1 (patch) | |
tree | 23d0b9e46631906de819a5538c2b36b03ac7250b /testapp/exam/code_server.py | |
parent | 0225aad1492600ed53504b0986fd13da24c28ae9 (diff) | |
parent | c261ae92e5d4578b4e36c32def862bec4c6692aa (diff) | |
download | online_test-44cb800dec3fb81fa084ef59ebe4b54f0b389bc1.tar.gz online_test-44cb800dec3fb81fa084ef59ebe4b54f0b389bc1.tar.bz2 online_test-44cb800dec3fb81fa084ef59ebe4b54f0b389bc1.zip |
Merge pull request #52 from ankitjavalkar/quickstarter
Quick Start and README changes
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) |