mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-15 01:32:57 -07:00
Enable PlexPy dev environment using --dev flag
This commit is contained in:
parent
0b126278f9
commit
252145cf58
4 changed files with 41 additions and 22 deletions
|
@ -74,6 +74,8 @@ UMASK = None
|
|||
|
||||
POLLING_FAILOVER = False
|
||||
|
||||
DEV = False
|
||||
|
||||
|
||||
def initialize(config_file):
|
||||
with INIT_LOCK:
|
||||
|
|
|
@ -449,7 +449,9 @@ class Config(object):
|
|||
for key in _CONFIG_DEFINITIONS.keys():
|
||||
self.check_setting(key)
|
||||
self._upgrade()
|
||||
self._blacklist()
|
||||
|
||||
if not plexpy.DEV:
|
||||
self._blacklist()
|
||||
|
||||
def _blacklist(self):
|
||||
""" Add tokens and passwords to blacklisted words in logger """
|
||||
|
@ -520,7 +522,8 @@ class Config(object):
|
|||
except IOError as e:
|
||||
plexpy.logger.error("Error writing configuration file: %s", e)
|
||||
|
||||
self._blacklist()
|
||||
if not plexpy.DEV:
|
||||
self._blacklist()
|
||||
|
||||
def __getattr__(self, name):
|
||||
"""
|
||||
|
|
|
@ -51,8 +51,6 @@ def initialize(options):
|
|||
'tools.encode.on': True,
|
||||
'tools.encode.encoding': 'utf-8',
|
||||
'tools.decode.on': True,
|
||||
'log.screen': False,
|
||||
'engine.autoreload.on': False,
|
||||
}
|
||||
|
||||
if enable_https:
|
||||
|
@ -62,6 +60,10 @@ def initialize(options):
|
|||
else:
|
||||
protocol = "http"
|
||||
|
||||
if plexpy.DEV:
|
||||
options_dict['environment'] = "test_suite"
|
||||
options_dict['engine.autoreload.on'] = True
|
||||
|
||||
logger.info("Starting PlexPy web server on %s://%s:%d/", protocol,
|
||||
options['http_host'], options['http_port'])
|
||||
cherrypy.config.update(options_dict)
|
||||
|
@ -120,7 +122,12 @@ def initialize(options):
|
|||
|
||||
try:
|
||||
cherrypy.process.servers.check_port(str(options['http_host']), options['http_port'])
|
||||
cherrypy.server.start()
|
||||
if not plexpy.DEV:
|
||||
cherrypy.server.start()
|
||||
else:
|
||||
cherrypy.engine.signals.subscribe()
|
||||
cherrypy.engine.start()
|
||||
cherrypy.engine.block()
|
||||
except IOError:
|
||||
sys.stderr.write('Failed to start on port: %i. Is something else running?\n' % (options['http_port']))
|
||||
sys.exit(1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue