mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-13 04:01:05 +01:00
Removed some XXXes.
This commit is contained in:
parent
b9067089b1
commit
e91a897f53
@ -67,7 +67,6 @@ class Cycler(callbacks.Privmsg):
|
|||||||
len(irc.state.channels[channel].users) == 1:
|
len(irc.state.channels[channel].users) == 1:
|
||||||
if 'i' not in irc.state.channels[channel].modes and \
|
if 'i' not in irc.state.channels[channel].modes and \
|
||||||
'k' not in irc.state.channels[channel].modes:
|
'k' not in irc.state.channels[channel].modes:
|
||||||
# XXX We should pull these keywords from the registry.
|
|
||||||
self.log.info('Cycling %s: I\'m the only one left.', channel)
|
self.log.info('Cycling %s: I\'m the only one left.', channel)
|
||||||
irc.queueMsg(ircmsgs.part(channel))
|
irc.queueMsg(ircmsgs.part(channel))
|
||||||
networkGroup = conf.supybot.networks.get(irc.network)
|
networkGroup = conf.supybot.networks.get(irc.network)
|
||||||
|
@ -325,12 +325,11 @@ class Http(callbacks.Privmsg):
|
|||||||
Returns the results of querying filext.com for file extensions that
|
Returns the results of querying filext.com for file extensions that
|
||||||
match <ext>.
|
match <ext>.
|
||||||
"""
|
"""
|
||||||
# XXX This probably ought to be handled in a converter from commands.py
|
|
||||||
invalid = '|<>\^=?/[]";,*'
|
invalid = '|<>\^=?/[]";,*'
|
||||||
for c in invalid:
|
for c in invalid:
|
||||||
if c in ext:
|
if c in ext:
|
||||||
irc.error('\'%s\' is an invalid extension character' % c)
|
irc.error('%s is an invalid extension character' %
|
||||||
return
|
utils.quoted(c), Raise=True)
|
||||||
s = 'http://www.filext.com/detaillist.php?extdetail=%s&goButton=Go'
|
s = 'http://www.filext.com/detaillist.php?extdetail=%s&goButton=Go'
|
||||||
text = webutils.getUrl(s % ext)
|
text = webutils.getUrl(s % ext)
|
||||||
matches = self._filextre.findall(text)
|
matches = self._filextre.findall(text)
|
||||||
|
@ -61,7 +61,6 @@ class ActiveObservers(registry.SpaceSeparatedListOfStrings):
|
|||||||
String = callbacks.canonicalName
|
String = callbacks.canonicalName
|
||||||
|
|
||||||
conf.registerPlugin('Observer')
|
conf.registerPlugin('Observer')
|
||||||
# XXX These both need to be CanonicalStrings.
|
|
||||||
conf.registerGlobalValue(conf.supybot.plugins.Observer, 'observers',
|
conf.registerGlobalValue(conf.supybot.plugins.Observer, 'observers',
|
||||||
Observers([], """Determines what observers are available.""",
|
Observers([], """Determines what observers are available.""",
|
||||||
orderAlphabetically=True))
|
orderAlphabetically=True))
|
||||||
|
@ -128,10 +128,10 @@ class Protector(callbacks.Privmsg):
|
|||||||
chanOp = ircdb.makeChannelCapability(channel, 'op')
|
chanOp = ircdb.makeChannelCapability(channel, 'op')
|
||||||
chanVoice = ircdb.makeChannelCapability(channel, 'voice')
|
chanVoice = ircdb.makeChannelCapability(channel, 'voice')
|
||||||
chanhalfop = ircdb.makeChannelCapability(channel, 'halfop')
|
chanhalfop = ircdb.makeChannelCapability(channel, 'halfop')
|
||||||
|
if not ircdb.checkCapability(msg.prefix, chanop):
|
||||||
|
irc.sendMsg(ircmsgs.deop(channel, msg.nick))
|
||||||
for (mode, value) in ircutils.separateModes(msg.args[1:]):
|
for (mode, value) in ircutils.separateModes(msg.args[1:]):
|
||||||
if not value:
|
if not value:
|
||||||
# XXX We should check whether this person has the right to do
|
|
||||||
# a mode change like this.
|
|
||||||
continue
|
continue
|
||||||
if ircutils.strEqual(value, msg.nick):
|
if ircutils.strEqual(value, msg.nick):
|
||||||
# We allow someone to mode themselves to oblivion.
|
# We allow someone to mode themselves to oblivion.
|
||||||
|
@ -108,7 +108,7 @@ class Scheduler(callbacks.Privmsg):
|
|||||||
thereafter). <name> is a name by which the command can be
|
thereafter). <name> is a name by which the command can be
|
||||||
unscheduled.
|
unscheduled.
|
||||||
"""
|
"""
|
||||||
name = name.lower() # XXX We should have a "compose" context for this.
|
name = name.lower()
|
||||||
self.events[name] = command
|
self.events[name] = command
|
||||||
f = self._makeCommandFunction(irc, msg, command, remove=False)
|
f = self._makeCommandFunction(irc, msg, command, remove=False)
|
||||||
id = schedule.addPeriodicEvent(f, seconds, name)
|
id = schedule.addPeriodicEvent(f, seconds, name)
|
||||||
|
@ -126,6 +126,9 @@ class Seen(callbacks.Privmsg):
|
|||||||
if irc.isChannel(msg.args[0]):
|
if irc.isChannel(msg.args[0]):
|
||||||
said = ircmsgs.prettyPrint(msg)
|
said = ircmsgs.prettyPrint(msg)
|
||||||
channel = msg.args[0]
|
channel = msg.args[0]
|
||||||
|
channelSpecific = conf.supybot.databases.plugins.channelSpecific
|
||||||
|
if not conf.get(channelSpecific, channel):
|
||||||
|
channel = conf.get(channelSpecific.channel, channel)
|
||||||
self.db.update(channel, msg.nick, said)
|
self.db.update(channel, msg.nick, said)
|
||||||
try:
|
try:
|
||||||
id = ircdb.users.getUserId(msg.prefix)
|
id = ircdb.users.getUserId(msg.prefix)
|
||||||
@ -164,8 +167,7 @@ class Seen(callbacks.Privmsg):
|
|||||||
irc.reply('I haven\'t seen anyone matching %s.' % name)
|
irc.reply('I haven\'t seen anyone matching %s.' % name)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.reply('I have not seen %s.' % name)
|
irc.reply('I have not seen %s.' % name)
|
||||||
# XXX This should be channeldb, but ChannelUserDictionary does't support it.
|
seen = wrap(seen, ['channeldb', 'nick'])
|
||||||
seen = wrap(seen, ['channel', 'nick'])
|
|
||||||
|
|
||||||
def last(self, irc, msg, args, channel):
|
def last(self, irc, msg, args, channel):
|
||||||
"""[<channel>]
|
"""[<channel>]
|
||||||
@ -179,7 +181,7 @@ class Seen(callbacks.Privmsg):
|
|||||||
(channel, utils.timeElapsed(time.time()-when), said))
|
(channel, utils.timeElapsed(time.time()-when), said))
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.reply('I have never seen anyone.')
|
irc.reply('I have never seen anyone.')
|
||||||
last = wrap(last, ['channel'])
|
last = wrap(last, ['channeldb'])
|
||||||
|
|
||||||
|
|
||||||
def user(self, irc, msg, args, channel, user):
|
def user(self, irc, msg, args, channel, user):
|
||||||
@ -198,7 +200,7 @@ class Seen(callbacks.Privmsg):
|
|||||||
said))
|
said))
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.reply('I have not seen %s.' % name)
|
irc.reply('I have not seen %s.' % name)
|
||||||
user = wrap(user, ['channel', 'otherUser'])
|
user = wrap(user, ['channeldb', 'otherUser'])
|
||||||
|
|
||||||
|
|
||||||
Class = Seen
|
Class = Seen
|
||||||
|
@ -311,8 +311,7 @@ class Services(callbacks.Privmsg):
|
|||||||
# You have been unbanned from (oftc)
|
# You have been unbanned from (oftc)
|
||||||
irc.sendMsg(networkGroup.channels.join(channel))
|
irc.sendMsg(networkGroup.channels.join(channel))
|
||||||
elif 'isn\'t registered' in s:
|
elif 'isn\'t registered' in s:
|
||||||
# XXX We should notify the user that this happened as well.
|
self.log.warning('Received "%s isn\'t registered" from ChanServ',
|
||||||
self.log.info('Received "%s isn\'t registered" from ChanServ',
|
|
||||||
channel)
|
channel)
|
||||||
elif 'this channel has been registered' in s:
|
elif 'this channel has been registered' in s:
|
||||||
self.log.debug('Got "Registered channel" from ChanServ.')
|
self.log.debug('Got "Registered channel" from ChanServ.')
|
||||||
@ -321,8 +320,7 @@ class Services(callbacks.Privmsg):
|
|||||||
# we already have ops.
|
# we already have ops.
|
||||||
self.log.debug('Got "Already opped" from ChanServ.')
|
self.log.debug('Got "Already opped" from ChanServ.')
|
||||||
elif 'access level' in s and 'is required' in s:
|
elif 'access level' in s and 'is required' in s:
|
||||||
# XXX We should notify the user that this happened.
|
self.log.warning('Got "Access level required" from ChanServ.')
|
||||||
self.log.debug('Got "Access level required" from ChanServ.')
|
|
||||||
elif 'inviting' in s:
|
elif 'inviting' in s:
|
||||||
self.log.debug('Got "Inviting to channel" from ChanServ.')
|
self.log.debug('Got "Inviting to channel" from ChanServ.')
|
||||||
else:
|
else:
|
||||||
|
@ -444,7 +444,7 @@ class ChannelIdDatabasePlugin(callbacks.Privmsg):
|
|||||||
def search(self, irc, msg, args, channel, optlist, glob):
|
def search(self, irc, msg, args, channel, optlist, glob):
|
||||||
"""[<channel>] [--{regexp,by} <value>] [<glob>]
|
"""[<channel>] [--{regexp,by} <value>] [<glob>]
|
||||||
|
|
||||||
Searches for $types matching the criteria given. XXX
|
Searches for $types matching the criteria given.
|
||||||
"""
|
"""
|
||||||
predicates = []
|
predicates = []
|
||||||
def p(record):
|
def p(record):
|
||||||
@ -459,8 +459,9 @@ class ChannelIdDatabasePlugin(callbacks.Privmsg):
|
|||||||
elif opt == 'regexp':
|
elif opt == 'regexp':
|
||||||
predicates.append(lambda r, arg=arg: arg.search(r.text))
|
predicates.append(lambda r, arg=arg: arg.search(r.text))
|
||||||
if glob:
|
if glob:
|
||||||
# XXX Case sensitive.
|
def globP(r, glob=glob.lower()):
|
||||||
predicates.append(lambda r: fnmatch.fnmatch(r.text, glob))
|
return fnmatch.fnmatch(r.text.lower(), glob)
|
||||||
|
predicates.append(globP)
|
||||||
L = []
|
L = []
|
||||||
for record in self.db.select(channel, p):
|
for record in self.db.select(channel, p):
|
||||||
L.append(self.searchSerializeRecord(record))
|
L.append(self.searchSerializeRecord(record))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user