Desktop App classes
Conflicts: couchpotato/core/_base/_core/main.py couchpotato/core/_base/desktop/main.py
This commit is contained in:
1 parent
88c7f3e9b3
commit
01f3a68812
1 file changed
+4
-9
@@ -25,8 +25,6 @@ def getOptions(base_path, args):
|
|||||||
dest = 'console_log', help = "Log to console")
|
dest = 'console_log', help = "Log to console")
|
||||||
parser.add_argument('--quiet', action = 'store_true',
|
parser.add_argument('--quiet', action = 'store_true',
|
||||||
dest = 'quiet', help = 'No console logging')
|
dest = 'quiet', help = 'No console logging')
|
||||||
parser.add_argument('--binary_port', default = None,
|
|
||||||
dest = 'binary_port', help = 'Running from binary build')
|
|
||||||
parser.add_argument('--nogit', action = 'store_true',
|
parser.add_argument('--nogit', action = 'store_true',
|
||||||
dest = 'nogit', help = 'No git available')
|
dest = 'nogit', help = 'No git available')
|
||||||
|
|
||||||
@@ -37,16 +35,13 @@ def getOptions(base_path, args):
|
|||||||
return options
|
return options
|
||||||
|
|
||||||
|
|
||||||
def runCouchPotato(options, base_path, args, handle = None):
|
def runCouchPotato(options, base_path, args, desktop = None):
|
||||||
|
|
||||||
# Load settings
|
# Load settings
|
||||||
from couchpotato.environment import Env
|
from couchpotato.environment import Env
|
||||||
settings = Env.get('settings')
|
settings = Env.get('settings')
|
||||||
settings.setFile(options.config_file)
|
settings.setFile(options.config_file)
|
||||||
|
|
||||||
if handle:
|
|
||||||
handle(Env)
|
|
||||||
|
|
||||||
# Create data dir if needed
|
# Create data dir if needed
|
||||||
data_dir = os.path.expanduser(Env.setting('data_dir'))
|
data_dir = os.path.expanduser(Env.setting('data_dir'))
|
||||||
if data_dir == '':
|
if data_dir == '':
|
||||||
@@ -81,7 +76,7 @@ def runCouchPotato(options, base_path, args, handle = None):
|
|||||||
Env.set('cache', FileSystemCache(os.path.join(Env.get('cache_dir'), 'python')))
|
Env.set('cache', FileSystemCache(os.path.join(Env.get('cache_dir'), 'python')))
|
||||||
Env.set('console_log', options.console_log)
|
Env.set('console_log', options.console_log)
|
||||||
Env.set('quiet', options.quiet)
|
Env.set('quiet', options.quiet)
|
||||||
Env.set('binary_port', options.binary_port)
|
Env.set('desktop', desktop)
|
||||||
Env.set('args', args)
|
Env.set('args', args)
|
||||||
Env.set('options', options)
|
Env.set('options', options)
|
||||||
|
|
||||||
@@ -95,7 +90,7 @@ def runCouchPotato(options, base_path, args, handle = None):
|
|||||||
|
|
||||||
# Only run once when debugging
|
# Only run once when debugging
|
||||||
fire_load = False
|
fire_load = False
|
||||||
if os.environ.get('WERKZEUG_RUN_MAIN') or not debug or options.binary_port:
|
if os.environ.get('WERKZEUG_RUN_MAIN') or not debug or Env.get('desktop'):
|
||||||
|
|
||||||
# Logger
|
# Logger
|
||||||
logger = logging.getLogger()
|
logger = logging.getLogger()
|
||||||
@@ -160,7 +155,7 @@ def runCouchPotato(options, base_path, args, handle = None):
|
|||||||
from couchpotato import app
|
from couchpotato import app
|
||||||
api_key = Env.setting('api_key')
|
api_key = Env.setting('api_key')
|
||||||
url_base = '/' + Env.setting('url_base').lstrip('/') if Env.setting('url_base') else ''
|
url_base = '/' + Env.setting('url_base').lstrip('/') if Env.setting('url_base') else ''
|
||||||
reloader = debug is True and not options.binary_port
|
reloader = debug is True and not Env.get('desktop')
|
||||||
|
|
||||||
# Basic config
|
# Basic config
|
||||||
app.secret_key = api_key
|
app.secret_key = api_key
|
||||||
|
|||||||
Reference in new issue
Block a user