forked from flobz/psa_car_controller
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.py
More file actions
executable file
·28 lines (23 loc) · 746 Bytes
/
server.py
File metadata and controls
executable file
·28 lines (23 loc) · 746 Bytes
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
#!/usr/bin/env python3
import os
import sys
from threading import Thread
from libs.requirements import TestRequirements
DIR = os.path.dirname(os.path.realpath(__file__))
if sys.version_info < (3, 6):
raise RuntimeError("This application requires Python 3.6+")
TestRequirements(DIR + "/requirements.txt").test_requirements()
# pylint: disable=wrong-import-position
import web.app
from libs.config import Config
from mylogger import logger
# noqa: MC0001
if __name__ == "__main__":
conf = Config()
conf.load_app()
args = conf.args
t1 = Thread(target=web.app.start_app,
args=["My car info", args.base_path, logger.level < 20, args.listen, int(args.port)])
t1.setDaemon(True)
t1.start()
t1.join()