1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-12-12 11:18:05 +00:00

Finalize graphical setup for calibre-web

This commit is contained in:
OzzieIsaacs
2017-01-28 20:16:40 +01:00
parent 75c89c28e1
commit 2c615fdf05
11 changed files with 508 additions and 325 deletions

18
cps.py
View File

@@ -3,27 +3,25 @@ import sys
import time
base_path = os.path.dirname(os.path.abspath(__file__))
# Insert local directories into path
sys.path.insert(0, os.path.join(base_path, 'vendor'))
from cps import web
# from cps import config
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
if __name__ == '__main__':
'''if config.DEVELOPMENT:
web.app.run(host="0.0.0.0", port=web.config.config_port, debug=True)
else:'''
http_server = HTTPServer(WSGIContainer(web.app))
http_server.listen(web.config.config_port)
IOLoop.instance().start()
if web.ub.DEVELOPMENT:
web.app.run(host="0.0.0.0", port=web.ub.config.config_port, debug=True)
else:
http_server = HTTPServer(WSGIContainer(web.app))
http_server.listen(web.ub.config.config_port)
IOLoop.instance().start()
if web.global_task == 0:
print("Performing restart of Calibre-web")
os.execl(sys.executable,sys.executable, *sys.argv)
os.execl(sys.executable, sys.executable, *sys.argv)
else:
print("Performing shutdown of Calibre-web")
os._exit(0)
sys.exit(0)