summaryrefslogtreecommitdiff
path: root/testapp/exam/code_server.py
diff options
context:
space:
mode:
authorankitjavalkar2015-06-22 17:09:30 +0530
committerankitjavalkar2015-08-03 15:23:05 +0530
commit6399ddce69a71f87a2e164a2b6e77a2f105f4741 (patch)
tree5ff98f6944189f03e9b8c6b94277497c8ce988db /testapp/exam/code_server.py
parent3f35f7dd0c79f76518a71f597b96c226d08157fb (diff)
downloadonline_test-6399ddce69a71f87a2e164a2b6e77a2f105f4741.tar.gz
online_test-6399ddce69a71f87a2e164a2b6e77a2f105f4741.tar.bz2
online_test-6399ddce69a71f87a2e164a2b6e77a2f105f4741.zip
- Install script: Add subcommands
- Install script: Add code server launcher - Add requirements.txt - Edit README to fix changes/errors - Remove jquery v1.11.3 and add v1.4.2 - Edit initial_data.json
Diffstat (limited to 'testapp/exam/code_server.py')
-rwxr-xr-xtestapp/exam/code_server.py11
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)