Bantracker: add some convenience functions to Ban class
IRCLogin: Make the Launchpad team configurable
This commit is contained in:
parent
55f88b5a60
commit
31c41dac21
|
@ -138,6 +138,12 @@ class Ban(object):
|
|||
def __repr__(self):
|
||||
return '<%s object "%s" at 0x%x>' % (self.__class__.__name__, self, id(self))
|
||||
|
||||
def op(self):
|
||||
return self.mask.split('!')[0]
|
||||
|
||||
def time(self):
|
||||
return datetime.datetime.fromtimestamp(self.when)
|
||||
|
||||
class Bantracker(callbacks.Plugin):
|
||||
"""Plugin to manage bans.
|
||||
See '@list Bantracker' and '@help <command>' for commands"""
|
||||
|
|
|
@ -22,3 +22,5 @@ def configure(advanced):
|
|||
IRCLogin = conf.registerPlugin('IRCLogin')
|
||||
conf.registerGlobalValue(IRCLogin, 'UserList',
|
||||
registry.String('', """Filename of file with list of users""",private=True))
|
||||
conf.registerGloblalValue(IRCLogin, "teamname",
|
||||
registry.String('ubuntu-irc', "Name of the Launchpad team to get users from", private=True))
|
||||
|
|
|
@ -77,7 +77,7 @@ launchpad"""
|
|||
irc.reply('Running...')
|
||||
user2nick = {}
|
||||
nick2user = {}
|
||||
users = lp.getUsers()
|
||||
users = lp.getUsers(self.registryValue("teamname"))
|
||||
for user in users:
|
||||
lpuser = lp.getIRCNick(user, False)
|
||||
if not lpuser:
|
||||
|
|
Loading…
Reference in New Issue