Merge pull request #1604 from clinton-hall/fix/flake8

Fix/flake8
This commit is contained in:
Labrys of Knossos 2019-04-07 13:51:51 -04:00 committed by GitHub
commit e4b03005a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 122 additions and 108 deletions

View file

@ -1,16 +1,15 @@
#!/usr/bin/env python #!/usr/bin/env python
# coding=utf-8 # coding=utf-8
import eol
eol.check()
import cleanup
cleanup.clean(cleanup.FOLDER_STRUCTURE)
import datetime import datetime
import os import os
import sys import sys
import eol
import cleanup
eol.check()
cleanup.clean(cleanup.FOLDER_STRUCTURE)
import core import core
from core import logger, main_db from core import logger, main_db
from core.auto_process import comics, games, movies, music, tv, books from core.auto_process import comics, games, movies, music, tv, books
@ -18,7 +17,11 @@ from core.auto_process.common import ProcessResult
from core.plugins.plex import plex_update from core.plugins.plex import plex_update
from core.user_scripts import external_script from core.user_scripts import external_script
from core.utils import char_replace, convert_to_ascii, replace_links from core.utils import char_replace, convert_to_ascii, replace_links
from six import text_type
try:
text_type = unicode
except NameError:
text_type = str
def process_torrent(input_directory, input_name, input_category, input_hash, input_id, client_agent): def process_torrent(input_directory, input_name, input_category, input_hash, input_id, client_agent):
@ -60,13 +63,13 @@ def process_torrent(input_directory, input_name, input_category, input_hash, inp
input_category = 'UNCAT' input_category = 'UNCAT'
usercat = input_category usercat = input_category
#try: # try:
# input_name = input_name.encode(core.SYS_ENCODING) # input_name = input_name.encode(core.SYS_ENCODING)
#except UnicodeError: # except UnicodeError:
# pass # pass
#try: # try:
# input_directory = input_directory.encode(core.SYS_ENCODING) # input_directory = input_directory.encode(core.SYS_ENCODING)
#except UnicodeError: # except UnicodeError:
# pass # pass
logger.debug('Determined Directory: {0} | Name: {1} | Category: {2}'.format logger.debug('Determined Directory: {0} | Name: {1} | Category: {2}'.format
@ -125,9 +128,9 @@ def process_torrent(input_directory, input_name, input_category, input_hash, inp
else: else:
output_destination = os.path.normpath( output_destination = os.path.normpath(
core.os.path.join(core.OUTPUT_DIRECTORY, input_category)) core.os.path.join(core.OUTPUT_DIRECTORY, input_category))
#try: # try:
# output_destination = output_destination.encode(core.SYS_ENCODING) # output_destination = output_destination.encode(core.SYS_ENCODING)
#except UnicodeError: # except UnicodeError:
# pass # pass
if output_destination in input_directory: if output_destination in input_directory:
@ -170,9 +173,9 @@ def process_torrent(input_directory, input_name, input_category, input_hash, inp
core.os.path.join(output_destination, os.path.basename(file_path)), full_file_name) core.os.path.join(output_destination, os.path.basename(file_path)), full_file_name)
logger.debug('Setting outputDestination to {0} to preserve folder structure'.format logger.debug('Setting outputDestination to {0} to preserve folder structure'.format
(os.path.dirname(target_file))) (os.path.dirname(target_file)))
#try: # try:
# target_file = target_file.encode(core.SYS_ENCODING) # target_file = target_file.encode(core.SYS_ENCODING)
#except UnicodeError: # except UnicodeError:
# pass # pass
if root == 1: if root == 1:
if not found_file: if not found_file:
@ -259,7 +262,6 @@ def process_torrent(input_directory, input_name, input_category, input_hash, inp
elif section_name == 'LazyLibrarian': elif section_name == 'LazyLibrarian':
result = books.process(section_name, output_destination, input_name, status, client_agent, input_category) result = books.process(section_name, output_destination, input_name, status, client_agent, input_category)
plex_update(input_category) plex_update(input_category)
if result.status_code != 0: if result.status_code != 0:
@ -279,7 +281,7 @@ def process_torrent(input_directory, input_name, input_category, input_hash, inp
# remove torrent # remove torrent
if core.USE_LINK == 'move-sym' and not core.DELETE_ORIGINAL == 1: if core.USE_LINK == 'move-sym' and not core.DELETE_ORIGINAL == 1:
logger.debug('Checking for sym-links to re-direct in: {0}'.format(input_directory)) logger.debug('Checking for sym-links to re-direct in: {0}'.format(input_directory))
for dirpath, dirs, files in os.walk(input_directory): for dirpath, _, files in os.walk(input_directory):
for file in files: for file in files:
logger.debug('Checking symlink: {0}'.format(os.path.join(dirpath, file))) logger.debug('Checking symlink: {0}'.format(os.path.join(dirpath, file)))
replace_links(os.path.join(dirpath, file)) replace_links(os.path.join(dirpath, file))
@ -353,14 +355,14 @@ def main(args):
if client_agent.lower() not in core.TORRENT_CLIENTS: if client_agent.lower() not in core.TORRENT_CLIENTS:
continue continue
#try: # try:
# dir_name = dir_name.encode(core.SYS_ENCODING) # dir_name = dir_name.encode(core.SYS_ENCODING)
#except UnicodeError: # except UnicodeError:
# pass # pass
input_name = os.path.basename(dir_name) input_name = os.path.basename(dir_name)
#try: # try:
# input_name = input_name.encode(core.SYS_ENCODING) # input_name = input_name.encode(core.SYS_ENCODING)
#except UnicodeError: # except UnicodeError:
# pass # pass
results = process_torrent(dir_name, input_name, subsection, input_hash or None, input_id or None, results = process_torrent(dir_name, input_name, subsection, input_hash or None, input_id or None,

View file

@ -25,6 +25,7 @@ FOLDER_STRUCTURE = {
class WorkingDirectory(object): class WorkingDirectory(object):
"""Context manager for changing current working directory.""" """Context manager for changing current working directory."""
def __init__(self, new, original=None): def __init__(self, new, original=None):
self.working_directory = new self.working_directory = new
self.original_directory = os.getcwd() if original is None else original self.original_directory = os.getcwd() if original is None else original
@ -43,7 +44,7 @@ class WorkingDirectory(object):
original_directory=self.original_directory, original_directory=self.original_directory,
error=error, error=error,
working_directory=self.working_directory, working_directory=self.working_directory,
) ),
) )

4
eol.py
View file

@ -157,7 +157,7 @@ def print_statuses(show_expired=False):
major=python_version[0], major=python_version[0],
minor=python_version[1], minor=python_version[1],
remaining=days_left, remaining=days_left,
) ),
) )
if not show_expired: if not show_expired:
return return
@ -171,7 +171,7 @@ def print_statuses(show_expired=False):
major=python_version[0], major=python_version[0],
minor=python_version[1], minor=python_version[1],
remaining=-days_left, remaining=-days_left,
) ),
) )

