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

rename utils._nicktoUid to utils.nickToUid

Consistency in function capitalization is a good thing!!
This commit is contained in:
James Lu 2015-06-07 19:36:21 -07:00
parent 43a46d3d99
commit 4d763288e5
3 changed files with 9 additions and 9 deletions

View File

@ -38,10 +38,10 @@ def quitclient(irc, source, args):
except IndexError:
utils.msg(irc, source, "Error: not enough arguments. Needs 1: nick.")
return
if irc.pseudoclient.uid == utils._nicktoUid(irc, nick):
if irc.pseudoclient.uid == utils.nickToUid(irc, nick):
utils.msg(irc, source, "Error: cannot quit the main PyLink PseudoClient!")
return
u = utils._nicktoUid(irc, nick)
u = utils.nickToUid(irc, nick)
quitmsg = ' '.join(args[1:]) or 'Client quit'
proto.quitClient(irc, u, quitmsg)
@ -56,7 +56,7 @@ def joinclient(irc, source, args):
except IndexError:
utils.msg(irc, source, "Error: not enough arguments. Needs 2: nick, comma separated list of channels.")
return
u = utils._nicktoUid(irc, nick)
u = utils.nickToUid(irc, nick)
for channel in clist:
if not channel.startswith('#'):
utils.msg(irc, source, "Error: channel names must start with #.")
@ -72,7 +72,7 @@ def nickclient(irc, source, args):
except IndexError:
utils.msg(irc, source, "Error: not enough arguments. Needs 2: nick, newnick.")
return
u = utils._nicktoUid(irc, nick)
u = utils.nickToUid(irc, nick)
proto.nickClient(irc, u, newnick)
@utils.add_cmd
@ -85,7 +85,7 @@ def partclient(irc, source, args):
except IndexError:
utils.msg(irc, source, "Error: not enough arguments. Needs 2: nick, comma separated list of channels.")
return
u = utils._nicktoUid(irc, nick)
u = utils.nickToUid(irc, nick)
for channel in clist:
if not channel.startswith('#'):
utils.msg(irc, source, "Error: channel names must start with #.")
@ -103,8 +103,8 @@ def kickclient(irc, source, args):
except IndexError:
utils.msg(irc, source, "Error: not enough arguments. Needs 3-4: nick, channel, target, reason (optional).")
return
u = utils._nicktoUid(irc, nick)
targetu = utils._nicktoUid(irc, target)
u = utils.nickToUid(irc, nick)
targetu = utils.nickToUid(irc, target)
if not channel.startswith('#'):
utils.msg(irc, source, "Error: channel names must start with #.")
return

View File

@ -12,7 +12,7 @@ def tell(irc, source, args):
except IndexError:
utils.msg(irc, source, 'Error: not enough arguments.')
return
targetuid = proto._nicktoUid(irc, target)
targetuid = utils.nickToUid(irc, target)
if targetuid is None:
utils.msg(irc, source, 'Error: unknown user %r' % target)
return

View File

@ -27,7 +27,7 @@ def add_cmd(func, name=None):
name = name.lower()
bot_commands[name] = func
def _nicktoUid(irc, nick):
def nickToUid(irc, nick):
for k, v in irc.users.items():
if v.nick == nick:
return k