3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 09:19:23 +01:00

ServiceBot: migrate to snake case

This commit is contained in:
James Lu 2017-06-29 23:02:34 -07:00
parent 10bca676fc
commit 8e9a99f90c

View File

@ -231,7 +231,7 @@ class ServiceBot():
# which is handled by coreplugin. # which is handled by coreplugin.
if irc is None: if irc is None:
for irc in world.networkobjects.values(): for irc in world.networkobjects.values():
irc.callHooks([None, 'PYLINK_NEW_SERVICE', {'name': self.name}]) irc.call_hooks([None, 'PYLINK_NEW_SERVICE', {'name': self.name}])
else: else:
raise NotImplementedError("Network specific plugins not supported yet.") raise NotImplementedError("Network specific plugins not supported yet.")
@ -282,7 +282,7 @@ class ServiceBot():
else: else:
irc.proto.join(u, chan) irc.proto.join(u, chan)
irc.callHooks([irc.sid, 'PYLINK_SERVICE_JOIN', {'channel': chan, 'users': [u]}]) irc.call_hooks([irc.sid, 'PYLINK_SERVICE_JOIN', {'channel': chan, 'users': [u]}])
else: else:
log.warning('(%s) Ignoring invalid autojoin channel %r.', irc.name, chan) log.warning('(%s) Ignoring invalid autojoin channel %r.', irc.name, chan)
@ -324,10 +324,10 @@ class ServiceBot():
if cmd and show_unknown_cmds and not cmd.startswith('\x01'): if cmd and show_unknown_cmds and not cmd.startswith('\x01'):
# Ignore empty commands and invalid command errors from CTCPs. # Ignore empty commands and invalid command errors from CTCPs.
self.reply(irc, 'Error: Unknown command %r.' % cmd) self.reply(irc, 'Error: Unknown command %r.' % cmd)
log.info('(%s/%s) Received unknown command %r from %s', irc.name, self.name, cmd, irc.getHostmask(source)) log.info('(%s/%s) Received unknown command %r from %s', irc.name, self.name, cmd, irc.get_hostmask(source))
return return
log.info('(%s/%s) Calling command %r for %s', irc.name, self.name, cmd, irc.getHostmask(source)) log.info('(%s/%s) Calling command %r for %s', irc.name, self.name, cmd, irc.get_hostmask(source))
for func in self.commands[cmd]: for func in self.commands[cmd]:
try: try:
func(irc, source, cmd_args) func(irc, source, cmd_args)