From 47bb349d2024398600b1675f82dc35a29186142f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Dembski?= Date: Tue, 19 Jun 2012 19:16:29 +0200 Subject: [PATCH 1/4] bump version of vuplus-addon to 0.2.8 --- packages/mediacenter/xbmc-addon-vuplus/meta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mediacenter/xbmc-addon-vuplus/meta b/packages/mediacenter/xbmc-addon-vuplus/meta index 244bed36e2..d01eb1b2b2 100644 --- a/packages/mediacenter/xbmc-addon-vuplus/meta +++ b/packages/mediacenter/xbmc-addon-vuplus/meta @@ -19,7 +19,7 @@ ################################################################################ PKG_NAME="xbmc-addon-vuplus" -PKG_VERSION="50571e7" +PKG_VERSION="6e31a01" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" From 8dfbdba67b42f947b94594050a41fae7306637fd Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Thu, 21 Jun 2012 11:02:13 +0300 Subject: [PATCH 2/4] Revert "SABnzbd-Suite: SABnzbd should always start" This reverts commit 59c434117146dc492e4af994193c7ff129094ed4. Conflicts: packages/addons/service/downloadmanager/SABnzbd-Suite/source/bin/SABnzbd-Suite.py --- .../SABnzbd-Suite/config/settings.xml | 1 + .../SABnzbd-Suite/source/bin/SABnzbd-Suite.py | 64 +++++++++++-------- .../resources/language/English/strings.xml | 1 + .../source/resources/settings.xml | 1 + 4 files changed, 39 insertions(+), 28 deletions(-) diff --git a/packages/addons/service/downloadmanager/SABnzbd-Suite/config/settings.xml b/packages/addons/service/downloadmanager/SABnzbd-Suite/config/settings.xml index aef45100de..fd3d452b30 100644 --- a/packages/addons/service/downloadmanager/SABnzbd-Suite/config/settings.xml +++ b/packages/addons/service/downloadmanager/SABnzbd-Suite/config/settings.xml @@ -5,6 +5,7 @@ + diff --git a/packages/addons/service/downloadmanager/SABnzbd-Suite/source/bin/SABnzbd-Suite.py b/packages/addons/service/downloadmanager/SABnzbd-Suite/source/bin/SABnzbd-Suite.py index 783bb47528..5735b0503a 100755 --- a/packages/addons/service/downloadmanager/SABnzbd-Suite/source/bin/SABnzbd-Suite.py +++ b/packages/addons/service/downloadmanager/SABnzbd-Suite/source/bin/SABnzbd-Suite.py @@ -138,6 +138,7 @@ user = getAddonSetting(suiteSettings, 'SABNZBD_USER') pwd = getAddonSetting(suiteSettings, 'SABNZBD_PWD') host = getAddonSetting(suiteSettings, 'SABNZBD_IP') sabNzbdKeepAwake = getAddonSetting(suiteSettings, 'SABNZBD_KEEP_AWAKE') +sabnzbd_launch = getAddonSetting(suiteSettings, 'SABNZBD_LAUNCH') sickbeard_launch = getAddonSetting(suiteSettings, 'SICKBEARD_LAUNCH') couchpotato_launch = getAddonSetting(suiteSettings, 'COUCHPOTATO_LAUNCH') couchpotato_version = getAddonSetting(suiteSettings, 'COUCHPOTATO_VERSION') @@ -148,6 +149,8 @@ fDefaultSuiteSettings = open(pDefaultSuiteSettings, 'r') data = fDefaultSuiteSettings.read() fDefaultSuiteSettings.close DefaultSuiteSettings = parseString(data) +if not sabnzbd_launch: + sabnzbd_launch = getAddonSetting(DefaultSuiteSettings, 'SABNZBD_LAUNCH') if not sickbeard_launch: sickbeard_launch = getAddonSetting(DefaultSuiteSettings, 'SICKBEARD_LAUNCH') if not couchpotato_launch: @@ -244,16 +247,17 @@ autoProcessConfig.write() # launch SABnzbd and get the API key # ---------------------------------- -logging.debug('Launching SABnzbd...') -subprocess.call(sabnzbd,close_fds=True) -logging.debug('...done') +if "true" in sabnzbd_launch: + logging.debug('Launching SABnzbd...') + subprocess.call(sabnzbd,close_fds=True) + logging.debug('...done') # SABnzbd will only complete the .ini file when we first access the web interface -if firstLaunch: - loadWebInterface('http://' + sabNzbdHost,user,pwd) -sabNzbdConfig.reload() -sabNzbdApiKey = sabNzbdConfig['misc']['api_key'] -logging.debug('SABnzbd api key: ' + sabNzbdApiKey) + if firstLaunch: + loadWebInterface('http://' + sabNzbdHost,user,pwd) + sabNzbdConfig.reload() + sabNzbdApiKey = sabNzbdConfig['misc']['api_key'] + logging.debug('SABnzbd api key: ' + sabNzbdApiKey) # write SickBeard settings # ------------------------ @@ -268,11 +272,12 @@ defaultConfig['General']['web_port'] = '8082' defaultConfig['General']['web_host'] = host defaultConfig['General']['web_username'] = user defaultConfig['General']['web_password'] = pwd -defaultConfig['SABnzbd'] = {} -defaultConfig['SABnzbd']['sab_username'] = user -defaultConfig['SABnzbd']['sab_password'] = pwd -defaultConfig['SABnzbd']['sab_apikey'] = sabNzbdApiKey -defaultConfig['SABnzbd']['sab_host'] = 'http://' + sabNzbdHost + '/' +if "true" in sabnzbd_launch: + defaultConfig['SABnzbd'] = {} + defaultConfig['SABnzbd']['sab_username'] = user + defaultConfig['SABnzbd']['sab_password'] = pwd + defaultConfig['SABnzbd']['sab_apikey'] = sabNzbdApiKey + defaultConfig['SABnzbd']['sab_host'] = 'http://' + sabNzbdHost + '/' defaultConfig['XBMC'] = {} defaultConfig['XBMC']['use_xbmc'] = '1' defaultConfig['XBMC']['xbmc_host'] = '127.0.0.1:' + xbmcPort @@ -319,11 +324,12 @@ defaultConfig['global']['password'] = pwd defaultConfig['global']['username'] = user defaultConfig['global']['port'] = '8083' defaultConfig['global']['host'] = host -defaultConfig['Sabnzbd'] = {} -defaultConfig['Sabnzbd']['username'] = user -defaultConfig['Sabnzbd']['password'] = pwd -defaultConfig['Sabnzbd']['apikey'] = sabNzbdApiKey -defaultConfig['Sabnzbd']['host'] = sabNzbdHost +if "true" in sabnzbd_launch: + defaultConfig['Sabnzbd'] = {} + defaultConfig['Sabnzbd']['username'] = user + defaultConfig['Sabnzbd']['password'] = pwd + defaultConfig['Sabnzbd']['apikey'] = sabNzbdApiKey + defaultConfig['Sabnzbd']['host'] = sabNzbdHost defaultConfig['XBMC'] = {} defaultConfig['XBMC']['enabled'] = 'True' defaultConfig['XBMC']['host'] = '127.0.0.1:' + xbmcPort @@ -376,11 +382,12 @@ defaultConfig['updater'] = {} defaultConfig['updater']['enabled'] = '0' defaultConfig['updater']['notification'] = '0' defaultConfig['updater']['automatic'] = '0' -defaultConfig['Sabnzbd'] = {} -defaultConfig['Sabnzbd']['username'] = user -defaultConfig['Sabnzbd']['password'] = pwd -defaultConfig['Sabnzbd']['api_key'] = sabNzbdApiKey -defaultConfig['Sabnzbd']['host'] = sabNzbdHost +if "true" in sabnzbd_launch: + defaultConfig['Sabnzbd'] = {} + defaultConfig['Sabnzbd']['username'] = user + defaultConfig['Sabnzbd']['password'] = pwd + defaultConfig['Sabnzbd']['api_key'] = sabNzbdApiKey + defaultConfig['Sabnzbd']['host'] = sabNzbdHost defaultConfig['xbmc'] = {} defaultConfig['xbmc']['enabled'] = '1' defaultConfig['xbmc']['host'] = '127.0.0.1:' + xbmcPort @@ -418,11 +425,12 @@ defaultConfig['General']['http_port'] = '8084' defaultConfig['General']['http_host'] = host defaultConfig['General']['http_username'] = user defaultConfig['General']['http_password'] = pwd -defaultConfig['SABnzbd'] = {} -defaultConfig['SABnzbd']['sab_apikey'] = sabNzbdApiKey -defaultConfig['SABnzbd']['sab_host'] = sabNzbdHost -defaultConfig['SABnzbd']['sab_username'] = user -defaultConfig['SABnzbd']['sab_password'] = pwd +if "true" in sabnzbd_launch: + defaultConfig['SABnzbd'] = {} + defaultConfig['SABnzbd']['sab_apikey'] = sabNzbdApiKey + defaultConfig['SABnzbd']['sab_host'] = sabNzbdHost + defaultConfig['SABnzbd']['sab_username'] = user + defaultConfig['SABnzbd']['sab_password'] = pwd if firstLaunch: defaultConfig['SABnzbd']['sab_category'] = 'music' diff --git a/packages/addons/service/downloadmanager/SABnzbd-Suite/source/resources/language/English/strings.xml b/packages/addons/service/downloadmanager/SABnzbd-Suite/source/resources/language/English/strings.xml index 191afe441a..c4d2998892 100644 --- a/packages/addons/service/downloadmanager/SABnzbd-Suite/source/resources/language/English/strings.xml +++ b/packages/addons/service/downloadmanager/SABnzbd-Suite/source/resources/language/English/strings.xml @@ -6,6 +6,7 @@ User Settings Username Password + Enable SABnzbd> Enable Sickbeard Enable Couchpotato Couchpotato Version diff --git a/packages/addons/service/downloadmanager/SABnzbd-Suite/source/resources/settings.xml b/packages/addons/service/downloadmanager/SABnzbd-Suite/source/resources/settings.xml index 564def77ac..1cd5c2b8b7 100644 --- a/packages/addons/service/downloadmanager/SABnzbd-Suite/source/resources/settings.xml +++ b/packages/addons/service/downloadmanager/SABnzbd-Suite/source/resources/settings.xml @@ -7,6 +7,7 @@ + From ba695d3da3cc1d9bcba30cdd079cb52dd9170a21 Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Thu, 21 Jun 2012 12:36:06 +0300 Subject: [PATCH 3/4] SABnzbd-Suite: rework: a failed part of suite should NEVER block another part. --- .../SABnzbd-Suite/source/bin/SABnzbd-Suite.py | 508 +++++++++--------- 1 file changed, 264 insertions(+), 244 deletions(-) diff --git a/packages/addons/service/downloadmanager/SABnzbd-Suite/source/bin/SABnzbd-Suite.py b/packages/addons/service/downloadmanager/SABnzbd-Suite/source/bin/SABnzbd-Suite.py index 5735b0503a..441f3cba23 100755 --- a/packages/addons/service/downloadmanager/SABnzbd-Suite/source/bin/SABnzbd-Suite.py +++ b/packages/addons/service/downloadmanager/SABnzbd-Suite/source/bin/SABnzbd-Suite.py @@ -182,270 +182,290 @@ except: signal.signal(signal.SIGCHLD, signal.SIG_DFL) os.environ['PYTHONPATH'] = str(os.environ.get('PYTHONPATH')) + ':' + pPylib -# write SABnzbd settings -# ---------------------- +# SABnzbd start +try: + # write SABnzbd settings + # ---------------------- + sabNzbdConfig = ConfigObj(pSabNzbdSettings,create_empty=True) + defaultConfig = ConfigObj() + defaultConfig['misc'] = {} + defaultConfig['misc']['disable_api_key'] = '0' + defaultConfig['misc']['check_new_rel'] = '0' + defaultConfig['misc']['auto_browser'] = '0' + defaultConfig['misc']['username'] = user + defaultConfig['misc']['password'] = pwd + defaultConfig['misc']['port'] = '8081' + defaultConfig['misc']['https_port'] = '9081' + defaultConfig['misc']['https_cert'] = 'server.cert' + defaultConfig['misc']['https_key'] = 'server.key' + defaultConfig['misc']['host'] = host + defaultConfig['misc']['web_dir'] = 'Plush' + defaultConfig['misc']['web_dir2'] = 'Plush' + defaultConfig['misc']['web_color'] = 'gold' + defaultConfig['misc']['web_color2'] = 'gold' + defaultConfig['misc']['log_dir'] = 'logs' + defaultConfig['misc']['admin_dir'] = 'admin' + defaultConfig['misc']['nzb_backup_dir'] = 'backup' + defaultConfig['misc']['script_dir'] = 'scripts' -sabNzbdConfig = ConfigObj(pSabNzbdSettings,create_empty=True) -defaultConfig = ConfigObj() -defaultConfig['misc'] = {} -defaultConfig['misc']['disable_api_key'] = '0' -defaultConfig['misc']['check_new_rel'] = '0' -defaultConfig['misc']['auto_browser'] = '0' -defaultConfig['misc']['username'] = user -defaultConfig['misc']['password'] = pwd -defaultConfig['misc']['port'] = '8081' -defaultConfig['misc']['https_port'] = '9081' -defaultConfig['misc']['https_cert'] = 'server.cert' -defaultConfig['misc']['https_key'] = 'server.key' -defaultConfig['misc']['host'] = host -defaultConfig['misc']['web_dir'] = 'Plush' -defaultConfig['misc']['web_dir2'] = 'Plush' -defaultConfig['misc']['web_color'] = 'gold' -defaultConfig['misc']['web_color2'] = 'gold' -defaultConfig['misc']['log_dir'] = 'logs' -defaultConfig['misc']['admin_dir'] = 'admin' -defaultConfig['misc']['nzb_backup_dir'] = 'backup' -defaultConfig['misc']['script_dir'] = 'scripts' - -if firstLaunch: - defaultConfig['misc']['download_dir'] = pSabNzbdIncomplete - defaultConfig['misc']['complete_dir'] = pSabNzbdComplete - servers = {} - servers['localhost'] = {} - servers['localhost']['host'] = 'localhost' - servers['localhost']['port'] = '119' - servers['localhost']['enable'] = '0' - categories = {} - categories['tv'] = {} - categories['tv']['name'] = 'tv' - categories['tv']['script'] = 'sabToSickBeard.py' - categories['tv']['priority'] = '-100' - categories['movies'] = {} - categories['movies']['name'] = 'movies' - categories['movies']['dir'] = 'movies' - categories['movies']['priority'] = '-100' - categories['music'] = {} - categories['music']['name'] = 'music' - categories['music']['dir'] = 'music' - categories['music']['priority'] = '-100' - defaultConfig['servers'] = servers - defaultConfig['categories'] = categories - -sabNzbdConfig.merge(defaultConfig) -sabNzbdConfig.write() - -# also keep the autoProcessTV config up to date -autoProcessConfig = ConfigObj(os.path.join(pSabNzbdScripts, 'autoProcessTV.cfg'), create_empty=True) -defaultConfig = ConfigObj() -defaultConfig['SickBeard'] = {} -defaultConfig['SickBeard']['host'] = 'localhost' -defaultConfig['SickBeard']['port'] = '8082' -defaultConfig['SickBeard']['username'] = user -defaultConfig['SickBeard']['password'] = pwd -autoProcessConfig.merge(defaultConfig) -autoProcessConfig.write() - -# launch SABnzbd and get the API key -# ---------------------------------- -if "true" in sabnzbd_launch: - logging.debug('Launching SABnzbd...') - subprocess.call(sabnzbd,close_fds=True) - logging.debug('...done') - -# SABnzbd will only complete the .ini file when we first access the web interface if firstLaunch: - loadWebInterface('http://' + sabNzbdHost,user,pwd) - sabNzbdConfig.reload() - sabNzbdApiKey = sabNzbdConfig['misc']['api_key'] - logging.debug('SABnzbd api key: ' + sabNzbdApiKey) + defaultConfig['misc']['download_dir'] = pSabNzbdIncomplete + defaultConfig['misc']['complete_dir'] = pSabNzbdComplete + servers = {} + servers['localhost'] = {} + servers['localhost']['host'] = 'localhost' + servers['localhost']['port'] = '119' + servers['localhost']['enable'] = '0' + categories = {} + categories['tv'] = {} + categories['tv']['name'] = 'tv' + categories['tv']['script'] = 'sabToSickBeard.py' + categories['tv']['priority'] = '-100' + categories['movies'] = {} + categories['movies']['name'] = 'movies' + categories['movies']['dir'] = 'movies' + categories['movies']['priority'] = '-100' + categories['music'] = {} + categories['music']['name'] = 'music' + categories['music']['dir'] = 'music' + categories['music']['priority'] = '-100' + defaultConfig['servers'] = servers + defaultConfig['categories'] = categories -# write SickBeard settings -# ------------------------ + sabNzbdConfig.merge(defaultConfig) + sabNzbdConfig.write() -sickBeardConfig = ConfigObj(pSickBeardSettings,create_empty=True) -defaultConfig = ConfigObj() -defaultConfig['General'] = {} -defaultConfig['General']['launch_browser'] = '0' -defaultConfig['General']['version_notify'] = '0' -defaultConfig['General']['log_dir'] = 'logs' -defaultConfig['General']['web_port'] = '8082' -defaultConfig['General']['web_host'] = host -defaultConfig['General']['web_username'] = user -defaultConfig['General']['web_password'] = pwd -if "true" in sabnzbd_launch: - defaultConfig['SABnzbd'] = {} - defaultConfig['SABnzbd']['sab_username'] = user - defaultConfig['SABnzbd']['sab_password'] = pwd - defaultConfig['SABnzbd']['sab_apikey'] = sabNzbdApiKey - defaultConfig['SABnzbd']['sab_host'] = 'http://' + sabNzbdHost + '/' -defaultConfig['XBMC'] = {} -defaultConfig['XBMC']['use_xbmc'] = '1' -defaultConfig['XBMC']['xbmc_host'] = '127.0.0.1:' + xbmcPort -defaultConfig['XBMC']['xbmc_username'] = xbmcUser -defaultConfig['XBMC']['xbmc_password'] = xbmcPwd + # also keep the autoProcessTV config up to date + autoProcessConfig = ConfigObj(os.path.join(pSabNzbdScripts, 'autoProcessTV.cfg'), create_empty=True) + defaultConfig = ConfigObj() + defaultConfig['SickBeard'] = {} + defaultConfig['SickBeard']['host'] = 'localhost' + defaultConfig['SickBeard']['port'] = '8082' + defaultConfig['SickBeard']['username'] = user + defaultConfig['SickBeard']['password'] = pwd + autoProcessConfig.merge(defaultConfig) + autoProcessConfig.write() -if firstLaunch: - defaultConfig['General']['metadata_xbmc'] = '1|1|1|1|1|1' - defaultConfig['General']['nzb_method'] = 'sabnzbd' - defaultConfig['General']['keep_processed_dir'] = '0' - defaultConfig['General']['use_banner'] = '1' - defaultConfig['General']['rename_episodes'] = '1' - defaultConfig['General']['naming_ep_name'] = '0' - defaultConfig['General']['naming_use_periods'] = '1' - defaultConfig['General']['naming_sep_type'] = '1' - defaultConfig['General']['naming_ep_type'] = '1' - defaultConfig['General']['root_dirs'] = '0|/storage/tvshows' - defaultConfig['SABnzbd']['sab_category'] = 'tv' - # workaround: on first launch, sick beard will always add - # 'http://' and trailing '/' on its own - defaultConfig['SABnzbd']['sab_host'] = sabNzbdHost - defaultConfig['XBMC']['xbmc_notify_ondownload'] = '1' - defaultConfig['XBMC']['xbmc_update_library'] = '1' + # launch SABnzbd and get the API key + # ---------------------------------- + if "true" in sabnzbd_launch: + logging.debug('Launching SABnzbd...') + subprocess.call(sabnzbd,close_fds=True) + logging.debug('...done') -sickBeardConfig.merge(defaultConfig) -sickBeardConfig.write() + # SABnzbd will only complete the .ini file when we first access the web interface + if firstLaunch: + loadWebInterface('http://' + sabNzbdHost,user,pwd) + sabNzbdConfig.reload() + sabNzbdApiKey = sabNzbdConfig['misc']['api_key'] + logging.debug('SABnzbd api key: ' + sabNzbdApiKey) +except Exception,e: + print 'SABnzbd: exception occurred:', e +# SABnzbd end -# launch SickBeard -# ---------------- -if "true" in sickbeard_launch: - logging.debug('Launching SickBeard...') - subprocess.call(sickBeard,close_fds=True) - logging.debug('...done') +# SickBeard start +try: + # write SickBeard settings + # ------------------------ + sickBeardConfig = ConfigObj(pSickBeardSettings,create_empty=True) + defaultConfig = ConfigObj() + defaultConfig['General'] = {} + defaultConfig['General']['launch_browser'] = '0' + defaultConfig['General']['version_notify'] = '0' + defaultConfig['General']['log_dir'] = 'logs' + defaultConfig['General']['web_port'] = '8082' + defaultConfig['General']['web_host'] = host + defaultConfig['General']['web_username'] = user + defaultConfig['General']['web_password'] = pwd + if "true" in sabnzbd_launch: + defaultConfig['SABnzbd'] = {} + defaultConfig['SABnzbd']['sab_username'] = user + defaultConfig['SABnzbd']['sab_password'] = pwd + defaultConfig['SABnzbd']['sab_apikey'] = sabNzbdApiKey + defaultConfig['SABnzbd']['sab_host'] = 'http://' + sabNzbdHost + '/' + defaultConfig['XBMC'] = {} + defaultConfig['XBMC']['use_xbmc'] = '1' + defaultConfig['XBMC']['xbmc_host'] = '127.0.0.1:' + xbmcPort + defaultConfig['XBMC']['xbmc_username'] = xbmcUser + defaultConfig['XBMC']['xbmc_password'] = xbmcPwd -# write CouchPotato settings -# -------------------------- + if firstLaunch: + defaultConfig['General']['metadata_xbmc'] = '1|1|1|1|1|1' + defaultConfig['General']['nzb_method'] = 'sabnzbd' + defaultConfig['General']['keep_processed_dir'] = '0' + defaultConfig['General']['use_banner'] = '1' + defaultConfig['General']['rename_episodes'] = '1' + defaultConfig['General']['naming_ep_name'] = '0' + defaultConfig['General']['naming_use_periods'] = '1' + defaultConfig['General']['naming_sep_type'] = '1' + defaultConfig['General']['naming_ep_type'] = '1' + defaultConfig['General']['root_dirs'] = '0|/storage/tvshows' + defaultConfig['SABnzbd']['sab_category'] = 'tv' + # workaround: on first launch, sick beard will always add + # 'http://' and trailing '/' on its own + defaultConfig['SABnzbd']['sab_host'] = sabNzbdHost + defaultConfig['XBMC']['xbmc_notify_ondownload'] = '1' + defaultConfig['XBMC']['xbmc_update_library'] = '1' -couchPotatoConfig = ConfigObj(pCouchPotatoSettings,create_empty=True) -defaultConfig = ConfigObj() -defaultConfig['global'] = {} -defaultConfig['global']['launchbrowser'] = 'False' -defaultConfig['global']['updater'] = 'False' -defaultConfig['global']['password'] = pwd -defaultConfig['global']['username'] = user -defaultConfig['global']['port'] = '8083' -defaultConfig['global']['host'] = host -if "true" in sabnzbd_launch: - defaultConfig['Sabnzbd'] = {} - defaultConfig['Sabnzbd']['username'] = user - defaultConfig['Sabnzbd']['password'] = pwd - defaultConfig['Sabnzbd']['apikey'] = sabNzbdApiKey - defaultConfig['Sabnzbd']['host'] = sabNzbdHost -defaultConfig['XBMC'] = {} -defaultConfig['XBMC']['enabled'] = 'True' -defaultConfig['XBMC']['host'] = '127.0.0.1:' + xbmcPort -defaultConfig['XBMC']['username'] = xbmcUser -defaultConfig['XBMC']['password'] = xbmcPwd + sickBeardConfig.merge(defaultConfig) + sickBeardConfig.write() -if firstLaunch: - defaultConfig['Sabnzbd']['category'] = 'movies' - defaultConfig['Sabnzbd']['ppdir'] = pSabNzbdCompleteMov - defaultConfig['Renamer'] = {} - defaultConfig['Renamer']['enabled'] = 'True' - defaultConfig['Renamer']['download'] = pSabNzbdCompleteMov - defaultConfig['Renamer']['destination'] = '/storage/videos' - defaultConfig['Renamer']['separator'] = '.' - defaultConfig['Renamer']['cleanup'] = 'True' + # launch SickBeard + # ---------------- + if "true" in sickbeard_launch: + logging.debug('Launching SickBeard...') + subprocess.call(sickBeard,close_fds=True) + logging.debug('...done') +except Exception,e: + print 'SickBeard: exception occurred:', e +# SickBeard end -couchPotatoConfig.merge(defaultConfig) -couchPotatoConfig.write() +# CouchPotato start +try: + # write CouchPotato settings + # -------------------------- + couchPotatoConfig = ConfigObj(pCouchPotatoSettings,create_empty=True) + defaultConfig = ConfigObj() + defaultConfig['global'] = {} + defaultConfig['global']['launchbrowser'] = 'False' + defaultConfig['global']['updater'] = 'False' + defaultConfig['global']['password'] = pwd + defaultConfig['global']['username'] = user + defaultConfig['global']['port'] = '8083' + defaultConfig['global']['host'] = host + if "true" in sabnzbd_launch: + defaultConfig['Sabnzbd'] = {} + defaultConfig['Sabnzbd']['username'] = user + defaultConfig['Sabnzbd']['password'] = pwd + defaultConfig['Sabnzbd']['apikey'] = sabNzbdApiKey + defaultConfig['Sabnzbd']['host'] = sabNzbdHost + defaultConfig['XBMC'] = {} + defaultConfig['XBMC']['enabled'] = 'True' + defaultConfig['XBMC']['host'] = '127.0.0.1:' + xbmcPort + defaultConfig['XBMC']['username'] = xbmcUser + defaultConfig['XBMC']['password'] = xbmcPwd -# launch CouchPotato -# ------------------ -if "true" in couchpotato_launch and "0" in couchpotato_version: - logging.debug('Launching CouchPotato...') - subprocess.call(couchPotato,close_fds=True) - logging.debug('...done') + if firstLaunch: + defaultConfig['Sabnzbd']['category'] = 'movies' + defaultConfig['Sabnzbd']['ppdir'] = pSabNzbdCompleteMov + defaultConfig['Renamer'] = {} + defaultConfig['Renamer']['enabled'] = 'True' + defaultConfig['Renamer']['download'] = pSabNzbdCompleteMov + defaultConfig['Renamer']['destination'] = '/storage/videos' + defaultConfig['Renamer']['separator'] = '.' + defaultConfig['Renamer']['cleanup'] = 'True' -#convert password to md5 -md5pwd = hashlib.md5(pwd).hexdigest() + couchPotatoConfig.merge(defaultConfig) + couchPotatoConfig.write() -# write CouchPotatoServer settings -# -------------------------- + # launch CouchPotato + # ------------------ + if "true" in couchpotato_launch and "0" in couchpotato_version: + logging.debug('Launching CouchPotato...') + subprocess.call(couchPotato,close_fds=True) + logging.debug('...done') +except Exception,e: + print 'CouchPotato: exception occurred:', e +# CouchPotato end -couchPotatoServerConfig = ConfigObj(pCouchPotatoServerSettings,create_empty=True) -defaultConfig = ConfigObj() -defaultConfig['newznab'] = {} -defaultConfig['newznab']['api_key'] = '' -defaultConfig['core'] = {} -defaultConfig['core']['username'] = user -defaultConfig['core']['password'] = md5pwd -defaultConfig['core']['port'] = '8083' -defaultConfig['core']['launchbrowser'] = '0' -defaultConfig['core']['host'] = host -defaultConfig['core']['data_dir'] = pAddonHome -defaultConfig['core']['permission_folder'] = '0644' -defaultConfig['core']['permission_file'] = '0644' -defaultConfig['core']['show_wizard'] = '0' -defaultConfig['core']['debug'] = '0' -defaultConfig['core']['development'] = '0' -defaultConfig['updater'] = {} -defaultConfig['updater']['enabled'] = '0' -defaultConfig['updater']['notification'] = '0' -defaultConfig['updater']['automatic'] = '0' -if "true" in sabnzbd_launch: - defaultConfig['Sabnzbd'] = {} - defaultConfig['Sabnzbd']['username'] = user - defaultConfig['Sabnzbd']['password'] = pwd - defaultConfig['Sabnzbd']['api_key'] = sabNzbdApiKey - defaultConfig['Sabnzbd']['host'] = sabNzbdHost -defaultConfig['xbmc'] = {} -defaultConfig['xbmc']['enabled'] = '1' -defaultConfig['xbmc']['host'] = '127.0.0.1:' + xbmcPort -defaultConfig['xbmc']['username'] = xbmcUser -defaultConfig['xbmc']['password'] = xbmcPwd +# CouchPotatoServer start +try: + #convert password to md5 + md5pwd = hashlib.md5(pwd).hexdigest() -if firstLaunch: - defaultConfig['Sabnzbd']['category'] = 'movies' - defaultConfig['Sabnzbd']['pp_directory'] = pSabNzbdCompleteMov - defaultConfig['Renamer'] = {} - defaultConfig['Renamer']['enabled'] = 'True' - defaultConfig['Renamer']['download'] = pSabNzbdCompleteMov - defaultConfig['Renamer']['destination'] = '/storage/videos' - defaultConfig['Renamer']['separator'] = '.' - defaultConfig['Renamer']['cleanup'] = 'False' + # write CouchPotatoServer settings + # -------------------------- + couchPotatoServerConfig = ConfigObj(pCouchPotatoServerSettings,create_empty=True) + defaultConfig = ConfigObj() + defaultConfig['newznab'] = {} + defaultConfig['newznab']['api_key'] = '' + defaultConfig['core'] = {} + defaultConfig['core']['username'] = user + defaultConfig['core']['password'] = md5pwd + defaultConfig['core']['port'] = '8083' + defaultConfig['core']['launchbrowser'] = '0' + defaultConfig['core']['host'] = host + defaultConfig['core']['data_dir'] = pAddonHome + defaultConfig['core']['permission_folder'] = '0644' + defaultConfig['core']['permission_file'] = '0644' + defaultConfig['core']['show_wizard'] = '0' + defaultConfig['core']['debug'] = '0' + defaultConfig['core']['development'] = '0' + defaultConfig['updater'] = {} + defaultConfig['updater']['enabled'] = '0' + defaultConfig['updater']['notification'] = '0' + defaultConfig['updater']['automatic'] = '0' + if "true" in sabnzbd_launch: + defaultConfig['Sabnzbd'] = {} + defaultConfig['Sabnzbd']['username'] = user + defaultConfig['Sabnzbd']['password'] = pwd + defaultConfig['Sabnzbd']['api_key'] = sabNzbdApiKey + defaultConfig['Sabnzbd']['host'] = sabNzbdHost + defaultConfig['xbmc'] = {} + defaultConfig['xbmc']['enabled'] = '1' + defaultConfig['xbmc']['host'] = '127.0.0.1:' + xbmcPort + defaultConfig['xbmc']['username'] = xbmcUser + defaultConfig['xbmc']['password'] = xbmcPwd -couchPotatoServerConfig.merge(defaultConfig) -couchPotatoServerConfig.write() + if firstLaunch: + defaultConfig['Sabnzbd']['category'] = 'movies' + defaultConfig['Sabnzbd']['pp_directory'] = pSabNzbdCompleteMov + defaultConfig['Renamer'] = {} + defaultConfig['Renamer']['enabled'] = 'True' + defaultConfig['Renamer']['download'] = pSabNzbdCompleteMov + defaultConfig['Renamer']['destination'] = '/storage/videos' + defaultConfig['Renamer']['separator'] = '.' + defaultConfig['Renamer']['cleanup'] = 'False' -# launch CouchPotatoServer -# ------------------ -if "true" in couchpotato_launch and "1" in couchpotato_version: - logging.debug('Launching CouchPotatoServer...') - subprocess.call(couchPotatoServer,close_fds=True) - logging.debug('...done') + couchPotatoServerConfig.merge(defaultConfig) + couchPotatoServerConfig.write() -# write Headphones settings -# ------------------------- + # launch CouchPotatoServer + # ------------------ + if "true" in couchpotato_launch and "1" in couchpotato_version: + logging.debug('Launching CouchPotatoServer...') + subprocess.call(couchPotatoServer,close_fds=True) + logging.debug('...done') +except Exception,e: + print 'CouchPotatoServer: exception occurred:', e +# CouchPotatoServer end -headphonesConfig = ConfigObj(pHeadphonesSettings,create_empty=True) -defaultConfig = ConfigObj() -defaultConfig['General'] = {} -defaultConfig['General']['launch_browser'] = '0' -defaultConfig['General']['http_port'] = '8084' -defaultConfig['General']['http_host'] = host -defaultConfig['General']['http_username'] = user -defaultConfig['General']['http_password'] = pwd -if "true" in sabnzbd_launch: - defaultConfig['SABnzbd'] = {} - defaultConfig['SABnzbd']['sab_apikey'] = sabNzbdApiKey - defaultConfig['SABnzbd']['sab_host'] = sabNzbdHost - defaultConfig['SABnzbd']['sab_username'] = user - defaultConfig['SABnzbd']['sab_password'] = pwd +# Headphones start +try: + # write Headphones settings + # ------------------------- + headphonesConfig = ConfigObj(pHeadphonesSettings,create_empty=True) + defaultConfig = ConfigObj() + defaultConfig['General'] = {} + defaultConfig['General']['launch_browser'] = '0' + defaultConfig['General']['http_port'] = '8084' + defaultConfig['General']['http_host'] = host + defaultConfig['General']['http_username'] = user + defaultConfig['General']['http_password'] = pwd + if "true" in sabnzbd_launch: + defaultConfig['SABnzbd'] = {} + defaultConfig['SABnzbd']['sab_apikey'] = sabNzbdApiKey + defaultConfig['SABnzbd']['sab_host'] = sabNzbdHost + defaultConfig['SABnzbd']['sab_username'] = user + defaultConfig['SABnzbd']['sab_password'] = pwd -if firstLaunch: - defaultConfig['SABnzbd']['sab_category'] = 'music' - defaultConfig['General']['music_dir'] = '/storage/music' - defaultConfig['General']['destination_dir'] = '/storage/music' - defaultConfig['General']['download_dir'] = '/storage/downloads/music' - defaultConfig['General']['move_files'] = '1' - defaultConfig['General']['rename_files'] = '1' + if firstLaunch: + defaultConfig['SABnzbd']['sab_category'] = 'music' + defaultConfig['General']['music_dir'] = '/storage/music' + defaultConfig['General']['destination_dir'] = '/storage/music' + defaultConfig['General']['download_dir'] = '/storage/downloads/music' + defaultConfig['General']['move_files'] = '1' + defaultConfig['General']['rename_files'] = '1' -headphonesConfig.merge(defaultConfig) -headphonesConfig.write() + headphonesConfig.merge(defaultConfig) + headphonesConfig.write() -# launch Headphones -# ----------------- -if "true" in headphones_launch: - logging.debug('Launching Headphones...') - subprocess.call(headphones,close_fds=True) - logging.debug('...done') + # launch Headphones + # ----------------- + if "true" in headphones_launch: + logging.debug('Launching Headphones...') + subprocess.call(headphones,close_fds=True) + logging.debug('...done') +except Exception,e: + print 'Headphones: exception occurred:', e +# Headphones end From ac180a15e49bc13302ecac959c000256b35fb7bc Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Thu, 21 Jun 2012 12:52:32 +0300 Subject: [PATCH 4/4] SABnzbd-Suite: print full traceback on error --- .../SABnzbd-Suite/source/bin/SABnzbd-Suite.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/addons/service/downloadmanager/SABnzbd-Suite/source/bin/SABnzbd-Suite.py b/packages/addons/service/downloadmanager/SABnzbd-Suite/source/bin/SABnzbd-Suite.py index 441f3cba23..3cb74ba101 100755 --- a/packages/addons/service/downloadmanager/SABnzbd-Suite/source/bin/SABnzbd-Suite.py +++ b/packages/addons/service/downloadmanager/SABnzbd-Suite/source/bin/SABnzbd-Suite.py @@ -30,6 +30,7 @@ import hashlib from configobj import ConfigObj from xml.dom.minidom import parseString import logging +import traceback logging.basicConfig(filename='/var/log/sabnzbd-suite.log', filemode='w', @@ -261,6 +262,7 @@ try: logging.debug('SABnzbd api key: ' + sabNzbdApiKey) except Exception,e: print 'SABnzbd: exception occurred:', e + print traceback.format_exc() # SABnzbd end # SickBeard start @@ -318,6 +320,7 @@ try: logging.debug('...done') except Exception,e: print 'SickBeard: exception occurred:', e + print traceback.format_exc() # SickBeard end # CouchPotato start @@ -366,6 +369,7 @@ try: logging.debug('...done') except Exception,e: print 'CouchPotato: exception occurred:', e + print traceback.format_exc() # CouchPotato end # CouchPotatoServer start @@ -428,6 +432,7 @@ try: logging.debug('...done') except Exception,e: print 'CouchPotatoServer: exception occurred:', e + print traceback.format_exc() # CouchPotatoServer end # Headphones start @@ -468,4 +473,5 @@ try: logging.debug('...done') except Exception,e: print 'Headphones: exception occurred:', e + print traceback.format_exc() # Headphones end