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
# 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.
#
pass
-class InvalidRequest (ValueError):
+class InvalidRequest(ValueError):
"An invalid JSON request"
pass
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):
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]
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
"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"
#
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:
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'
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.