mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-24 03:29:28 +01:00
Let's use a from import since it makes things simpler.
This commit is contained in:
parent
3d81d6627b
commit
4ad7fd2504
16
src/Admin.py
16
src/Admin.py
@ -49,8 +49,8 @@ import supybot.conf as conf
|
|||||||
import supybot.ircdb as ircdb
|
import supybot.ircdb as ircdb
|
||||||
import supybot.utils as utils
|
import supybot.utils as utils
|
||||||
import supybot.ircmsgs as ircmsgs
|
import supybot.ircmsgs as ircmsgs
|
||||||
|
from supybot.commands import wrap
|
||||||
import supybot.ircutils as ircutils
|
import supybot.ircutils as ircutils
|
||||||
import supybot.commands as commands
|
|
||||||
import supybot.privmsgs as privmsgs
|
import supybot.privmsgs as privmsgs
|
||||||
import supybot.schedule as schedule
|
import supybot.schedule as schedule
|
||||||
import supybot.callbacks as callbacks
|
import supybot.callbacks as callbacks
|
||||||
@ -181,7 +181,7 @@ class Admin(privmsgs.CapabilityCheckingPrivmsg):
|
|||||||
irc.reply(utils.commaAndify(L))
|
irc.reply(utils.commaAndify(L))
|
||||||
else:
|
else:
|
||||||
irc.reply('I\'m not currently in any channels.')
|
irc.reply('I\'m not currently in any channels.')
|
||||||
channels = commands.wrap(channels, ['private'], noExtra=True)
|
channels = wrap(channels, ['private'], noExtra=True)
|
||||||
|
|
||||||
def do484(self, irc, msg):
|
def do484(self, irc, msg):
|
||||||
irc = self.pendingNickChanges.get(irc, None)
|
irc = self.pendingNickChanges.get(irc, None)
|
||||||
@ -231,7 +231,7 @@ class Admin(privmsgs.CapabilityCheckingPrivmsg):
|
|||||||
self.pendingNickChanges[irc.getRealIrc()] = irc
|
self.pendingNickChanges[irc.getRealIrc()] = irc
|
||||||
else:
|
else:
|
||||||
irc.reply(irc.nick)
|
irc.reply(irc.nick)
|
||||||
nick = commands.wrap(nick, ['?nick'])
|
nick = wrap(nick, ['?nick'])
|
||||||
|
|
||||||
def part(self, irc, msg, args):
|
def part(self, irc, msg, args):
|
||||||
"""<channel> [<channel> ...] [<reason>]
|
"""<channel> [<channel> ...] [<reason>]
|
||||||
@ -307,7 +307,7 @@ class Admin(privmsgs.CapabilityCheckingPrivmsg):
|
|||||||
irc.replySuccess()
|
irc.replySuccess()
|
||||||
else:
|
else:
|
||||||
irc.error('You can\'t add capabilities you don\'t have.')
|
irc.error('You can\'t add capabilities you don\'t have.')
|
||||||
addcapability = commands.wrap(addcapability, ['otherUser', 'lowered'])
|
addcapability = wrap(addcapability, ['otherUser', 'lowered'])
|
||||||
|
|
||||||
def removecapability(self, irc, msg, args, user, capability):
|
def removecapability(self, irc, msg, args, user, capability):
|
||||||
"""<name|hostmask> <capability>
|
"""<name|hostmask> <capability>
|
||||||
@ -326,7 +326,7 @@ class Admin(privmsgs.CapabilityCheckingPrivmsg):
|
|||||||
else:
|
else:
|
||||||
s = 'You can\'t remove capabilities you don\'t have.'
|
s = 'You can\'t remove capabilities you don\'t have.'
|
||||||
irc.error(s)
|
irc.error(s)
|
||||||
removecapability = commands.wrap(removecapability, ['otherUser','lowered'])
|
removecapability = wrap(removecapability, ['otherUser','lowered'])
|
||||||
|
|
||||||
def ignore(self, irc, msg, args, hostmask, expires):
|
def ignore(self, irc, msg, args, hostmask, expires):
|
||||||
"""<hostmask|nick> [<expires>]
|
"""<hostmask|nick> [<expires>]
|
||||||
@ -342,7 +342,7 @@ class Admin(privmsgs.CapabilityCheckingPrivmsg):
|
|||||||
expires += time.time()
|
expires += time.time()
|
||||||
ircdb.ignores.add(hostmask, expires)
|
ircdb.ignores.add(hostmask, expires)
|
||||||
irc.replySuccess()
|
irc.replySuccess()
|
||||||
ignore = commands.wrap(ignore, ['hostmask', ('?int', 0)])
|
ignore = wrap(ignore, ['hostmask', ('?int', 0)])
|
||||||
|
|
||||||
def unignore(self, irc, msg, args, hostmask):
|
def unignore(self, irc, msg, args, hostmask):
|
||||||
"""<hostmask|nick>
|
"""<hostmask|nick>
|
||||||
@ -355,7 +355,7 @@ class Admin(privmsgs.CapabilityCheckingPrivmsg):
|
|||||||
irc.replySuccess()
|
irc.replySuccess()
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.error('%s wasn\'t in the ignores database.' % hostmask)
|
irc.error('%s wasn\'t in the ignores database.' % hostmask)
|
||||||
unignore = commands.wrap(unignore, ['hostmask'])
|
unignore = wrap(unignore, ['hostmask'])
|
||||||
|
|
||||||
def ignores(self, irc, msg, args):
|
def ignores(self, irc, msg, args):
|
||||||
"""takes no arguments
|
"""takes no arguments
|
||||||
@ -367,7 +367,7 @@ class Admin(privmsgs.CapabilityCheckingPrivmsg):
|
|||||||
irc.reply(utils.commaAndify(imap(repr, ircdb.ignores.hostmasks)))
|
irc.reply(utils.commaAndify(imap(repr, ircdb.ignores.hostmasks)))
|
||||||
else:
|
else:
|
||||||
irc.reply('I\'m not currently globally ignoring anyone.')
|
irc.reply('I\'m not currently globally ignoring anyone.')
|
||||||
ignores = commands.wrap(ignores, noExtra=True)
|
ignores = wrap(ignores, noExtra=True)
|
||||||
|
|
||||||
|
|
||||||
Class = Admin
|
Class = Admin
|
||||||
|
Loading…
Reference in New Issue
Block a user