Ori.livneh has submitted this change and it was merged.
Change subject: tcpircbot: avoid shadowing parent class's 'channels' attribute
......................................................................
tcpircbot: avoid shadowing parent class's 'channels' attribute
Store channels to join in 'target_channels' attribute instead, to avoid
clobbering the parent class's IRCDict object.
Change-Id: I167c2b76947fd781ba085e183ac55be06669aeb4
---
M modules/tcpircbot/files/tcpircbot.py
1 file changed, 3 insertions(+), 3 deletions(-)
Approvals:
Ori.livneh: Verified; Looks good to me, approved
diff --git a/modules/tcpircbot/files/tcpircbot.py
b/modules/tcpircbot/files/tcpircbot.py
index 696b485..408b026 100755
--- a/modules/tcpircbot/files/tcpircbot.py
+++ b/modules/tcpircbot/files/tcpircbot.py
@@ -65,7 +65,7 @@
def __init__(self, network, nickname, channels, **options):
ircbot.SingleServerIRCBot.__init__(self, [network], nickname, nickname)
- self.channels = channels
+ self.target_channels = channels
self.options = options
for event in ['disconnect', 'join', 'part', 'welcome']:
self.connection.add_global_handler(event, self.log_event)
@@ -85,7 +85,7 @@
% vars(event))
def on_welcome(self, connection, event):
- for channel in self.channels:
+ for channel in self.target_channels:
connection.join(channel)
@@ -152,7 +152,7 @@
data = codecs.decode(data, 'utf8', 'replace').strip()
if data:
logging.info('TCP %s: "%s"', sock.getpeername(), data)
- for channel in bot.channels:
+ for channel in bot.target_channels:
bot.connection.privmsg(channel, data)
else:
sock.close()
--
To view, visit https://gerrit.wikimedia.org/r/107811
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I167c2b76947fd781ba085e183ac55be06669aeb4
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits