pep: fix e265

This commit is contained in:
satreix
2016-04-08 23:41:34 -07:00
parent cf42836c95
commit b5f0e0fdcb
9 changed files with 14 additions and 20 deletions

3
.pep8
View File

@@ -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

View File

@@ -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

View File

@@ -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}

View File

@@ -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}

View File

@@ -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'))

View File

@@ -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

View File

@@ -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()

View File

@@ -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

View File

@@ -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: