# 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