-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathcli.py
36 lines (26 loc) · 941 Bytes
/
cli.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import argparse
from app import app
from wsgi import RemotePyServer
def main():
parser = argparse.ArgumentParser(description = "RemotePy CLI")
parser.add_argument("-b", "--server", type = str, nargs=1,
metavar = "server", default = "0.0.0.0",
help = "IP address of server.")
parser.add_argument("-p", "--port", type = int,
metavar = "port", default = 5000,
help = "Port no. of server.")
parser.add_argument("-w", "--workers", type = int,
metavar = "workers", default = 1,
help = "No. of workers on server.")
parser.add_argument("-t", "--threads", type = int,
metavar = "threads", default = 2,
help = "No. of threads for server")
args = parser.parse_args()
host = args.server
port = args.port
workers = args.workers
threads = args.threads
server = RemotePyServer()
server.run(app, host=host, port=port, workers=workers, threads=threads)
if __name__ == "__main__":
main()