diff --git a/SickBeard.py b/SickBeard.py index 3da22b8d..0ffdc422 100755 --- a/SickBeard.py +++ b/SickBeard.py @@ -25,6 +25,7 @@ import signal import sys import shutil import subprocess +import traceback if sys.version_info < (2, 6): print "Sorry, requires Python 2.6 or 2.7." @@ -68,6 +69,7 @@ throwaway = datetime.datetime.strptime('20110101', '%Y%m%d') signal.signal(signal.SIGINT, sickbeard.sig_handler) signal.signal(signal.SIGTERM, sickbeard.sig_handler) + class SickRage(object): def __init__(self): # system event callback for shutdown/restart @@ -127,9 +129,6 @@ class SickRage(object): try: locale.setlocale(locale.LC_ALL, "") - except (locale.Error, IOError): - pass - try: sickbeard.SYS_ENCODING = locale.getpreferredencoding() except (locale.Error, IOError): pass @@ -146,9 +145,8 @@ class SickRage(object): # On non-unicode builds this will raise an AttributeError, if encoding type is not valid it throws a LookupError sys.setdefaultencoding(sickbeard.SYS_ENCODING) except: - print 'Sorry, you MUST add the SickRage folder to the PYTHONPATH environment variable' - print 'or find another way to force Python to use ' + sickbeard.SYS_ENCODING + ' for string encoding.' - sys.exit(1) + sys.exit("Sorry, you MUST add the SickRage folder to the PYTHONPATH environment variable\n" + + "or find another way to force Python to use " + sickbeard.SYS_ENCODING + " for string encoding.") # Need console logging for SickBeard.py and SickBeard-console.exe self.consoleLogging = (not hasattr(sys, "frozen")) or (sickbeard.MY_NAME.lower().find('-console') > 0) @@ -456,9 +454,9 @@ class SickRage(object): sickbeard.showList.append(curShow) except Exception, e: logger.log( - u"There was an error creating the show in " + sqlShow["location"] + ": " + str(e).decode('utf-8', - 'replace'), + u"There was an error creating the show in " + sqlShow["location"] + ": " + str(e).decode('utf-8'), logger.ERROR) + logger.log(traceback.format_exc(), logger.DEBUG) def restore(self, srcDir, dstDir): try: @@ -508,7 +506,7 @@ class SickRage(object): popen_list = [os.path.join(sickbeard.PROG_DIR, 'updater.exe'), str(sickbeard.PID), sys.executable] else: - logger.log(u"Unknown SB launch method, please file a bug report about this", logger.ERROR) + logger.log(u"Unknown SR launch method, please file a bug report about this", logger.ERROR) popen_list = [sys.executable, os.path.join(sickbeard.PROG_DIR, 'updater.py'), str(sickbeard.PID), sys.executable, diff --git a/gui/slick/interfaces/default/apiBuilder.tmpl b/gui/slick/interfaces/default/apiBuilder.tmpl index 43cfd914..fedb8267 100644 --- a/gui/slick/interfaces/default/apiBuilder.tmpl +++ b/gui/slick/interfaces/default/apiBuilder.tmpl @@ -38,7 +38,9 @@ addOption("Command", "SickBeard.GetRootDirs", "?cmd=sb.getrootdirs", "", "", "ac addList("Command", "SickBeard.PauseBacklog", "?cmd=sb.pausebacklog", "sb.pausebacklog", "", "", "action"); addOption("Command", "SickBeard.Ping", "?cmd=sb.ping", "", "", "action"); addOption("Command", "SickBeard.Restart", "?cmd=sb.restart", "", "", "action"); -addList("Command", "SickBeard.SearchTVDB", "?cmd=sb.searchtvdb", "sb.searchtvdb", "", "", "action"); +addList("Command", "SickBeard.SearchAllIndexers", "?cmd=sb.searchindexers", "sb.searchindexers", "", "", "action"); +addList("Command", "SickBeard.SearchTVDB", "?cmd=sb.searchtvdb&indexer=1", "sb.searchindexers", "", "", "action"); +addList("Command", "SickBeard.SearchTVRage", "?cmd=sb.searchtvrage&indexer=2", "sb.searchindexers", "", "", "action"); addList("Command", "SickBeard.SetDefaults", "?cmd=sb.setdefaults", "sb.setdefaults", "", "", "action"); addOption("Command", "SickBeard.Shutdown", "?cmd=sb.shutdown", "", "", "action"); addList("Command", "Coming Episodes", "?cmd=future", "future"); @@ -140,44 +142,44 @@ addOption("show.addnew-opt", "Optional Param", "", 1); addList("show.addnew-opt", "No Season Folder", "&season_folder=0", "quality"); addList("show.addnew-opt", "Use Season Folder", "&season_folder=1", "quality"); -addOptGroup("sb.searchtvdb", "Search by Name"); -addList("sb.searchtvdb", "Lost", "&name=Lost", "sb.searchtvdb-lang"); -addList("sb.searchtvdb", "office", "&name=office", "sb.searchtvdb-lang"); -addList("sb.searchtvdb", "OffiCE", "&name=OffiCE", "sb.searchtvdb-lang"); -addList("sb.searchtvdb", "Leno", "&name=leno", "sb.searchtvdb-lang"); -addList("sb.searchtvdb", "Top Gear", "&name=Top Gear", "sb.searchtvdb-lang"); -endOptGroup("sb.searchtvdb"); -addOptGroup("sb.searchtvdb", "Search by indexerid"); -addList("sb.searchtvdb", "73739", "&indexerid=73739", "sb.searchtvdb-lang"); -addList("sb.searchtvdb", "74608", "&indexerid=74608", "sb.searchtvdb-lang"); -addList("sb.searchtvdb", "199051", "&indexerid=199051", "sb.searchtvdb-lang"); -addList("sb.searchtvdb", "123456 (invalid show)", "&indexerid=123456", "sb.searchtvdb-lang"); -endOptGroup("sb.searchtvdb"); +addOptGroup("sb.searchindexers", "Search by Name"); +addList("sb.searchindexers", "Lost", "&name=Lost", "sb.searchindexers-lang"); +addList("sb.searchindexers", "office", "&name=office", "sb.searchindexers-lang"); +addList("sb.searchindexers", "OffiCE", "&name=OffiCE", "sb.searchindexers-lang"); +addList("sb.searchindexers", "Leno", "&name=leno", "sb.searchindexers-lang"); +addList("sb.searchindexers", "Top Gear", "&name=Top Gear", "sb.searchindexers-lang"); +endOptGroup("sb.searchindexers"); +addOptGroup("sb.searchindexers", "Search by indexerid"); +addList("sb.searchindexers", "73739", "&indexerid=73739", "sb.searchindexers-lang"); +addList("sb.searchindexers", "74608", "&indexerid=74608", "sb.searchindexers-lang"); +addList("sb.searchindexers", "199051", "&indexerid=199051", "sb.searchindexers-lang"); +addList("sb.searchindexers", "123456 (invalid show)", "&indexerid=123456", "sb.searchindexers-lang"); +endOptGroup("sb.searchindexers"); -addOption("sb.searchtvdb-lang", "Optional Param", "", 1); -addOption("sb.searchtvdb-lang", "Chinese", "&lang=zh"); // 27 -addOption("sb.searchtvdb-lang", "Croatian", "&lang=hr"); // 31 -addOption("sb.searchtvdb-lang", "Czech", "&lang=cs"); // 28 -addOption("sb.searchtvdb-lang", "Danish", "&lang=da"); // 10 -addOption("sb.searchtvdb-lang", "Dutch", "&lang=nl"); // 13 -addOption("sb.searchtvdb-lang", "English", "&lang=en"); // 7 -addOption("sb.searchtvdb-lang", "Finnish", "&lang=fi"); // 11 -- Suomeksi -addOption("sb.searchtvdb-lang", "French", "&lang=fr"); // 17 -addOption("sb.searchtvdb-lang", "German", "&lang=de"); // 14 -addOption("sb.searchtvdb-lang", "Greek", "&lang=el"); // 20 -addOption("sb.searchtvdb-lang", "Hebrew", "&lang=he"); // 24 -addOption("sb.searchtvdb-lang", "Hungarian", "&lang=hu"); // 19 -- Magyar -addOption("sb.searchtvdb-lang", "Italian", "&lang=it"); // 15 -addOption("sb.searchtvdb-lang", "Japanese", "&lang=ja"); // 25 -addOption("sb.searchtvdb-lang", "Korean", "&lang=ko"); // 32 -addOption("sb.searchtvdb-lang", "Norwegian", "&lang=no"); // 9 -addOption("sb.searchtvdb-lang", "Polish", "&lang=pl"); // 18 -addOption("sb.searchtvdb-lang", "Portuguese", "&lang=pt");// 26 -addOption("sb.searchtvdb-lang", "Russian", "&lang=ru"); // 22 -addOption("sb.searchtvdb-lang", "Slovenian", "&lang=sl"); // 30 -addOption("sb.searchtvdb-lang", "Spanish", "&lang=es"); // 16 -addOption("sb.searchtvdb-lang", "Swedish", "&lang=sv"); // 8 -addOption("sb.searchtvdb-lang", "Turkish", "&lang=tr"); // 21 +addOption("sb.searchindexers-lang", "Optional Param", "", 1); +addOption("sb.searchindexers-lang", "Chinese", "&lang=zh"); // 27 +addOption("sb.searchindexers-lang", "Croatian", "&lang=hr"); // 31 +addOption("sb.searchindexers-lang", "Czech", "&lang=cs"); // 28 +addOption("sb.searchindexers-lang", "Danish", "&lang=da"); // 10 +addOption("sb.searchindexers-lang", "Dutch", "&lang=nl"); // 13 +addOption("sb.searchindexers-lang", "English", "&lang=en"); // 7 +addOption("sb.searchindexers-lang", "Finnish", "&lang=fi"); // 11 -- Suomeksi +addOption("sb.searchindexers-lang", "French", "&lang=fr"); // 17 +addOption("sb.searchindexers-lang", "German", "&lang=de"); // 14 +addOption("sb.searchindexers-lang", "Greek", "&lang=el"); // 20 +addOption("sb.searchindexers-lang", "Hebrew", "&lang=he"); // 24 +addOption("sb.searchindexers-lang", "Hungarian", "&lang=hu"); // 19 -- Magyar +addOption("sb.searchindexers-lang", "Italian", "&lang=it"); // 15 +addOption("sb.searchindexers-lang", "Japanese", "&lang=ja"); // 25 +addOption("sb.searchindexers-lang", "Korean", "&lang=ko"); // 32 +addOption("sb.searchindexers-lang", "Norwegian", "&lang=no"); // 9 +addOption("sb.searchindexers-lang", "Polish", "&lang=pl"); // 18 +addOption("sb.searchindexers-lang", "Portuguese", "&lang=pt");// 26 +addOption("sb.searchindexers-lang", "Russian", "&lang=ru"); // 22 +addOption("sb.searchindexers-lang", "Slovenian", "&lang=sl"); // 30 +addOption("sb.searchindexers-lang", "Spanish", "&lang=es"); // 16 +addOption("sb.searchindexers-lang", "Swedish", "&lang=sv"); // 8 +addOption("sb.searchindexers-lang", "Turkish", "&lang=tr"); // 21 #for $curShow in $sortedShowList: addList("seasons", "$curShow.name", "&indexerid=$curShow.indexerid", "seasons-$curShow.indexerid"); diff --git a/gui/slick/interfaces/default/displayShow.tmpl b/gui/slick/interfaces/default/displayShow.tmpl index 4de97971..e2715fa0 100644 --- a/gui/slick/interfaces/default/displayShow.tmpl +++ b/gui/slick/interfaces/default/displayShow.tmpl @@ -198,19 +198,6 @@
Originally Airs: | $show.airs #if not $network_timezones.test_timeformat($show.airs) then " (invalid Timeformat) " else ""# on $show.network |
Originally Airs: | $show.network |
Originally Airs: | >$show.airs #if not $network_timezones.test_timeformat($show.airs) then " (invalid Timeformat) " else ""# |
Status: | $show.status |
Location: | $showLoc[0] |
Location: | $showLoc[0] (dir is missing) |
Quality: | #if $show.quality in $qualityPresets: @@ -222,6 +209,21 @@ #if $bestQualities: Replace with: <%=", ".join([Quality.qualityStrings[x] for x in sorted(bestQualities)])%> #end if + #end if + + #if $show.network and $show.airs: + |
Originally Airs: | $show.airs #if not $network_timezones.test_timeformat($show.airs) then " (invalid Timeformat) " else ""# on $show.network |
Originally Airs: | $show.network |
Originally Airs: | >$show.airs #if not $network_timezones.test_timeformat($show.airs) then " (invalid Timeformat) " else ""# |
Show Status: | $show.status |
Default EP Status: | $statusStrings[$show.default_ep_status] |
Location: | $showLoc[0] |
Location: | $showLoc[0] (dir is missing) |
Scene Name: | #if $show.exceptions then $exceptions_string else $show.name# |