-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.py
executable file
·35 lines (28 loc) · 1.09 KB
/
Main.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
__author__ = 'matt'
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import gevent.monkey; gevent.monkey.patch_all()
import RESTInterface
import logging
import logging.handlers
import bottle
import WebInterface
import Polling
from Scheduler import schedule, KillScheduler
import HomerHelper
from gevent import monkey,sleep,joinall,spawn
logging_level = 'DEBUG'
log_type = ('logging.'+logging_level)
logging.basicConfig(format='%(asctime)s %(name)s-%(levelname)s: %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p',filename='/var/log/HOMEr.log',level=logging.DEBUG)
logging.handlers.TimedRotatingFileHandler(filename='/var/log/HOMEr.log', when='midnight',backupCount=7, encoding=None, delay=False, utc=False)
logging.info('HOMEr service started')
def endprog():
KillScheduler()
logging.info('HOMEr service stopping')
bottleApp = bottle.default_app()
bottleApp.merge(RESTInterface.RESTApp)
bottleApp.merge(WebInterface.WebApp)
########################################################################
Polling.PollingStart()
bottleApp.run(reloader=True, host='0.0.0.0', port=8081, debug=True, server='gevent')