diff --git a/.pep8 b/.pep8 index 2abaf2ca..cb6b368a 100644 --- a/.pep8 +++ b/.pep8 @@ -1,11 +1,9 @@ [pep8] # E121 continuation line under-indented for hanging indent # E122 continuation line missing indentation or outdented -# E124 closing bracket does not match visual indentation -# E125 continuation line with same indent as next logical line # E126 continuation line over-indented for hanging indent # E127 continuation line over-indented for visual indent # E128 continuation line under-indented for visual indent # E501 line too long (312 > 160 characters) -ignore = E121,E122,E123,E124,E125,E126,E127,E128,E501 +ignore = E121,E122,E123,E126,E127,E128,E501 max-line-length = 160 diff --git a/headphones/albumswitcher.py b/headphones/albumswitcher.py index d4d05aa1..74f1077f 100644 --- a/headphones/albumswitcher.py +++ b/headphones/albumswitcher.py @@ -79,7 +79,7 @@ def switch(AlbumID, ReleaseID): 'SELECT * from tracks WHERE AlbumID=? AND Location IS NOT NULL', [AlbumID])) if oldalbumdata['Status'] == 'Skipped' and ((have_track_count / float(total_track_count)) >= ( - headphones.CONFIG.ALBUM_COMPLETION_PCT / 100.0)): + headphones.CONFIG.ALBUM_COMPLETION_PCT / 100.0)): myDB.action( 'UPDATE albums SET Status=? WHERE AlbumID=?', ['Downloaded', AlbumID]) diff --git a/headphones/cache.py b/headphones/cache.py index 219be7fb..202b7802 100644 --- a/headphones/cache.py +++ b/headphones/cache.py @@ -421,7 +421,7 @@ class Cache(object): # Grab the thumbnail as well if we're getting the full artwork (as long # as it's missing/outdated. if thumb_url and self.query_type in ['thumb', 'artwork'] and not ( - self.thumb_files and self._is_current(self.thumb_files[0])): + self.thumb_files and self._is_current(self.thumb_files[0])): artwork = request.request_content(thumb_url, timeout=20) if artwork: diff --git a/headphones/importer.py b/headphones/importer.py index 9a02ce49..efe07fcb 100644 --- a/headphones/importer.py +++ b/headphones/importer.py @@ -314,8 +314,8 @@ def addArtisttoDB(artistid, extrasonly=False, forcefull=False, type="artist"): # Build the dictionary for the fullreleaselist for items in find_hybrid_releases: - if items['ReleaseID'] != rg[ - 'id']: # don't include hybrid information, since that's what we're replacing + # don't include hybrid information, since that's what we're replacing + if items['ReleaseID'] != rg['id']: hybrid_release_id = items['ReleaseID'] newValueDict = {"ArtistID": items['ArtistID'], "ArtistName": items['ArtistName'], @@ -503,14 +503,14 @@ def addArtisttoDB(artistid, extrasonly=False, forcefull=False, type="artist"): if rg_exists: if rg_exists['Status'] == 'Skipped' and ( - (have_track_count / float(total_track_count)) >= ( - headphones.CONFIG.ALBUM_COMPLETION_PCT / 100.0)): + (have_track_count / float(total_track_count)) >= ( + headphones.CONFIG.ALBUM_COMPLETION_PCT / 100.0)): myDB.action('UPDATE albums SET Status=? WHERE AlbumID=?', ['Downloaded', rg['id']]) marked_as_downloaded = True else: if (have_track_count / float(total_track_count)) >= ( - headphones.CONFIG.ALBUM_COMPLETION_PCT / 100.0): + headphones.CONFIG.ALBUM_COMPLETION_PCT / 100.0): myDB.action('UPDATE albums SET Status=? WHERE AlbumID=?', ['Downloaded', rg['id']]) marked_as_downloaded = True diff --git a/headphones/librarysync.py b/headphones/librarysync.py index 43ba6c97..2c3d6061 100644 --- a/headphones/librarysync.py +++ b/headphones/librarysync.py @@ -170,7 +170,7 @@ def libraryScan(dir=None, append=False, ArtistID=None, ArtistName=None, new_song_count += 1 else: if check_exist_song['ArtistName'] != f_artist or check_exist_song[ - 'AlbumTitle'] != f.album or check_exist_song['TrackTitle'] != f.title: + 'AlbumTitle'] != f.album or check_exist_song['TrackTitle'] != f.title: # Important track metadata has been modified, need to run matcher again if f_artist and f_artist != check_exist_song['ArtistName']: new_artists.append(f_artist) diff --git a/headphones/mb.py b/headphones/mb.py index 619908ba..7e7936e3 100644 --- a/headphones/mb.py +++ b/headphones/mb.py @@ -482,7 +482,7 @@ def getRelease(releaseid, include_artist_info=True): release['rg_type'] = unicode(results['release-group']['type']) if release['rg_type'] == 'Album' and 'secondary-type-list' in results[ - 'release-group']: + 'release-group']: secondary_type = unicode(results['release-group']['secondary-type-list'][0]) if secondary_type != release['rg_type']: release['rg_type'] = secondary_type diff --git a/headphones/music_encoder.py b/headphones/music_encoder.py index 12a71797..b51001f6 100644 --- a/headphones/music_encoder.py +++ b/headphones/music_encoder.py @@ -129,7 +129,7 @@ def encode(albumPath): os.path.splitext(music)[1], music) else: if music.decode(headphones.SYS_ENCODING, 'replace').lower().endswith('.mp3') and ( - int(infoMusic.bitrate / 1000) <= headphones.CONFIG.BITRATE): + int(infoMusic.bitrate / 1000) <= headphones.CONFIG.BITRATE): logger.info('%s has bitrate <= %skb, will not be re-encoded', music, headphones.CONFIG.BITRATE) else: diff --git a/headphones/nzbget.py b/headphones/nzbget.py index 0a5a27c0..00b2d6e9 100644 --- a/headphones/nzbget.py +++ b/headphones/nzbget.py @@ -49,7 +49,7 @@ def sendNZB(nzb): nzbGetRPC = xmlrpclib.ServerProxy(url) try: if nzbGetRPC.writelog("INFO", "headphones connected to drop of %s any moment now." % ( - nzb.name + ".nzb")): + nzb.name + ".nzb")): logger.debug(u"Successfully connected to NZBget") else: logger.info(u"Successfully connected to NZBget, but unable to send a message" % ( diff --git a/headphones/postprocessor.py b/headphones/postprocessor.py index 17d2e73c..c757dfea 100755 --- a/headphones/postprocessor.py +++ b/headphones/postprocessor.py @@ -1176,7 +1176,7 @@ def forcePostProcess(dir=None, expand_subfolders=True, album_dir=None, keep_orig if snatched: if headphones.CONFIG.KEEP_TORRENT_FILES and snatched['Kind'] == 'torrent' and snatched[ - 'Status'] == 'Processed': + 'Status'] == 'Processed': logger.info( '%s is a torrent folder being preserved for seeding and has already been processed. Skipping.', folder_basename) diff --git a/headphones/searcher.py b/headphones/searcher.py index 5ca6adf0..005a7ddd 100644 --- a/headphones/searcher.py +++ b/headphones/searcher.py @@ -317,7 +317,7 @@ def more_filtering(results, album, albumlength, new): # Lossless - ignore results if target size outside bitrate range if headphones.CONFIG.PREFERRED_QUALITY == 3 and albumlength and ( - headphones.CONFIG.LOSSLESS_BITRATE_FROM or headphones.CONFIG.LOSSLESS_BITRATE_TO): + headphones.CONFIG.LOSSLESS_BITRATE_FROM or headphones.CONFIG.LOSSLESS_BITRATE_TO): if headphones.CONFIG.LOSSLESS_BITRATE_FROM: low_size_limit = albumlength / 1000 * int(headphones.CONFIG.LOSSLESS_BITRATE_FROM) * 128 if headphones.CONFIG.LOSSLESS_BITRATE_TO: @@ -1066,7 +1066,7 @@ def verifyresult(title, artistterm, term, lossless): # Filter out FLAC if we're not specifically looking for it if headphones.CONFIG.PREFERRED_QUALITY == ( - 0 or '0') and 'flac' in title.lower() and not lossless: + 0 or '0') and 'flac' in title.lower() and not lossless: logger.info( "Removed %s from results because it's a lossless album and we're not looking for a lossless album right now.", title) diff --git a/headphones/webserve.py b/headphones/webserve.py index 6a43a28b..b3136b9e 100644 --- a/headphones/webserve.py +++ b/headphones/webserve.py @@ -733,7 +733,7 @@ class WebInterface(object): original_clean = helpers.clean_name( albums['ArtistName'] + " " + albums['AlbumTitle'] + " " + albums['TrackTitle']) if albums['Matched'] == "Ignored" or albums['Matched'] == "Manual" or albums[ - 'CleanName'] != original_clean: + 'CleanName'] != original_clean: if albums['Matched'] == "Ignored": album_status = "Ignored" elif albums['Matched'] == "Manual" or albums['CleanName'] != original_clean: diff --git a/headphones/webstart.py b/headphones/webstart.py index cc639221..61417803 100644 --- a/headphones/webstart.py +++ b/headphones/webstart.py @@ -33,7 +33,7 @@ def initialize(options): # If either the HTTPS certificate or key do not exist, try to make # self-signed ones. if not (https_cert and os.path.exists(https_cert)) or not ( - https_key and os.path.exists(https_key)): + https_key and os.path.exists(https_key)): if not create_https_certificates(https_cert, https_key): logger.warn("Unable to create certificate and key. Disabling " "HTTPS")