View file

@ -1,7 +1,8 @@
# coding=utf-8 # coding=utf-8
"""A synchronous implementation of the Deluge RPC protocol """
based on gevent-deluge by Christopher Rosell. A synchronous implementation of the Deluge RPC protocol.
Based on gevent-deluge by Christopher Rosell:
https://github.com/chrippa/gevent-deluge https://github.com/chrippa/gevent-deluge
Example usage: Example usage:
@ -18,6 +19,6 @@ Example usage:
from .exceptions import DelugeRPCError from .exceptions import DelugeRPCError
__title__ = "synchronous-deluge" __title__ = 'synchronous-deluge'
__version__ = "0.1" __version__ = '0.1'
__author__ = "Christian Dale" __author__ = 'Christian Dale'

View file

@ -9,7 +9,7 @@ from .exceptions import DelugeRPCError
from .protocol import DelugeRPCRequest, DelugeRPCResponse from .protocol import DelugeRPCRequest, DelugeRPCResponse
from .transfer import DelugeTransfer from .transfer import DelugeTransfer
__all__ = ["DelugeClient"] __all__ = ['DelugeClient']
RPC_RESPONSE = 1 RPC_RESPONSE = 1
RPC_ERROR = 2 RPC_ERROR = 2
@ -18,41 +18,41 @@ RPC_EVENT = 3
class DelugeClient(object): class DelugeClient(object):
def __init__(self): def __init__(self):
"""A deluge client session.""" """Create a deluge client session."""
self.transfer = DelugeTransfer() self.transfer = DelugeTransfer()
self.modules = [] self.modules = []
self._request_counter = 0 self._request_counter = 0
def _get_local_auth(self): def _get_local_auth(self):
username = password = "" username = password = ''
if platform.system() in ('Windows', 'Microsoft'): if platform.system() in ('Windows', 'Microsoft'):
app_data_path = os.environ.get("APPDATA") app_data_path = os.environ.get('APPDATA')
if not app_data_path: if not app_data_path:
from six.moves import winreg from six.moves import winreg
hkey = winreg.OpenKey( hkey = winreg.OpenKey(
winreg.HKEY_CURRENT_USER, winreg.HKEY_CURRENT_USER,
"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", 'Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders',
) )
app_data_reg = winreg.QueryValueEx(hkey, "AppData") app_data_reg = winreg.QueryValueEx(hkey, 'AppData')
app_data_path = app_data_reg[0] app_data_path = app_data_reg[0]
winreg.CloseKey(hkey) winreg.CloseKey(hkey)
auth_file = os.path.join(app_data_path, "deluge", "auth") auth_file = os.path.join(app_data_path, 'deluge', 'auth')
else: else:
from xdg.BaseDirectory import save_config_path from xdg.BaseDirectory import save_config_path
try: try:
auth_file = os.path.join(save_config_path("deluge"), "auth") auth_file = os.path.join(save_config_path('deluge'), 'auth')
except OSError: except OSError:
return username, password return username, password
if os.path.exists(auth_file): if os.path.exists(auth_file):
for line in open(auth_file): for line in open(auth_file):
if line.startswith("#"): if line.startswith('#'):
# This is a comment line # This is a comment line
continue continue
line = line.strip() line = line.strip()
try: try:
lsplit = line.split(":") lsplit = line.split(':')
except Exception: except Exception:
continue continue
@ -63,13 +63,13 @@ class DelugeClient(object):
else: else:
continue continue
if username == "localclient": if username == 'localclient':
return username, password return username, password
return "", "" return '', ''
def _create_module_method(self, module, method): def _create_module_method(self, module, method):
fullname = "{0}.{1}".format(module, method) fullname = '{0}.{1}'.format(module, method)
def func(obj, *args, **kwargs): def func(obj, *args, **kwargs):
return self.remote_call(fullname, *args, **kwargs) return self.remote_call(fullname, *args, **kwargs)
@ -80,18 +80,18 @@ class DelugeClient(object):
def _introspect(self): def _introspect(self):
def splitter(value): def splitter(value):
return value.split(".") return value.split('.')
self.modules = [] self.modules = []
methods = self.remote_call("daemon.get_method_list").get() methods = self.remote_call('daemon.get_method_list').get()
methodmap = defaultdict(dict) methodmap = defaultdict(dict)
for module, method in imap(splitter, methods): for module, method in imap(splitter, methods):
methodmap[module][method] = self._create_module_method(module, method) methodmap[module][method] = self._create_module_method(module, method)
for module, methods in methodmap.items(): for module, methods in methodmap.items():
clsname = "DelugeModule{0}".format(module.capitalize()) clsname = 'DelugeModule{0}'.format(module.capitalize())
cls = type(clsname, (), methods) cls = type(clsname, (), methods)
setattr(self, module, cls()) setattr(self, module, cls())
self.modules.append(module) self.modules.append(module)
@ -133,24 +133,23 @@ class DelugeClient(object):
self._request_counter += 1 self._request_counter += 1
return response return response
def connect(self, host="127.0.0.1", port=58846, username="", password=""): def connect(self, host='127.0.0.1', port=58846, username='', password=''):
"""Connects to a daemon process. """Connect to a daemon process.
:param host: str, the hostname of the daemon :param host: str, the hostname of the daemon
:param port: int, the port of the daemon :param port: int, the port of the daemon
:param username: str, the username to login with :param username: str, the username to login with
:param password: str, the password to login with :param password: str, the password to login with
""" """
# Connect transport # Connect transport
self.transfer.connect((host, port)) self.transfer.connect((host, port))
# Attempt to fetch local auth info if needed # Attempt to fetch local auth info if needed
if not username and host in ("127.0.0.1", "localhost"): if not username and host in ('127.0.0.1', 'localhost'):
username, password = self._get_local_auth() username, password = self._get_local_auth()
# Authenticate # Authenticate
self.remote_call("daemon.login", username, password).get() self.remote_call('daemon.login', username, password).get()
# Introspect available methods # Introspect available methods
self._introspect() self._introspect()

View file

@ -8,4 +8,4 @@ class DelugeRPCError(Exception):
self.traceback = traceback self.traceback = traceback
def __str__(self): def __str__(self):
return "{0}: {1}: {2}".format(self.__class__.__name__, self.name, self.msg) return '{0}: {1}: {2}'.format(self.__class__.__name__, self.name, self.msg)

View file

@ -6,7 +6,7 @@ import zlib
import rencode import rencode
__all__ = ["DelugeTransfer"] __all__ = ['DelugeTransfer']
class DelugeTransfer(object): class DelugeTransfer(object):
@ -33,7 +33,7 @@ class DelugeTransfer(object):
payload = zlib.compress(rencode.dumps(data)) payload = zlib.compress(rencode.dumps(data))
self.conn.sendall(payload) self.conn.sendall(payload)
buf = b"" buf = b''
while True: while True:
data = self.conn.recv(1024) data = self.conn.recv(1024)

View file

@ -31,8 +31,7 @@ class UTorrentClient(object):
# TODO refresh token, when necessary # TODO refresh token, when necessary
def _make_opener(self, realm, base_url, username, password): def _make_opener(self, realm, base_url, username, password):
"""uTorrent API need HTTP Basic Auth and cookie support for token verify.""" """HTTP Basic Auth and cookie support for token verification."""
auth_handler = HTTPBasicAuthHandler() auth_handler = HTTPBasicAuthHandler()
auth_handler.add_password(realm=realm, auth_handler.add_password(realm=realm,
uri=base_url, uri=base_url,
@ -61,25 +60,25 @@ class UTorrentClient(object):
return self._action(params) return self._action(params)
def start(self, *hashes): def start(self, *hashes):
params = [('action', 'start'), ] params = [('action', 'start')]
for cur_hash in hashes: for cur_hash in hashes:
params.append(('hash', cur_hash)) params.append(('hash', cur_hash))
return self._action(params) return self._action(params)
def stop(self, *hashes): def stop(self, *hashes):
params = [('action', 'stop'), ] params = [('action', 'stop')]
for cur_hash in hashes: for cur_hash in hashes:
params.append(('hash', cur_hash)) params.append(('hash', cur_hash))
return self._action(params) return self._action(params)
def pause(self, *hashes): def pause(self, *hashes):
params = [('action', 'pause'), ] params = [('action', 'pause')]
for cur_hash in hashes: for cur_hash in hashes:
params.append(('hash', cur_hash)) params.append(('hash', cur_hash))
return self._action(params) return self._action(params)
def forcestart(self, *hashes): def forcestart(self, *hashes):
params = [('action', 'forcestart'), ] params = [('action', 'forcestart')]
for cur_hash in hashes: for cur_hash in hashes:
params.append(('hash', cur_hash)) params.append(('hash', cur_hash))
return self._action(params) return self._action(params)
@ -95,8 +94,8 @@ class UTorrentClient(object):
def setprops(self, cur_hash, **kvpairs): def setprops(self, cur_hash, **kvpairs):
params = [('action', 'setprops'), ('hash', cur_hash)] params = [('action', 'setprops'), ('hash', cur_hash)]
for k, v in iteritems(kvpairs): for k, v in iteritems(kvpairs):
params.append(("s", k)) params.append(('s', k))
params.append(("v", v)) params.append(('v', v))
return self._action(params) return self._action(params)
@ -125,13 +124,13 @@ class UTorrentClient(object):
self._action(params) self._action(params)
def remove(self, *hashes): def remove(self, *hashes):
params = [('action', 'remove'), ] params = [('action', 'remove')]
for cur_hash in hashes: for cur_hash in hashes:
params.append(('hash', cur_hash)) params.append(('hash', cur_hash))
return self._action(params) return self._action(params)
def removedata(self, *hashes): def removedata(self, *hashes):
params = [('action', 'removedata'), ] params = [('action', 'removedata')]
for cur_hash in hashes: for cur_hash in hashes:
params.append(('hash', cur_hash)) params.append(('hash', cur_hash))
return self._action(params) return self._action(params)

View file

@ -36,7 +36,7 @@ class MultiPartForm(object):
# Build a list of lists, each containing "lines" of the # Build a list of lists, each containing "lines" of the
# request. Each part is separated by a boundary string. # request. Each part is separated by a boundary string.
# Once the list is built, return a string where each # Once the list is built, return a string where each
# line is separated by '\r\n'. # line is separated by '\r\n'.
parts = [] parts = []
part_boundary = '--' + self.boundary part_boundary = '--' + self.boundary

View file

@ -99,7 +99,7 @@
# #
# Enter Mount points as LocalPath,RemotePath and separate each pair with '|' # Enter Mount points as LocalPath,RemotePath and separate each pair with '|'
# e.g. mountPoints=/volume1/Public/,E:\|/volume2/share/,\\NAS\ # e.g. mountPoints=/volume1/Public/,E:\|/volume2/share/,\\NAS\
#mountPoints= #mountPoints=
## Extensions ## Extensions
@ -134,7 +134,7 @@
# subLanguages. # subLanguages.
# #
# subLanguages. create a list of languages in the order you want them in your subtitles. # subLanguages. create a list of languages in the order you want them in your subtitles.
#subLanguages=eng,spa,fra #subLanguages=eng,spa,fra
# Transcode (0, 1). # Transcode (0, 1).
@ -216,7 +216,7 @@
# ffmpeg output settings. # ffmpeg output settings.
#outputVideoExtension=.mp4 #outputVideoExtension=.mp4
#outputVideoCodec=libx264 #outputVideoCodec=libx264
#VideoCodecAllow= #VideoCodecAllow=
#outputVideoResolution=720:-1 #outputVideoResolution=720:-1
#outputVideoPreset=medium #outputVideoPreset=medium
#outputVideoFramerate=24 #outputVideoFramerate=24
@ -227,7 +227,7 @@
#outputAudioBitrate=640k #outputAudioBitrate=640k
#outputQualityPercent= #outputQualityPercent=
#outputAudioTrack2Codec=libfaac #outputAudioTrack2Codec=libfaac
#AudioCodec2Allow= #AudioCodec2Allow=
#outputAudioTrack2Channels=2 #outputAudioTrack2Channels=2
#outputAudioTrack2Bitrate=160k #outputAudioTrack2Bitrate=160k
#outputAudioOtherCodec=libmp3lame #outputAudioOtherCodec=libmp3lame

View file

@ -101,7 +101,7 @@
# #
# Enter Mount points as LocalPath,RemotePath and separate each pair with '|' # Enter Mount points as LocalPath,RemotePath and separate each pair with '|'
# e.g. mountPoints=/volume1/Public/,E:\|/volume2/share/,\\NAS\ # e.g. mountPoints=/volume1/Public/,E:\|/volume2/share/,\\NAS\
#mountPoints= #mountPoints=
## WakeOnLan ## WakeOnLan

View file

@ -84,7 +84,7 @@
# #
# Enter Mount points as LocalPath,RemotePath and separate each pair with '|' # Enter Mount points as LocalPath,RemotePath and separate each pair with '|'
# e.g. mountPoints=/volume1/Public/,E:\|/volume2/share/,\\NAS\ # e.g. mountPoints=/volume1/Public/,E:\|/volume2/share/,\\NAS\
#mountPoints= #mountPoints=
## Extensions ## Extensions
@ -119,7 +119,7 @@
# subLanguages. # subLanguages.
# #
# subLanguages. create a list of languages in the order you want them in your subtitles. # subLanguages. create a list of languages in the order you want them in your subtitles.
#subLanguages = eng,spa,fra #subLanguages = eng,spa,fra
# Transcode (0, 1). # Transcode (0, 1).
@ -145,7 +145,7 @@
# outputVideoPath. # outputVideoPath.
# #
# outputVideoPath. Set path you want transcoded videos moved to. Leave blank to disable. # outputVideoPath. Set path you want transcoded videos moved to. Leave blank to disable.
#outputVideoPath = #outputVideoPath =
# processOutput (0,1). # processOutput (0,1).
# #
@ -201,20 +201,20 @@
# ffmpeg output settings. # ffmpeg output settings.
#outputVideoExtension=.mp4 #outputVideoExtension=.mp4
#outputVideoCodec=libx264 #outputVideoCodec=libx264
#VideoCodecAllow = #VideoCodecAllow =
#outputVideoResolution=720:-1 #outputVideoResolution=720:-1
#outputVideoPreset=medium #outputVideoPreset=medium
#outputVideoFramerate=24 #outputVideoFramerate=24
#outputVideoBitrate=800k #outputVideoBitrate=800k
#outputAudioCodec=libmp3lame #outputAudioCodec=libmp3lame
#AudioCodecAllow = #AudioCodecAllow =
#outputAudioBitrate=128k #outputAudioBitrate=128k
#outputQualityPercent = 0 #outputQualityPercent = 0
#outputAudioTrack2Codec = libfaac #outputAudioTrack2Codec = libfaac
#AudioCodec2Allow = #AudioCodec2Allow =
#outputAudioTrack2Bitrate = 128k #outputAudioTrack2Bitrate = 128k
#outputAudioOtherCodec = libmp3lame #outputAudioOtherCodec = libmp3lame
#AudioOtherCodecAllow = #AudioOtherCodecAllow =
#outputAudioOtherBitrate = 128k #outputAudioOtherBitrate = 128k
#outputSubtitleCodec = #outputSubtitleCodec =

View file

@ -450,7 +450,7 @@
# #
# Enter Mount points as LocalPath,RemotePath and separate each pair with '|' # Enter Mount points as LocalPath,RemotePath and separate each pair with '|'
# e.g. mountPoints=/volume1/Public/,E:\|/volume2/share/,\\NAS\ # e.g. mountPoints=/volume1/Public/,E:\|/volume2/share/,\\NAS\
#mountPoints= #mountPoints=
## Extensions ## Extensions
@ -485,7 +485,7 @@
# subLanguages. # subLanguages.
# #
# subLanguages. create a list of languages in the order you want them in your subtitles. # subLanguages. create a list of languages in the order you want them in your subtitles.
#subLanguages=eng,spa,fra #subLanguages=eng,spa,fra
# Transcode (0, 1). # Transcode (0, 1).
@ -567,7 +567,7 @@
# ffmpeg output settings. # ffmpeg output settings.
#outputVideoExtension=.mp4 #outputVideoExtension=.mp4
#outputVideoCodec=libx264 #outputVideoCodec=libx264
#VideoCodecAllow= #VideoCodecAllow=
#outputVideoResolution=720:-1 #outputVideoResolution=720:-1
#outputVideoPreset=medium #outputVideoPreset=medium
#outputVideoFramerate=24 #outputVideoFramerate=24
@ -578,7 +578,7 @@
#outputAudioBitrate=640k #outputAudioBitrate=640k
#outputQualityPercent= #outputQualityPercent=
#outputAudioTrack2Codec=libfaac #outputAudioTrack2Codec=libfaac
#AudioCodec2Allow= #AudioCodec2Allow=
#outputAudioTrack2Channels=2 #outputAudioTrack2Channels=2
#outputAudioTrack2Bitrate=160k #outputAudioTrack2Bitrate=160k
#outputAudioOtherCodec=libmp3lame #outputAudioOtherCodec=libmp3lame
@ -657,16 +657,16 @@
from __future__ import print_function from __future__ import print_function
import eol
eol.check()
import cleanup
cleanup.clean(cleanup.FOLDER_STRUCTURE)
import datetime import datetime
import os import os
import sys import sys
import eol
import cleanup
eol.check()
cleanup.clean(cleanup.FOLDER_STRUCTURE)
import core import core
from core import logger, main_db from core import logger, main_db
from core.auto_process import comics, games, movies, music, tv, books from core.auto_process import comics, games, movies, music, tv, books

View file

@ -92,7 +92,7 @@
# #
# Enter Mount points as LocalPath,RemotePath and separate each pair with '|' # Enter Mount points as LocalPath,RemotePath and separate each pair with '|'
# e.g. mountPoints=/volume1/Public/,E:\|/volume2/share/,\\NAS\ # e.g. mountPoints=/volume1/Public/,E:\|/volume2/share/,\\NAS\
#mountPoints= #mountPoints=
## WakeOnLan ## WakeOnLan

View file

@ -89,7 +89,7 @@
# #
# Enter Mount points as LocalPath,RemotePath and separate each pair with '|' # Enter Mount points as LocalPath,RemotePath and separate each pair with '|'
# e.g. mountPoints=/volume1/Public/,E:\|/volume2/share/,\\NAS\ # e.g. mountPoints=/volume1/Public/,E:\|/volume2/share/,\\NAS\
#mountPoints= #mountPoints=
## Extensions ## Extensions
@ -124,7 +124,7 @@
# subLanguages. # subLanguages.
# #
# subLanguages. create a list of languages in the order you want them in your subtitles. # subLanguages. create a list of languages in the order you want them in your subtitles.
#subLanguages = eng,spa,fra #subLanguages = eng,spa,fra
# Transcode (0, 1). # Transcode (0, 1).
@ -150,7 +150,7 @@
# outputVideoPath. # outputVideoPath.
# #
# outputVideoPath. Set path you want transcoded videos moved to. Leave blank to disable. # outputVideoPath. Set path you want transcoded videos moved to. Leave blank to disable.
#outputVideoPath = #outputVideoPath =
# processOutput (0,1). # processOutput (0,1).
# #
@ -206,20 +206,20 @@
# ffmpeg output settings. # ffmpeg output settings.
#outputVideoExtension=.mp4 #outputVideoExtension=.mp4
#outputVideoCodec=libx264 #outputVideoCodec=libx264
#VideoCodecAllow = #VideoCodecAllow =
#outputVideoResolution=720:-1 #outputVideoResolution=720:-1
#outputVideoPreset=medium #outputVideoPreset=medium
#outputVideoFramerate=24 #outputVideoFramerate=24
#outputVideoBitrate=800k #outputVideoBitrate=800k
#outputAudioCodec=libmp3lame #outputAudioCodec=libmp3lame
#AudioCodecAllow = #AudioCodecAllow =
#outputAudioBitrate=128k #outputAudioBitrate=128k
#outputQualityPercent = 0 #outputQualityPercent = 0
#outputAudioTrack2Codec = libfaac #outputAudioTrack2Codec = libfaac
#AudioCodec2Allow = #AudioCodec2Allow =
#outputAudioTrack2Bitrate = 128k #outputAudioTrack2Bitrate = 128k
#outputAudioOtherCodec = libmp3lame #outputAudioOtherCodec = libmp3lame
#AudioOtherCodecAllow = #AudioOtherCodecAllow =
#outputAudioOtherBitrate = 128k #outputAudioOtherBitrate = 128k
#outputSubtitleCodec = #outputSubtitleCodec =

View file

@ -94,7 +94,7 @@
# #
# Enter Mount points as LocalPath,RemotePath and separate each pair with '|' # Enter Mount points as LocalPath,RemotePath and separate each pair with '|'
# e.g. mountPoints=/volume1/Public/,E:\|/volume2/share/,\\NAS\ # e.g. mountPoints=/volume1/Public/,E:\|/volume2/share/,\\NAS\
#mountPoints= #mountPoints=
## Extensions ## Extensions
@ -129,7 +129,7 @@
# subLanguages. # subLanguages.
# #
# subLanguages. create a list of languages in the order you want them in your subtitles. # subLanguages. create a list of languages in the order you want them in your subtitles.
#subLanguages = eng,spa,fra #subLanguages = eng,spa,fra
# Transcode (0, 1). # Transcode (0, 1).
@ -155,7 +155,7 @@
# outputVideoPath. # outputVideoPath.
# #
# outputVideoPath. Set path you want transcoded videos moved to. Leave blank to disable. # outputVideoPath. Set path you want transcoded videos moved to. Leave blank to disable.
#outputVideoPath = #outputVideoPath =
# processOutput (0,1). # processOutput (0,1).
# #
@ -211,20 +211,20 @@
# ffmpeg output settings. # ffmpeg output settings.
#outputVideoExtension=.mp4 #outputVideoExtension=.mp4
#outputVideoCodec=libx264 #outputVideoCodec=libx264
#VideoCodecAllow = #VideoCodecAllow =
#outputVideoResolution=720:-1 #outputVideoResolution=720:-1
#outputVideoPreset=medium #outputVideoPreset=medium
#outputVideoFramerate=24 #outputVideoFramerate=24
#outputVideoBitrate=800k #outputVideoBitrate=800k
#outputAudioCodec=libmp3lame #outputAudioCodec=libmp3lame
#AudioCodecAllow = #AudioCodecAllow =
#outputAudioBitrate=128k #outputAudioBitrate=128k
#outputQualityPercent = 0 #outputQualityPercent = 0
#outputAudioTrack2Codec = libfaac #outputAudioTrack2Codec = libfaac
#AudioCodec2Allow = #AudioCodec2Allow =
#outputAudioTrack2Bitrate = 128k #outputAudioTrack2Bitrate = 128k
#outputAudioOtherCodec = libmp3lame #outputAudioOtherCodec = libmp3lame
#AudioOtherCodecAllow = #AudioOtherCodecAllow =
#outputAudioOtherBitrate = 128k #outputAudioOtherBitrate = 128k
#outputSubtitleCodec = #outputSubtitleCodec =

View file

@ -100,7 +100,7 @@
# #
# Enter Mount points as LocalPath,RemotePath and separate each pair with '|' # Enter Mount points as LocalPath,RemotePath and separate each pair with '|'
# e.g. mountPoints=/volume1/Public/,E:\|/volume2/share/,\\NAS\ # e.g. mountPoints=/volume1/Public/,E:\|/volume2/share/,\\NAS\
#mountPoints= #mountPoints=
## Extensions ## Extensions
@ -135,7 +135,7 @@
# subLanguages. # subLanguages.
# #
# subLanguages. create a list of languages in the order you want them in your subtitles. # subLanguages. create a list of languages in the order you want them in your subtitles.
#subLanguages=eng,spa,fra #subLanguages=eng,spa,fra
# Transcode (0, 1). # Transcode (0, 1).
@ -217,7 +217,7 @@
# ffmpeg output settings. # ffmpeg output settings.
#outputVideoExtension=.mp4 #outputVideoExtension=.mp4
#outputVideoCodec=libx264 #outputVideoCodec=libx264
#VideoCodecAllow= #VideoCodecAllow=
#outputVideoResolution=720:-1 #outputVideoResolution=720:-1
#outputVideoPreset=medium #outputVideoPreset=medium
#outputVideoFramerate=24 #outputVideoFramerate=24
@ -228,7 +228,7 @@
#outputAudioBitrate=640k #outputAudioBitrate=640k
#outputQualityPercent= #outputQualityPercent=
#outputAudioTrack2Codec=libfaac #outputAudioTrack2Codec=libfaac
#AudioCodec2Allow= #AudioCodec2Allow=
#outputAudioTrack2Channels=2 #outputAudioTrack2Channels=2
#outputAudioTrack2Bitrate=160k #outputAudioTrack2Bitrate=160k
#outputAudioOtherCodec=libmp3lame #outputAudioOtherCodec=libmp3lame

16
tox.ini
View file

@ -33,6 +33,15 @@ commands =
max-line-length = 79 max-line-length = 79
verbose = 2 verbose = 2
statistics = True statistics = True
exclude =
.github/
.tox/
.pytest_cache/
htmlcov/
logs/
libs/common
libs/win
libs/py2
ignore = ignore =
; -- flake8 -- ; -- flake8 --
; E501 line too long ; E501 line too long
@ -57,10 +66,13 @@ ignore =
per-file-ignores = per-file-ignores =
; F401 imported but unused ; F401 imported but unused
; E402 module level import not at top of file ; E402 module level import not at top of file
nzbTo*.py: E265, E266, E402
TorrentToMedia.py: E402
core/__init__.py: E402, F401 core/__init__.py: E402, F401
core/utils/__init__.py: F401 core/utils/__init__.py: F401
core/plugins/downloaders/configuration.py: F401 core/plugins/downloaders/configuration.py: F401
core/plugins/downloaders/utils.py: F401 core/plugins/downloaders/utils.py: F401
libs/custom/synchronousdeluge/__init__.py: F401
[testenv:check] [testenv:check]
deps = deps =
@ -74,13 +86,13 @@ skip_install = true
commands = commands =
; ** PRIMARY TESTS ** ; ** PRIMARY TESTS **
; Run flake8 tests (with plugins) using default test selections ; Run flake8 tests (with plugins) using default test selections
flake8 core tests setup.py flake8
; ** SELECTIVE TESTS ** ; ** SELECTIVE TESTS **
; Run flake8 tests (with plugins) for specific optional codes defined below ; Run flake8 tests (with plugins) for specific optional codes defined below
; -- flake8-bugbear -- ; -- flake8-bugbear --
; B902 Invalid first argument used for instance method. ; B902 Invalid first argument used for instance method.
; B903 Data class should be immutable or use __slots__ to save memory. ; B903 Data class should be immutable or use __slots__ to save memory.
flake8 core tests setup.py --select=B902,B903 flake8 --select=B902,B903
[coverage:run] [coverage:run]
omit = omit =