mirror of
https://github.com/FAUSheppy/skillbird
synced 2025-12-06 23:01:36 +01:00
2020 rewrite
This commit is contained in:
33
python/init.py
Executable file
33
python/init.py
Executable 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)
|
||||
Reference in New Issue
Block a user