Fixed bug for returning requests object exceptions

This commit is contained in:
echel0n 2014-04-01 22:44:47 -07:00
parent 94c908b0c3
commit 23348e0bd0
17 changed files with 23 additions and 20 deletions

View file

@ -37,6 +37,7 @@ except ImportError:
gzip = None
from lib import requests
from lib.requests import exceptions
from lib import cachecontrol
from lib.cachecontrol import caches

View file

@ -32,6 +32,7 @@ except ImportError:
from lib.dateutil.parser import parse
from lib import requests
from lib.requests import exceptions
from lib import cachecontrol
from lib.cachecontrol import caches

View file

@ -9,7 +9,7 @@ from sickbeard.exceptions import ex
from sickbeard.clients import http_error_code
from lib.bencode import bencode, bdecode
from lib import requests
from lib.requests import exceptions
class GenericClient(object):
def __init__(self, name, host=None, username=None, password=None):

View file

@ -34,6 +34,7 @@ import base64
import string
from lib import requests
from lib.requests import exceptions
from itertools import izip, cycle
try:

View file

@ -16,21 +16,10 @@ class APICheck(unittest.TestCase):
indexer_id = 2930
lang = "en"
for indexer in sickbeard.indexerApi.indexers():
print indexer
print sickbeard.indexerApi().config['langabbv_to_id'][lang]
print sickbeard.indexerApi(indexer).cache
print sickbeard.indexerApi(indexer).name
print sickbeard.indexerApi(indexer).config['scene_url']
print sickbeard.indexerApi().config['valid_languages']
lINDEXER_API_PARMS = sickbeard.indexerApi(indexer).api_params.copy()
lINDEXER_API_PARMS['cache'] = True
t = sickbeard.indexerApi(indexer).indexer(**lINDEXER_API_PARMS)
epObj = t[indexer_id].airedOn(1)[0]
season = int(epObj["seasonnumber"])
episodes = [int(epObj["episodenumber"])]
lINDEXER_API_PARMS = sickbeard.indexerApi(2).api_params.copy()
t = sickbeard.indexerApi(2).indexer(**lINDEXER_API_PARMS)
epObj = t[2930]
print epObj
if __name__ == "__main__":
unittest.main()

View file

@ -988,16 +988,16 @@ class PostProcessor(object):
try:
# move the episode and associated files to the show dir
if self.process_method == "copy":
if self.process_method is "copy":
self._copy(self.file_path, dest_path, new_base_name, sickbeard.MOVE_ASSOCIATED_FILES,
sickbeard.USE_SUBTITLES and ep_obj.show.subtitles)
elif self.process_method == "move":
elif self.process_method is "move":
self._move(self.file_path, dest_path, new_base_name, sickbeard.MOVE_ASSOCIATED_FILES,
sickbeard.USE_SUBTITLES and ep_obj.show.subtitles)
elif self.process_method == "hardlink":
elif self.process_method is "hardlink":
self._hardlink(self.file_path, dest_path, new_base_name, sickbeard.MOVE_ASSOCIATED_FILES,
sickbeard.USE_SUBTITLES and ep_obj.show.subtitles)
elif self.process_method == "symlink":
elif self.process_method is "symlink":
self._moveAndSymlink(self.file_path, dest_path, new_base_name, sickbeard.MOVE_ASSOCIATED_FILES,
sickbeard.USE_SUBTITLES and ep_obj.show.subtitles)
else:

View file

@ -34,6 +34,7 @@ from sickbeard.common import Overview
from sickbeard.exceptions import ex
from sickbeard import clients
from lib import requests
from lib.requests import exceptions
from bs4 import BeautifulSoup
from lib.unidecode import unidecode

View file

@ -33,6 +33,7 @@ from sickbeard.common import Overview
from sickbeard.exceptions import ex
from sickbeard import clients
from lib import requests
from lib.requests import exceptions
from bs4 import BeautifulSoup
from lib.unidecode import unidecode

View file

@ -42,6 +42,7 @@ from sickbeard import clients
from sickbeard import tv
from lib import requests
from lib.requests import exceptions
from bs4 import BeautifulSoup
from lib.unidecode import unidecode

View file

@ -36,6 +36,7 @@ from sickbeard.common import Overview
from sickbeard.exceptions import ex
from sickbeard import clients
from lib import requests
from lib.requests import exceptions
from bs4 import BeautifulSoup

View file

@ -41,6 +41,7 @@ from sickbeard import encodingKludge as ek
from sickbeard import clients
from lib import requests
from lib.requests import exceptions
from bs4 import BeautifulSoup
from lib.unidecode import unidecode

View file

@ -32,6 +32,7 @@ from sickbeard import clients
from sickbeard.exceptions import ex
from lib import requests
from lib.requests import exceptions
from bs4 import BeautifulSoup
from lib.bencode import bdecode

View file

@ -34,6 +34,7 @@ from sickbeard.common import Overview
from sickbeard.exceptions import ex
from sickbeard import clients
from lib import requests
from lib.requests import exceptions
from bs4 import BeautifulSoup
from lib.unidecode import unidecode

View file

@ -38,6 +38,7 @@ from sickbeard.common import Overview
from sickbeard.exceptions import ex
from sickbeard import encodingKludge as ek
from lib import requests
from lib.requests import exceptions
from lib.unidecode import unidecode
proxy_dict = {

View file

@ -33,6 +33,7 @@ from sickbeard.common import Overview
from sickbeard.exceptions import ex
from sickbeard import clients
from lib import requests
from lib.requests import exceptions
from bs4 import BeautifulSoup
from lib.unidecode import unidecode

View file

@ -33,6 +33,7 @@ from sickbeard.common import Overview
from sickbeard.exceptions import ex
from sickbeard import clients
from lib import requests
from lib.requests import exceptions
from bs4 import BeautifulSoup
from lib.unidecode import unidecode

View file

@ -34,6 +34,7 @@ from sickbeard import db
from sickbeard import helpers
from sickbeard.exceptions import ex
from lib import requests
from lib.requests import exceptions
MAX_XEM_AGE_SECS = 86400 # 1 day