From 29622ba22172bc49ba468d8f26f9880003cfa341 Mon Sep 17 00:00:00 2001 From: Jesse Mullan Date: Sat, 1 Nov 2014 18:25:00 -0700 Subject: [PATCH] Fix or suppress upgraded pylint errors --- headphones/getXldProfile.py | 6 +++--- headphones/searcher.py | 2 +- headphones/versioncheck.py | 6 ++++-- pylintrc | 6 +++++- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/headphones/getXldProfile.py b/headphones/getXldProfile.py index 3e389914..b143cfa1 100755 --- a/headphones/getXldProfile.py +++ b/headphones/getXldProfile.py @@ -16,12 +16,12 @@ def getXldProfile(xldProfile): preferences = plistlib.Plist.fromFile(expandedPath) except (ImportError): os.system("/usr/bin/plutil -convert binary1 %s" % expandedPath) - logger.info('The plist at "%s" has a date in it, and therefore is not useable.' % expandedPath) + logger.info('The plist at "%s" has a date in it, and therefore is not useable.', expandedPath) return(xldProfileNotFound, None, None) except (ImportError): - logger.info('The plist at "%s" has a date in it, and therefore is not useable.' % expandedPath) + logger.info('The plist at "%s" has a date in it, and therefore is not useable.', expandedPath) except: - logger.info('Unexpected error:', sys.exc_info()[0]) + logger.info('Unexpected error: %s', sys.exc_info()[0]) return(xldProfileNotFound, None, None) xldProfile = xldProfile.lower() diff --git a/headphones/searcher.py b/headphones/searcher.py index 35ccd5a7..d874508c 100644 --- a/headphones/searcher.py +++ b/headphones/searcher.py @@ -395,7 +395,7 @@ def sort_search_results(resultlist, album, new, albumlength): finallist = sorted(flac_list, key=lambda title: (title[5], int(title[1])), reverse=True) except Exception: logger.exception('Unhandled exception') - logger.info('No track information for %s - %s. Defaulting to highest quality', (album['ArtistName'], album['AlbumTitle'])) + logger.info('No track information for %s - %s. Defaulting to highest quality', album['ArtistName'], album['AlbumTitle']) finallist = sorted(resultlist, key=lambda title: (title[5], int(title[1])), reverse=True) diff --git a/headphones/versioncheck.py b/headphones/versioncheck.py index 29604914..ea2a8e3f 100644 --- a/headphones/versioncheck.py +++ b/headphones/versioncheck.py @@ -236,6 +236,8 @@ def update(): with open(version_path, 'w') as f: f.write(str(headphones.LATEST_VERSION)) except IOError as e: - logger.error("Unable to write current version to version.txt, " \ - "update not complete: ", e) + logger.error( + "Unable to write current version to version.txt, update not complete: %s", + e + ) return diff --git a/pylintrc b/pylintrc index 0f164f94..3137b71b 100644 --- a/pylintrc +++ b/pylintrc @@ -45,7 +45,11 @@ load-plugins= #R0801 a set of similar lines has been detected among multiple file #W0142 a function or method is called using *args or **kwargs to dispatch argument -disable=C0303,C0325,C0326,I0011,R0801,W0142,C0103,C0111,C0301,C0302,C0304,C0321,C1001,E0101,E0203,E0602,E1101,E1123,R0201,R0401,R0911,R0912,R0914,R0915,R0923,W0102,W0109,W0120,W0141,W0201,W0212,W0231,W0232,W0233,W0301,W0311,W0401,W0403,W0404,W0511,W0601,W0602,W0603,W0611,W0612,W0613,W0621,W0622,W0633,W0702,W0703,W1401 +# W1201(logging-not-lazy) +# C0330(bad-continuation) +# E1205(logging-too-many-args) + +disable=C0303,C0325,C0326,I0011,R0801,W0142,C0103,C0111,C0301,C0302,C0304,C0321,C1001,E0101,E0203,E0602,E1101,E1123,R0201,R0401,R0911,R0912,R0914,R0915,R0923,W0102,W0109,W0120,W0141,W0201,W0212,W0231,W0232,W0233,W0301,W0311,W0401,W0403,W0404,W0511,W0601,W0602,W0603,W0611,W0612,W0613,W0621,W0622,W0633,W0702,W0703,W1401,W1201,C0330 [REPORTS]