From 61ed209abbccc293983720d5d40f9b8d7a6684c7 Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 30 Jun 2017 21:30:20 -0700 Subject: [PATCH] coremods, plugins: migrate to snake case for protocol communication --- coremods/service_support.py | 2 +- plugins/bots.py | 2 +- plugins/changehost.py | 2 +- plugins/opercmds.py | 2 +- plugins/relay.py | 12 ++++++------ 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/coremods/service_support.py b/coremods/service_support.py index 2a36b49..30516bc 100644 --- a/coremods/service_support.py +++ b/coremods/service_support.py @@ -55,7 +55,7 @@ def spawn_service(irc, source, command, args): userobj = irc.users[u] else: log.debug('(%s) spawn_service: Spawning new client %s', irc.name, nick) - userobj = irc.spawnClient(nick, ident, host, modes=modes, opertype="PyLink Service", + userobj = irc.spawn_client(nick, ident, host, modes=modes, opertype="PyLink Service", manipulatable=sbot.manipulatable) # Store the service name in the IrcUser object for easier access. diff --git a/plugins/bots.py b/plugins/bots.py index 252d9f1..cf2af36 100644 --- a/plugins/bots.py +++ b/plugins/bots.py @@ -18,7 +18,7 @@ def spawnclient(irc, source, args): except ValueError: irc.error("Not enough arguments. Needs 3: nick, user, host.") return - irc.spawnClient(nick, ident, host, manipulatable=True) + irc.spawn_client(nick, ident, host, manipulatable=True) irc.reply("Done.") @utils.add_cmd diff --git a/plugins/changehost.py b/plugins/changehost.py index a724dde..40e82c1 100644 --- a/plugins/changehost.py +++ b/plugins/changehost.py @@ -78,7 +78,7 @@ def _changehost(irc, target, args): if char not in allowed_chars: new_host = new_host.replace(char, '-') - irc.updateClient(target, 'HOST', new_host) + irc.update_client(target, 'HOST', new_host) # Only operate on the first match. break diff --git a/plugins/opercmds.py b/plugins/opercmds.py index 026aaa8..3ec3cf8 100644 --- a/plugins/opercmds.py +++ b/plugins/opercmds.py @@ -70,7 +70,7 @@ def jupe(irc, source, args): irc.error("Invalid server name '%s'." % servername) return - sid = irc.spawnServer(servername, desc=desc) + sid = irc.spawn_server(servername, desc=desc) irc.call_hooks([irc.pseudoclient.uid, 'OPERCMDS_SPAWNSERVER', {'name': servername, 'sid': sid, 'text': desc}]) diff --git a/plugins/relay.py b/plugins/relay.py index a998fca..a1ffcf0 100644 --- a/plugins/relay.py +++ b/plugins/relay.py @@ -219,7 +219,7 @@ def spawn_relay_server(irc, remoteirc): suffix = conf.conf.get('relay', {}).get('server_suffix', 'relay') # Strip any leading or trailing .'s suffix = suffix.strip('.') - sid = irc.spawnServer('%s.%s' % (remoteirc.name, suffix), + sid = irc.spawn_server('%s.%s' % (remoteirc.name, suffix), desc="PyLink Relay network - %s" % (remoteirc.get_full_network_name()), endburst_delay=3) except (RuntimeError, ValueError): # Network not initialized yet, or a server name conflict. @@ -326,7 +326,7 @@ def spawn_relay_user(irc, remoteirc, user, times_tagged=0): realhost = None ip = '0.0.0.0' - u = remoteirc.spawnClient(nick, ident=ident, host=host, realname=realname, modes=modes, + u = remoteirc.spawn_client(nick, ident=ident, host=host, realname=realname, modes=modes, opertype=opertype, server=rsid, ip=ip, realhost=realhost).uid try: remoteirc.users[u].remote = (irc.name, user) @@ -477,7 +477,7 @@ def initialize_channel(irc, channel): # Only update the topic if it's different from what we already have, # and topic bursting is complete. if remoteirc.channels[remotechan].topicset and topic != irc.channels[channel].topic: - irc.topicBurst(irc.sid, channel, topic) + irc.topic_burst(irc.sid, channel, topic) # Send our users and channel modes to the other nets relay_joins(irc, channel, irc.channels[channel].users, irc.channels[channel].ts) @@ -1291,7 +1291,7 @@ def handle_chgclient(irc, source, command, args): newtext = normalize_host(remoteirc, text) else: # Don't overwrite the original text variable on every iteration. newtext = text - remoteirc.updateClient(user, field, newtext) + remoteirc.update_client(user, field, newtext) except NotImplementedError: # IRCd doesn't support changing the field we want log.debug('(%s) relay.handle_chgclient: Ignoring changing field %r of %s on %s (for %s/%s);' ' remote IRCd doesn\'t support it', irc.name, field, @@ -1372,9 +1372,9 @@ def handle_topic(irc, numeric, command, args): remoteirc.topic(remoteuser, remotechan, topic) else: rsid = get_remote_sid(remoteirc, irc) - remoteirc.topicBurst(rsid, remotechan, topic) + remoteirc.topic_burst(rsid, remotechan, topic) elif oldtopic: # Topic change blocked by claim. - irc.topicBurst(irc.sid, channel, oldtopic) + irc.topic_burst(irc.sid, channel, oldtopic) utils.add_hook(handle_topic, 'TOPIC')