From 9e212fc0a469ed2e67cc0f097b0f1e204b5ba1d9 Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 2 Mar 2018 20:06:23 -0800 Subject: [PATCH] protocols: migrate utils.wrapArguments, splitHostmask use to camel case (#523) --- protocols/clientbot.py | 4 ++-- protocols/ngircd.py | 2 +- protocols/p10.py | 6 +++--- protocols/ts6.py | 2 +- protocols/unreal.py | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/protocols/clientbot.py b/protocols/clientbot.py index edd06b8..9edc4bc 100644 --- a/protocols/clientbot.py +++ b/protocols/clientbot.py @@ -446,7 +446,7 @@ class ClientbotWrapperProtocol(IRCCommonProtocol): else: # Sender is a either a nick or a nick!user@host prefix. Split it into its relevant parts. try: - nick, ident, host = utils.splitHostmask(sender) + nick, ident, host = utils.split_hostmask(sender) except ValueError: ident = host = None # Set ident and host as null for now. nick = sender # Treat the sender prefix we received as a nick. @@ -674,7 +674,7 @@ class ClientbotWrapperProtocol(IRCCommonProtocol): # Handle userhost-in-names where available. if 'userhost-in-names' in self.ircv3_caps: - nick, ident, host = utils.splitHostmask(nick) + nick, ident, host = utils.split_hostmask(nick) else: ident = host = None diff --git a/protocols/ngircd.py b/protocols/ngircd.py index db2d871..a93b03a 100644 --- a/protocols/ngircd.py +++ b/protocols/ngircd.py @@ -252,7 +252,7 @@ class NgIRCdProtocol(IRCS2SProtocol): if nicks_to_send: # Use 13 args max per line: this is equal to the max of 15 minus the command name and target channel. - for message in utils.wrapArguments(njoin_prefix, nicks_to_send, self.S2S_BUFSIZE, separator=',', max_args_per_line=13): + for message in utils.wrap_arguments(njoin_prefix, nicks_to_send, self.S2S_BUFSIZE, separator=',', max_args_per_line=13): self.send(message) if modes: diff --git a/protocols/p10.py b/protocols/p10.py index a1080d4..16bc5b5 100644 --- a/protocols/p10.py +++ b/protocols/p10.py @@ -654,7 +654,7 @@ class P10Protocol(IRCS2SProtocol): # Wrap all users and send them to prevent cutoff. Subtract 4 off the maximum # buf size to account for user prefix data that may be re-added (e.g. ":ohv") for linenum, wrapped_msg in \ - enumerate(utils.wrapArguments(msgprefix, namelist, self.S2S_BUFSIZE-1-len(self.prefixmodes), + enumerate(utils.wrap_arguments(msgprefix, namelist, self.S2S_BUFSIZE-1-len(self.prefixmodes), separator=',')): if linenum: # Implies "if linenum > 0" # XXX: Ugh, this postprocessing sucks, but we have to make sure that mode prefixes are accounted @@ -688,12 +688,12 @@ class P10Protocol(IRCS2SProtocol): if bans or exempts: msgprefix += ':%' # Ban string starts with a % if there is anything if bans: - for wrapped_msg in utils.wrapArguments(msgprefix, bans, self.S2S_BUFSIZE): + for wrapped_msg in utils.wrap_arguments(msgprefix, bans, self.S2S_BUFSIZE): self.send(wrapped_msg) if exempts: # Now add exempts, which are separated from the ban list by a single argument "~". msgprefix += ' ~ ' - for wrapped_msg in utils.wrapArguments(msgprefix, exempts, self.S2S_BUFSIZE): + for wrapped_msg in utils.wrap_arguments(msgprefix, exempts, self.S2S_BUFSIZE): self.send(wrapped_msg) self.updateTS(server, channel, ts, changedmodes) diff --git a/protocols/ts6.py b/protocols/ts6.py index 2404e1f..48d63dc 100644 --- a/protocols/ts6.py +++ b/protocols/ts6.py @@ -186,7 +186,7 @@ class TS6Protocol(TS6BaseProtocol): msgprefix = ':{sid} BMASK {ts} {channel} {bmode} :'.format(sid=server, ts=ts, channel=channel, bmode=bmode) # Actually, we cut off at 17 arguments/line, since the prefix and command name don't count. - for msg in utils.wrapArguments(msgprefix, bans, self.S2S_BUFSIZE, max_args_per_line=17): + for msg in utils.wrap_arguments(msgprefix, bans, self.S2S_BUFSIZE, max_args_per_line=17): self.send(msg) self.updateTS(server, channel, ts, changedmodes) diff --git a/protocols/unreal.py b/protocols/unreal.py index e0c54d0..83396fa 100644 --- a/protocols/unreal.py +++ b/protocols/unreal.py @@ -180,7 +180,7 @@ class UnrealProtocol(TS6BaseProtocol): sjoin_prefix += " :" # Wrap arguments to the max supported S2S line length to prevent cutoff # (https://github.com/GLolol/PyLink/issues/378) - for line in utils.wrapArguments(sjoin_prefix, itemlist, self.S2S_BUFSIZE): + for line in utils.wrap_arguments(sjoin_prefix, itemlist, self.S2S_BUFSIZE): self.send(line) self._channels[channel].users.update(uids)