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

pr/insp: Add missing killServer/killClient functions

This commit is contained in:
James Lu 2015-07-09 19:05:37 -07:00
parent ffec80ee45
commit eae0aa5aa8

View File

@ -150,9 +150,31 @@ def modeServer(irc, numeric, target, modes):
a list of (mode, arg) tuples, in the format of utils.parseModes() output.
"""
if not utils.isInternalServer(irc, numeric):
raise LookupError('No such PyLink PseudoClient exists.')
raise LookupError('No such PyLink PseudoServer exists.')
_sendModes(irc, numeric, target, modes)
def killServer(irc, numeric, target, reason):
"""<irc object> <server SID> <target> <reason>
Sends a kill to <target> from a PyLink PseudoServer.
"""
if not utils.isInternalServer(irc, numeric):
raise LookupError('No such PyLink PseudoServer exists.')
_sendFromServer(irc, numeric, 'KILL %s :%s' % (target, reason))
# We don't need to call removeClient here, since the remote server
# will send a QUIT from the target if the command succeeds.
def killClient(irc, numeric, target, reason):
"""<irc object> <client numeric> <target> <reason>
Sends a kill to <target> from a PyLink PseudoClient.
"""
if not utils.isInternalClient(irc, numeric):
raise LookupError('No such PyLink PseudoClient exists.')
_sendFromServer(irc, numeric, 'KILL %s :%s' % (target, reason))
# We don't need to call removeClient here, since the remote server
# will send a QUIT from the target if the command succeeds.
def messageClient(irc, numeric, target, text):
"""<irc object> <client numeric> <text>