Merge branch 'master' of github.com:OpenELEC/OpenELEC.tv

This commit is contained in:
Stephan Raue 2012-06-21 12:57:38 +02:00
commit d1da488ea1
5 changed files with 278 additions and 241 deletions

View File

@ -5,6 +5,7 @@
<setting id="SABNZBD_KEEP_AWAKE" value="false" /> <setting id="SABNZBD_KEEP_AWAKE" value="false" />
<setting id="SABNZBD_PERIODIC_WAKE" value="false" /> <setting id="SABNZBD_PERIODIC_WAKE" value="false" />
<setting id="SABNZBD_WAKE_AT" value="1" /> <setting id="SABNZBD_WAKE_AT" value="1" />
<setting id="SABNZBD_LAUNCH" value="true" />
<setting id="SICKBEARD_LAUNCH" value="true" /> <setting id="SICKBEARD_LAUNCH" value="true" />
<setting id="COUCHPOTATO_LAUNCH" value="true" /> <setting id="COUCHPOTATO_LAUNCH" value="true" />
<setting id="COUCHPOTATO_VERSION" value="0" /> <setting id="COUCHPOTATO_VERSION" value="0" />

View File

@ -30,6 +30,7 @@ import hashlib
from configobj import ConfigObj from configobj import ConfigObj
from xml.dom.minidom import parseString from xml.dom.minidom import parseString
import logging import logging
import traceback
logging.basicConfig(filename='/var/log/sabnzbd-suite.log', logging.basicConfig(filename='/var/log/sabnzbd-suite.log',
filemode='w', filemode='w',
@ -138,6 +139,7 @@ user = getAddonSetting(suiteSettings, 'SABNZBD_USER')
pwd = getAddonSetting(suiteSettings, 'SABNZBD_PWD') pwd = getAddonSetting(suiteSettings, 'SABNZBD_PWD')
host = getAddonSetting(suiteSettings, 'SABNZBD_IP') host = getAddonSetting(suiteSettings, 'SABNZBD_IP')
sabNzbdKeepAwake = getAddonSetting(suiteSettings, 'SABNZBD_KEEP_AWAKE') sabNzbdKeepAwake = getAddonSetting(suiteSettings, 'SABNZBD_KEEP_AWAKE')
sabnzbd_launch = getAddonSetting(suiteSettings, 'SABNZBD_LAUNCH')
sickbeard_launch = getAddonSetting(suiteSettings, 'SICKBEARD_LAUNCH') sickbeard_launch = getAddonSetting(suiteSettings, 'SICKBEARD_LAUNCH')
couchpotato_launch = getAddonSetting(suiteSettings, 'COUCHPOTATO_LAUNCH') couchpotato_launch = getAddonSetting(suiteSettings, 'COUCHPOTATO_LAUNCH')
couchpotato_version = getAddonSetting(suiteSettings, 'COUCHPOTATO_VERSION') couchpotato_version = getAddonSetting(suiteSettings, 'COUCHPOTATO_VERSION')
@ -148,6 +150,8 @@ fDefaultSuiteSettings = open(pDefaultSuiteSettings, 'r')
data = fDefaultSuiteSettings.read() data = fDefaultSuiteSettings.read()
fDefaultSuiteSettings.close fDefaultSuiteSettings.close
DefaultSuiteSettings = parseString(data) DefaultSuiteSettings = parseString(data)
if not sabnzbd_launch:
sabnzbd_launch = getAddonSetting(DefaultSuiteSettings, 'SABNZBD_LAUNCH')
if not sickbeard_launch: if not sickbeard_launch:
sickbeard_launch = getAddonSetting(DefaultSuiteSettings, 'SICKBEARD_LAUNCH') sickbeard_launch = getAddonSetting(DefaultSuiteSettings, 'SICKBEARD_LAUNCH')
if not couchpotato_launch: if not couchpotato_launch:
@ -179,9 +183,10 @@ except:
signal.signal(signal.SIGCHLD, signal.SIG_DFL) signal.signal(signal.SIGCHLD, signal.SIG_DFL)
os.environ['PYTHONPATH'] = str(os.environ.get('PYTHONPATH')) + ':' + pPylib os.environ['PYTHONPATH'] = str(os.environ.get('PYTHONPATH')) + ':' + pPylib
# SABnzbd start
try:
# write SABnzbd settings # write SABnzbd settings
# ---------------------- # ----------------------
sabNzbdConfig = ConfigObj(pSabNzbdSettings,create_empty=True) sabNzbdConfig = ConfigObj(pSabNzbdSettings,create_empty=True)
defaultConfig = ConfigObj() defaultConfig = ConfigObj()
defaultConfig['misc'] = {} defaultConfig['misc'] = {}
@ -244,6 +249,7 @@ autoProcessConfig.write()
# launch SABnzbd and get the API key # launch SABnzbd and get the API key
# ---------------------------------- # ----------------------------------
if "true" in sabnzbd_launch:
logging.debug('Launching SABnzbd...') logging.debug('Launching SABnzbd...')
subprocess.call(sabnzbd,close_fds=True) subprocess.call(sabnzbd,close_fds=True)
logging.debug('...done') logging.debug('...done')
@ -254,10 +260,15 @@ if firstLaunch:
sabNzbdConfig.reload() sabNzbdConfig.reload()
sabNzbdApiKey = sabNzbdConfig['misc']['api_key'] sabNzbdApiKey = sabNzbdConfig['misc']['api_key']
logging.debug('SABnzbd api key: ' + sabNzbdApiKey) logging.debug('SABnzbd api key: ' + sabNzbdApiKey)
except Exception,e:
print 'SABnzbd: exception occurred:', e
print traceback.format_exc()
# SABnzbd end
# SickBeard start
try:
# write SickBeard settings # write SickBeard settings
# ------------------------ # ------------------------
sickBeardConfig = ConfigObj(pSickBeardSettings,create_empty=True) sickBeardConfig = ConfigObj(pSickBeardSettings,create_empty=True)
defaultConfig = ConfigObj() defaultConfig = ConfigObj()
defaultConfig['General'] = {} defaultConfig['General'] = {}
@ -268,6 +279,7 @@ defaultConfig['General']['web_port'] = '8082'
defaultConfig['General']['web_host'] = host defaultConfig['General']['web_host'] = host
defaultConfig['General']['web_username'] = user defaultConfig['General']['web_username'] = user
defaultConfig['General']['web_password'] = pwd defaultConfig['General']['web_password'] = pwd
if "true" in sabnzbd_launch:
defaultConfig['SABnzbd'] = {} defaultConfig['SABnzbd'] = {}
defaultConfig['SABnzbd']['sab_username'] = user defaultConfig['SABnzbd']['sab_username'] = user
defaultConfig['SABnzbd']['sab_password'] = pwd defaultConfig['SABnzbd']['sab_password'] = pwd
@ -306,10 +318,15 @@ if "true" in sickbeard_launch:
logging.debug('Launching SickBeard...') logging.debug('Launching SickBeard...')
subprocess.call(sickBeard,close_fds=True) subprocess.call(sickBeard,close_fds=True)
logging.debug('...done') logging.debug('...done')
except Exception,e:
print 'SickBeard: exception occurred:', e
print traceback.format_exc()
# SickBeard end
# CouchPotato start
try:
# write CouchPotato settings # write CouchPotato settings
# -------------------------- # --------------------------
couchPotatoConfig = ConfigObj(pCouchPotatoSettings,create_empty=True) couchPotatoConfig = ConfigObj(pCouchPotatoSettings,create_empty=True)
defaultConfig = ConfigObj() defaultConfig = ConfigObj()
defaultConfig['global'] = {} defaultConfig['global'] = {}
@ -319,6 +336,7 @@ defaultConfig['global']['password'] = pwd
defaultConfig['global']['username'] = user defaultConfig['global']['username'] = user
defaultConfig['global']['port'] = '8083' defaultConfig['global']['port'] = '8083'
defaultConfig['global']['host'] = host defaultConfig['global']['host'] = host
if "true" in sabnzbd_launch:
defaultConfig['Sabnzbd'] = {} defaultConfig['Sabnzbd'] = {}
defaultConfig['Sabnzbd']['username'] = user defaultConfig['Sabnzbd']['username'] = user
defaultConfig['Sabnzbd']['password'] = pwd defaultConfig['Sabnzbd']['password'] = pwd
@ -349,13 +367,18 @@ if "true" in couchpotato_launch and "0" in couchpotato_version:
logging.debug('Launching CouchPotato...') logging.debug('Launching CouchPotato...')
subprocess.call(couchPotato,close_fds=True) subprocess.call(couchPotato,close_fds=True)
logging.debug('...done') logging.debug('...done')
except Exception,e:
print 'CouchPotato: exception occurred:', e
print traceback.format_exc()
# CouchPotato end
# CouchPotatoServer start
try:
#convert password to md5 #convert password to md5
md5pwd = hashlib.md5(pwd).hexdigest() md5pwd = hashlib.md5(pwd).hexdigest()
# write CouchPotatoServer settings # write CouchPotatoServer settings
# -------------------------- # --------------------------
couchPotatoServerConfig = ConfigObj(pCouchPotatoServerSettings,create_empty=True) couchPotatoServerConfig = ConfigObj(pCouchPotatoServerSettings,create_empty=True)
defaultConfig = ConfigObj() defaultConfig = ConfigObj()
defaultConfig['newznab'] = {} defaultConfig['newznab'] = {}
@ -376,6 +399,7 @@ defaultConfig['updater'] = {}
defaultConfig['updater']['enabled'] = '0' defaultConfig['updater']['enabled'] = '0'
defaultConfig['updater']['notification'] = '0' defaultConfig['updater']['notification'] = '0'
defaultConfig['updater']['automatic'] = '0' defaultConfig['updater']['automatic'] = '0'
if "true" in sabnzbd_launch:
defaultConfig['Sabnzbd'] = {} defaultConfig['Sabnzbd'] = {}
defaultConfig['Sabnzbd']['username'] = user defaultConfig['Sabnzbd']['username'] = user
defaultConfig['Sabnzbd']['password'] = pwd defaultConfig['Sabnzbd']['password'] = pwd
@ -406,10 +430,15 @@ if "true" in couchpotato_launch and "1" in couchpotato_version:
logging.debug('Launching CouchPotatoServer...') logging.debug('Launching CouchPotatoServer...')
subprocess.call(couchPotatoServer,close_fds=True) subprocess.call(couchPotatoServer,close_fds=True)
logging.debug('...done') logging.debug('...done')
except Exception,e:
print 'CouchPotatoServer: exception occurred:', e
print traceback.format_exc()
# CouchPotatoServer end
# Headphones start
try:
# write Headphones settings # write Headphones settings
# ------------------------- # -------------------------
headphonesConfig = ConfigObj(pHeadphonesSettings,create_empty=True) headphonesConfig = ConfigObj(pHeadphonesSettings,create_empty=True)
defaultConfig = ConfigObj() defaultConfig = ConfigObj()
defaultConfig['General'] = {} defaultConfig['General'] = {}
@ -418,6 +447,7 @@ defaultConfig['General']['http_port'] = '8084'
defaultConfig['General']['http_host'] = host defaultConfig['General']['http_host'] = host
defaultConfig['General']['http_username'] = user defaultConfig['General']['http_username'] = user
defaultConfig['General']['http_password'] = pwd defaultConfig['General']['http_password'] = pwd
if "true" in sabnzbd_launch:
defaultConfig['SABnzbd'] = {} defaultConfig['SABnzbd'] = {}
defaultConfig['SABnzbd']['sab_apikey'] = sabNzbdApiKey defaultConfig['SABnzbd']['sab_apikey'] = sabNzbdApiKey
defaultConfig['SABnzbd']['sab_host'] = sabNzbdHost defaultConfig['SABnzbd']['sab_host'] = sabNzbdHost
@ -441,3 +471,7 @@ if "true" in headphones_launch:
logging.debug('Launching Headphones...') logging.debug('Launching Headphones...')
subprocess.call(headphones,close_fds=True) subprocess.call(headphones,close_fds=True)
logging.debug('...done') logging.debug('...done')
except Exception,e:
print 'Headphones: exception occurred:', e
print traceback.format_exc()
# Headphones end

View File

@ -6,6 +6,7 @@
<string id="1010">User Settings</string> <string id="1010">User Settings</string>
<string id="1022">Username</string> <string id="1022">Username</string>
<string id="1023">Password</string> <string id="1023">Password</string>
<string id="1024">Enable SABnzbd</string>>
<string id="1025">Enable Sickbeard</string> <string id="1025">Enable Sickbeard</string>
<string id="1026">Enable Couchpotato</string> <string id="1026">Enable Couchpotato</string>
<string id="1027">Couchpotato Version</string> <string id="1027">Couchpotato Version</string>

View File

@ -7,6 +7,7 @@
<setting type="sep" /> <setting type="sep" />
<setting id="SABNZBD_USER" type="text" label="1022" default="openelec"/> <setting id="SABNZBD_USER" type="text" label="1022" default="openelec"/>
<setting id="SABNZBD_PWD" type="text" label="1023" default="openelec"/> <setting id="SABNZBD_PWD" type="text" label="1023" default="openelec"/>
<setting id="SABNZBD_LAUNCH" type="bool" label="1024" default="true" />
<setting id="SICKBEARD_LAUNCH" type="bool" label="1025" default="true" /> <setting id="SICKBEARD_LAUNCH" type="bool" label="1025" default="true" />
<setting id="COUCHPOTATO_LAUNCH" type="bool" label="1026" default="true" /> <setting id="COUCHPOTATO_LAUNCH" type="bool" label="1026" default="true" />
<setting id="COUCHPOTATO_VERSION" type="enum" label="1027" default="0" values="Version 1|Version 2" enable="eq(-1,true)" /> <setting id="COUCHPOTATO_VERSION" type="enum" label="1027" default="0" values="Version 1|Version 2" enable="eq(-1,true)" />

View File

@ -19,7 +19,7 @@
################################################################################ ################################################################################
PKG_NAME="xbmc-addon-vuplus" PKG_NAME="xbmc-addon-vuplus"
PKG_VERSION="50571e7" PKG_VERSION="6e31a01"
PKG_REV="1" PKG_REV="1"
PKG_ARCH="any" PKG_ARCH="any"
PKG_LICENSE="GPL" PKG_LICENSE="GPL"