Remove unused imports, unused variables, and redundant parentheses

This commit is contained in:
labrys 2016-05-31 04:26:09 -04:00 committed by Labrys
parent b7c7ec000b
commit d15fa76fc9
5 changed files with 10 additions and 18 deletions

View file

@ -1,13 +1,10 @@
# coding=utf-8
import os
import time
import core
import requests
import time
from core.nzbToMediaUtil import convert_to_ascii, remoteDir, server_responding
from core.nzbToMediaSceneExceptions import process_all_exceptions
from core import logger
requests.packages.urllib3.disable_warnings()

View file

@ -6,7 +6,6 @@ import requests
import shutil
from core.nzbToMediaUtil import convert_to_ascii, server_responding
from core.nzbToMediaSceneExceptions import process_all_exceptions
from core import logger
requests.packages.urllib3.disable_warnings()

View file

@ -325,7 +325,7 @@ class autoProcessMovie:
# we will now check to see if CPS has finished renaming before returning to TorrentToMedia and unpausing.
timeout = time.time() + 60 * wait_for
while (time.time() < timeout): # only wait 2 (default) minutes, then return.
while time.time() < timeout: # only wait 2 (default) minutes, then return.
logger.postprocess("Checking for status change, please stand by ...", section)
release = self.get_release(baseURL, imdbid, download_id, release_id)
if release:

View file

@ -132,7 +132,7 @@ class autoProcessMusic:
# we will now wait for this album to be processed before returning to TorrentToMedia and unpausing.
timeout = time.time() + 60 * wait_for
while (time.time() < timeout):
while time.time() < timeout:
current_status = self.get_status(url, apikey, dirName)
if current_status is not None and current_status != release_status: # Something has changed. CPS must have processed this movie.
logger.postprocess("SUCCESS: This release is now marked as status [%s]" % (current_status),section)

View file

@ -18,7 +18,6 @@ requests.packages.urllib3.disable_warnings()
class autoProcessTV:
def command_complete(self, url, params, headers, section):
r = None
try:
r = requests.get(url, params=params, headers=headers, stream=True, verify=False, timeout=(30, 60))
except requests.ConnectionError:
@ -36,7 +35,6 @@ class autoProcessTV:
return None
def CDH(self, url2, headers):
r = None
try:
r = requests.get(url2, params={}, headers=headers, stream=True, verify=False, timeout=(30, 60))
except requests.ConnectionError:
@ -263,7 +261,7 @@ class autoProcessTV:
url = "%s%s:%s%s/api/command" % (protocol, host, port, web_root)
url2 = "%s%s:%s%s/api/config/downloadClient" % (protocol, host, port, web_root)
headers = {"X-Api-Key": apikey}
params = {'sortKey': 'series.title', 'page': 1, 'pageSize': 1, 'sortDir': 'asc'}
# params = {'sortKey': 'series.title', 'page': 1, 'pageSize': 1, 'sortDir': 'asc'}
if remote_path:
logger.debug("remote_path: %s" % (remoteDir(dirName)),section)
data = {"name": "DownloadedEpisodesScan", "path": remoteDir(dirName), "downloadClientId": download_id}
@ -277,7 +275,6 @@ class autoProcessTV:
try:
if section == "SickBeard":
logger.debug("Opening URL: %s with params: %s" % (url, str(fork_params)), section)
r = None
s = requests.Session()
login = "%s%s:%s%s/login" % (protocol,host,port,web_root)
login_params = {'username': username, 'password': password}
@ -285,7 +282,6 @@ class autoProcessTV:
r = s.get(url, auth=(username, password), params=fork_params, stream=True, verify=False, timeout=(30, 1800))
elif section == "NzbDrone":
logger.debug("Opening URL: %s with data: %s" % (url, str(data)), section)
r = None
r = requests.post(url, data=data, headers=headers, stream=True, verify=False, timeout=(30, 1800))
except requests.ConnectionError:
logger.error("Unable to open URL: %s" % (url), section)