First load failed to start app
This commit is contained in:
@@ -14,7 +14,7 @@ class Desktop(Plugin):
|
||||
if not Env.get('binary_port'):
|
||||
return
|
||||
|
||||
addEvent('app.load', self.settingsToDesktop)
|
||||
addEvent('app.load', self.settingsToDesktop, priority = 2)
|
||||
|
||||
def settingsToDesktop(self):
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ class StatusPlugin(Plugin):
|
||||
addEvent('status.get', self.add) # Alias for .add
|
||||
addEvent('status.get_by_id', self.getById)
|
||||
addEvent('status.all', self.all)
|
||||
addEvent('app.load', self.fill)
|
||||
addEvent('app.initialize', self.fill)
|
||||
|
||||
addApiView('status.list', self.list)
|
||||
|
||||
@@ -64,7 +64,7 @@ class StatusPlugin(Plugin):
|
||||
if not s:
|
||||
s = Status(
|
||||
identifier = identifier,
|
||||
label = identifier.capitalize()
|
||||
label = toUnicode(identifier.capitalize())
|
||||
)
|
||||
db.add(s)
|
||||
db.commit()
|
||||
@@ -87,6 +87,6 @@ class StatusPlugin(Plugin):
|
||||
)
|
||||
db.add(s)
|
||||
|
||||
s.label = label
|
||||
s.label = toUnicode(label)
|
||||
db.commit()
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ from couchpotato.api import addApiView
|
||||
from couchpotato.core.event import addEvent, fireEvent
|
||||
from couchpotato.core.helpers.encoding import isInt, toUnicode
|
||||
from couchpotato.core.helpers.request import getParams, jsonified
|
||||
from couchpotato.core.helpers.variable import mergeDicts
|
||||
from couchpotato.core.helpers.variable import mergeDicts, tryInt
|
||||
import ConfigParser
|
||||
import os.path
|
||||
import time
|
||||
@@ -19,11 +19,11 @@ class Settings():
|
||||
addApiView('settings', self.view)
|
||||
addApiView('settings.save', self.saveView)
|
||||
|
||||
def setFile(self, file):
|
||||
self.file = file
|
||||
def setFile(self, config_file):
|
||||
self.file = config_file
|
||||
|
||||
self.p = ConfigParser.RawConfigParser()
|
||||
self.p.read(file)
|
||||
self.p.read(config_file)
|
||||
|
||||
from couchpotato.core.logger import CPLog
|
||||
self.log = CPLog(__name__)
|
||||
@@ -70,17 +70,23 @@ class Settings():
|
||||
return default
|
||||
|
||||
def getEnabler(self, section, option):
|
||||
return self.p.getboolean(section, option)
|
||||
return self.getBool(section, option)
|
||||
|
||||
def getBool(self, section, option):
|
||||
return self.p.getboolean(section, option)
|
||||
try:
|
||||
return self.p.getboolean(section, option)
|
||||
except:
|
||||
return self.p.get(section, option)
|
||||
|
||||
def getInt(self, section, option):
|
||||
return self.p.getint(section, option)
|
||||
try:
|
||||
return self.p.getint(section, option)
|
||||
except:
|
||||
return tryInt(self.p.get(section, option))
|
||||
|
||||
def getUnicode(self, section, option):
|
||||
value = self.p.get(section, option)
|
||||
return toUnicode(value.strip())
|
||||
return toUnicode(value).strip()
|
||||
|
||||
def getValues(self):
|
||||
values = {}
|
||||
|
||||
Reference in New Issue
Block a user