From a65f44ba30036a239f2bc3f92eda3eac1cb5f53b Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 31 May 2014 21:54:38 -0400 Subject: [PATCH] Clean up after recent pylint changes. --- Makefile | 6 +++--- irkerd | 10 +++++----- irkerhook.py | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 10ce0e7..fcd0397 100644 --- a/Makefile +++ b/Makefile @@ -58,10 +58,10 @@ endif clean: rm -f irkerd.8 irkerhook.1 irk.1 irker-*.tar.gz *~ *.html -PYLINTOPTS = --rcfile=/dev/null --reports=n --include-ids=y --disable="C0103,C0111,C0301,C0302,R0201,R0902,R0903,R0912,R0913,R0914,R0915,E1101,W0142,W0201,W0212,W0621,W0702,W0703,F0401,E0611" +PYLINTOPTS = --rcfile=/dev/null --reports=n --dummy-variables-rgx='^_' --msg-template='{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}' --disable="C0103,C0111,C0301,C0302,C1001,R0201,R0902,R0903,R0912,R0913,R0914,R0915,E1101,W0142,W0201,W0212,W0621,W0702,W0703,W1201,F0401,E0611" pylint: - @pylint --output-format=parseable $(PYLINTOPTS) irkerd - @pylint --output-format=parseable $(PYLINTOPTS) irkerhook.py + @pylint $(PYLINTOPTS) irkerd + @pylint $(PYLINTOPTS) irkerhook.py loc: @echo "LOC:"; wc -l irkerd irkerhook.py diff --git a/irkerd b/irkerd index 72c01f5..b645830 100755 --- a/irkerd +++ b/irkerd @@ -114,7 +114,7 @@ except NameError: # Python 3 # same problem - there is little point in reliable delivery to a relay # that is down or unreliable. # -# This code uses only NICK, JOIN, PART, MODE, PRIVMSG, USER, and QUIT. +# This code uses only NICK, JOIN, PART, MODE, PRIVMSG, USER, and QUIT. # It is strictly compliant to RFC1459, except for the interpretation and # use of the DEAF and CHANLIMIT and (obsolete) MAXCHANNELS features. # @@ -134,7 +134,7 @@ class IRCError(Exception): pass -class InvalidRequest (ValueError): +class InvalidRequest(ValueError): "An invalid JSON request" pass @@ -456,7 +456,7 @@ class Connection: if n is None: n = self.nick_trial if self.nick_needs_number: - return (self.nick_template % n) + return self.nick_template % n else: return self.nick_template def handle_ping(self): @@ -740,7 +740,7 @@ class Dispatcher: if age < time.time() - CHANNEL_TTL: ancients.append((connection, chan, age)) if ancients: - ancients.sort(key=lambda x: x[2]) + ancients.sort(key=lambda x: x[2]) (found_connection, drop_channel, _drop_age) = ancients[0] found_connection.part(drop_channel, "scavenged by irkerd") del found_connection.channels_joined[drop_channel] @@ -938,7 +938,7 @@ class IrkerUDPHandler(socketserver.BaseRequestHandler): def in_background(): "Is this process running in background?" try: - return os.getpgrp() != os.tcgetpgrp(1) + return os.getpgrp() != os.tcgetpgrp(1) except OSError: return True diff --git a/irkerhook.py b/irkerhook.py index a7b4106..3f04cf1 100755 --- a/irkerhook.py +++ b/irkerhook.py @@ -30,7 +30,7 @@ urlprefixmap = { "cgit": "http://%(host)s/cgi-bin/cgit.cgi/%(repo)s/commit/?id=", } -# By default, ship to the freenode #commits list +# By default, ship to the freenode #commits list default_channels = "irc://chat.freenode.net/#commits" # @@ -68,7 +68,7 @@ class Commit: if self.urlprefix.lower() == "none": self.url = "" else: - urlprefix = urlprefixmap.get(self.urlprefix, self.urlprefix) + urlprefix = urlprefixmap.get(self.urlprefix, self.urlprefix) webview = (urlprefix % self.__dict__) + self.commit try: if urllib.urlopen(webview).getcode() == 404: @@ -137,7 +137,7 @@ class GenericExtractor: self.bold = '\x1b[1m' self.green = '\x1b[1;32m' self.blue = '\x1b[1;34m' - self.red = '\x1b[1;31m' + self.red = '\x1b[1;31m' self.yellow = '\x1b[1;33m' self.brown = '\x1b[33m' self.magenta = '\x1b[35m' @@ -428,7 +428,7 @@ def ship(extractor, commit, debug): metadata.__dict__.update(json.loads(data)) except ValueError: sys.stderr.write("irkerhook.py: could not decode JSON: %s\n" % data) - raise SystemExit, 1 + raise SystemExit(1) # Rewrite the file list if too long. The objective here is only # to be easier on the eyes. -- 2.26.2