diff --git a/.pep8 b/.pep8 index 43eb91f9..2abaf2ca 100644 --- a/.pep8 +++ b/.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 diff --git a/headphones/albumart_test.py b/headphones/albumart_test.py index e1b80c02..948b70f2 100644 --- a/headphones/albumart_test.py +++ b/headphones/albumart_test.py @@ -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 diff --git a/headphones/config_test.py b/headphones/config_test.py index 1cd5367f..77fda697 100644 --- a/headphones/config_test.py +++ b/headphones/config_test.py @@ -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} diff --git a/headphones/deluge.py b/headphones/deluge.py index e07cc7c1..6809dd45 100644 --- a/headphones/deluge.py +++ b/headphones/deluge.py @@ -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} diff --git a/headphones/librarysync.py b/headphones/librarysync.py index e4e7a53f..43ba6c97 100644 --- a/headphones/librarysync.py +++ b/headphones/librarysync.py @@ -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')) diff --git a/headphones/request.py b/headphones/request.py index e29ce794..a4a9b128 100644 --- a/headphones/request.py +++ b/headphones/request.py @@ -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 diff --git a/headphones/softchroot.py b/headphones/softchroot.py index 3716a035..4f689e10 100644 --- a/headphones/softchroot.py +++ b/headphones/softchroot.py @@ -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() diff --git a/headphones/softchroot_test.py b/headphones/softchroot_test.py index 474969d7..b310ce12 100644 --- a/headphones/softchroot_test.py +++ b/headphones/softchroot_test.py @@ -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 diff --git a/headphones/webserve.py b/headphones/webserve.py index af78aff7..6a43a28b 100644 --- a/headphones/webserve.py +++ b/headphones/webserve.py @@ -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: