mirror of
https://github.com/rembo10/headphones.git
synced 2026-05-14 15:49:36 +01:00
pep: fix e265
This commit is contained in:
3
.pep8
3
.pep8
@@ -6,7 +6,6 @@
|
||||
# E126 continuation line over-indented for hanging indent
|
||||
# E127 continuation line over-indented for visual indent
|
||||
# E128 continuation line under-indented for visual indent
|
||||
# E265 block comment should start with '# '
|
||||
# E501 line too long (312 > 160 characters)
|
||||
ignore = E121,E122,E123,E124,E125,E126,E127,E128,E265,E501
|
||||
ignore = E121,E122,E123,E124,E125,E126,E127,E128,E501
|
||||
max-line-length = 160
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
#import unittest
|
||||
#import mock
|
||||
from headphones.unittestcompat import TestCase
|
||||
|
||||
import headphones.albumart
|
||||
|
||||
|
||||
# no tests...
|
||||
class AlbumArtTest(TestCase):
|
||||
def test_nothing(self):
|
||||
x = 100 - 2 * 50
|
||||
|
||||
@@ -283,7 +283,7 @@ class ConfigApiTest(TestCase):
|
||||
""" Config: get_extra_newznabs """
|
||||
path = '/tmp/notexist'
|
||||
|
||||
#itertools.izip(*[itertools.islice('', i, None, 3) for i in range(3)])
|
||||
# itertools.izip(*[itertools.islice('', i, None, 3) for i in range(3)])
|
||||
# set up mocks:
|
||||
# 'EXTRA_NEWZNABS': (list, 'Newznab', ''),
|
||||
# 'EXTRA_TORZNABS': (list, 'Torznab', ''),
|
||||
@@ -372,7 +372,7 @@ class ConfigApiTest(TestCase):
|
||||
""" Config: get_extra_torznabs """
|
||||
path = '/tmp/notexist'
|
||||
|
||||
#itertools.izip(*[itertools.islice('', i, None, 3) for i in range(3)])
|
||||
# itertools.izip(*[itertools.islice('', i, None, 3) for i in range(3)])
|
||||
# set up mocks:
|
||||
# 'EXTRA_TORZNABS': (list, '', ''),
|
||||
self.config_mock["Torznab"] = {"extra_torznabs": conf_value}
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from headphones import logger
|
||||
#from headphones import request
|
||||
|
||||
import time
|
||||
import re
|
||||
@@ -66,8 +65,8 @@ def _scrubber(text):
|
||||
if text.lower().startswith('c:\\users\\'):
|
||||
k = text.split('\\')
|
||||
text = '\\'.join([k[0], k[1], '.....', k[-1]])
|
||||
#partial_link = re.sub('(auth.*?)=.*&','\g<1>=SECRETZ&', link)
|
||||
#partial_link = re.sub('(\w)=[0-9a-zA-Z]*&*','\g<1>=REMOVED&', link)
|
||||
# partial_link = re.sub('(auth.*?)=.*&','\g<1>=SECRETZ&', link)
|
||||
# partial_link = re.sub('(\w)=[0-9a-zA-Z]*&*','\g<1>=REMOVED&', link)
|
||||
except Exception as e:
|
||||
logger.debug('Deluge: Scrubber failed: %s' % str(e))
|
||||
return text
|
||||
@@ -99,10 +98,10 @@ def addTorrent(link, data=None, name=None):
|
||||
logger.debug('Deluge: Using different User-Agent for this site')
|
||||
user_agent = 'Headphones'
|
||||
# This method will make Deluge download the file
|
||||
#logger.debug('Deluge: Letting Deluge download this')
|
||||
#local_torrent_path = _add_torrent_url({'url': link})
|
||||
#logger.debug('Deluge: Returned this local path: %s' % _scrubber(local_torrent_path))
|
||||
#return addTorrent(local_torrent_path)
|
||||
# logger.debug('Deluge: Letting Deluge download this')
|
||||
# local_torrent_path = _add_torrent_url({'url': link})
|
||||
# logger.debug('Deluge: Returned this local path: %s' % _scrubber(local_torrent_path))
|
||||
# return addTorrent(local_torrent_path)
|
||||
else:
|
||||
user_agent = 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2243.2 Safari/537.36'
|
||||
headers = {'User-Agent': user_agent}
|
||||
|
||||
@@ -209,7 +209,7 @@ def libraryScan(dir=None, append=False, ArtistID=None, ArtistName=None,
|
||||
# Sort the song_list by most vague (e.g. no trackid or releaseid) to most specific (both trackid & releaseid)
|
||||
# When we insert into the database, the tracks with the most specific information will overwrite the more general matches
|
||||
|
||||
##############song_list = helpers.multikeysort(song_list, ['ReleaseID', 'TrackID'])
|
||||
# song_list = helpers.multikeysort(song_list, ['ReleaseID', 'TrackID'])
|
||||
song_list = helpers.multikeysort(song_list, ['ArtistName', 'AlbumTitle'])
|
||||
|
||||
# We'll use this to give a % completion, just because the track matching might take a while
|
||||
@@ -317,7 +317,7 @@ def libraryScan(dir=None, append=False, ArtistID=None, ArtistName=None,
|
||||
newValueDict2 = {'Matched': "Failed"}
|
||||
myDB.upsert("have", newValueDict2, controlValueDict2)
|
||||
|
||||
#######myDB.action('INSERT INTO have (ArtistName, AlbumTitle, TrackNumber, TrackTitle, TrackLength, BitRate, Genre, Date, TrackID, Location, CleanName, Format) VALUES( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', [song['ArtistName'], song['AlbumTitle'], song['TrackNumber'], song['TrackTitle'], song['TrackLength'], song['BitRate'], song['Genre'], song['Date'], song['TrackID'], song['Location'], CleanName, song['Format']])
|
||||
# myDB.action('INSERT INTO have (ArtistName, AlbumTitle, TrackNumber, TrackTitle, TrackLength, BitRate, Genre, Date, TrackID, Location, CleanName, Format) VALUES( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', [song['ArtistName'], song['AlbumTitle'], song['TrackNumber'], song['TrackTitle'], song['TrackLength'], song['BitRate'], song['Genre'], song['Date'], song['TrackID'], song['Location'], CleanName, song['Format']])
|
||||
|
||||
logger.info('Completed matching tracks from directory: %s' % dir.decode(headphones.SYS_ENCODING,
|
||||
'replace'))
|
||||
|
||||
@@ -55,7 +55,7 @@ def request_response(url, method="get", auto_raise=True,
|
||||
# pose a security issue!
|
||||
kwargs["verify"] = bool(headphones.CONFIG.VERIFY_SSL_CERT)
|
||||
|
||||
#This fix is put in place for systems with broken SSL (like QNAP)
|
||||
# This fix is put in place for systems with broken SSL (like QNAP)
|
||||
if not headphones.CONFIG.VERIFY_SSL_CERT and sys.version_info >= (2, 7, 9):
|
||||
try:
|
||||
import ssl
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import os
|
||||
|
||||
from headphones.exceptions import SoftChrootError
|
||||
|
||||
|
||||
@@ -13,7 +14,7 @@ class SoftChroot(object):
|
||||
|
||||
def __init__(self, path):
|
||||
if not path:
|
||||
#disabled
|
||||
# disabled
|
||||
return
|
||||
|
||||
path = path.strip()
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import os
|
||||
import mock
|
||||
from headphones.unittestcompat import TestCase, TestArgs
|
||||
#from mock import MagicMock
|
||||
|
||||
from headphones.softchroot import SoftChroot
|
||||
from headphones.exceptions import SoftChrootError
|
||||
|
||||
@@ -1465,7 +1465,6 @@ class WebInterface(object):
|
||||
continue
|
||||
conftype = _conf[1]
|
||||
|
||||
#print '===>', conftype
|
||||
if conftype is headphones.config.path:
|
||||
nv = headphones.SOFT_CHROOT.revoke(v)
|
||||
if nv != v:
|
||||
|
||||
Reference in New Issue
Block a user