Browser launcher works now - launches browser automatically on first startup

This commit is contained in:
Remy
2011-05-26 16:42:41 -07:00
parent 97f31c80b4
commit 15de3c2927
2 changed files with 12 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ from cherrypy.process.plugins import Daemonizer
from optparse import OptionParser
from configobj import ConfigObj
from configcreate import configCreate
import webbrowser
import webServer
import time
from threadtools import threadtool
@@ -77,6 +78,16 @@ def serverstart():
#Start threads
threadtool(cherrypy.engine).subscribe()
cherrypy.engine.timeout_monitor.unsubscribe()
def browser():
webbrowser.open('http://' + settings['http_host'] + ':' + settings['http_port'])
if settings['launch_browser'] == '1':
cherrypy.engine.subscribe('start', browser, priority=90)
cherrypy.quickstart(webServer.Headphones(), config = conf)

View File

@@ -340,7 +340,7 @@ class Headphones:
config.exposed = True
def configUpdate(self, http_host='127.0.0.1', http_username=None, http_port=8181, http_password=None, launch_browser=1,
def configUpdate(self, http_host='127.0.0.1', http_username=None, http_port=8181, http_password=None, launch_browser=0,
sab_host=None, sab_username=None, sab_apikey=None, sab_password=None, sab_category=None, music_download_dir=None,
usenet_retention=None, nzbmatrix=0, nzbmatrix_username=None, nzbmatrix_apikey=None, include_lossless=0,
flac_to_mp3=0, move_to_itunes=0, path_to_itunes=None, rename_mp3s=0, cleanup=0, add_album_art=0):