2020 rewrite

This commit is contained in:
2020-06-15 00:50:54 +02:00
parent 99fa086a3f
commit fc5a825981
26 changed files with 1035 additions and 1541 deletions

33
python/init.py Executable file
View File

@@ -0,0 +1,33 @@
#!/usr/bin/python3
import sys
import argparse
import httpAPI
#import backends.genericFFA
import backends.eventStream
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Insurgency rating python backend server')
### parser backend configuration ###
parser.add_argument('--parser-backend', required=True, choices=['ffa', 'eventStream'],
help="Use the free-for-all parser")
### readin configuration ###
parser.add_argument('--http-api-port', type=int, default=5000, help="HTTP API Port")
args = parser.parse_args()
### set parser ###
if args.parser_backend == "ffa":
#parser = backends.genericFFA
raise NotImplementedError()
elif args.parser_backend == "eventStream":
parser = backends.eventStream
else:
print("Unsupported parser: {}".format(args.parser_backend), file=sys.stderr)
sys.exit(1)
### set input mode ###
httpAPI.run(args.http_api_port, parser)