mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-02 17:29:22 +01:00
Merge branch 'testing' of github.com:ProgVal/Limnoria into testing
This commit is contained in:
commit
4b9992537b
@ -12,4 +12,4 @@ install:
|
||||
script:
|
||||
- echo $TRAVIS_PYTHON_VERSION
|
||||
- python setup.py install
|
||||
- supybot-test test --plugins-dir=./build/lib/supybot/plugins/ --no-network --disable-multiprocessing
|
||||
- supybot-test test --plugins-dir=./build/lib*/supybot/plugins/ --no-network --disable-multiprocessing
|
||||
|
@ -1,4 +1,4 @@
|
||||
[http://supybot.fr.cr/doc/use/install.html](Install guide)
|
||||
[Install guide](http://supybot.fr.cr/doc/use/install.html)
|
||||
|
||||
# Build status
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# -*- coding: utf8 -*-
|
||||
###
|
||||
# Copyright (c) 2002-2004, Jeremiah Fincher
|
||||
# All rights reserved.
|
||||
|
@ -262,7 +262,7 @@ class Karma(callbacks.Plugin):
|
||||
|
||||
def invalidCommand(self, irc, msg, tokens):
|
||||
channel = msg.args[0]
|
||||
if not irc.isChannel(channel):
|
||||
if not irc.isChannel(channel) or not tokens:
|
||||
return
|
||||
if tokens[-1][-2:] in ('++', '--'):
|
||||
thing = ' '.join(tokens)
|
||||
|
@ -88,6 +88,7 @@ class Misc(callbacks.Plugin):
|
||||
def invalidCommand(self, irc, msg, tokens):
|
||||
assert not msg.repliedTo, 'repliedTo msg in Misc.invalidCommand.'
|
||||
assert self is irc.callbacks[-1], 'Misc isn\'t last callback.'
|
||||
assert msg.command in ('PRIVMSG', 'NOTICE')
|
||||
self.log.debug('Misc.invalidCommand called (tokens %s)', tokens)
|
||||
# First, we check for invalidCommand floods. This is rightfully done
|
||||
# here since this will be the last invalidCommand called, and thus it
|
||||
@ -125,7 +126,9 @@ class Misc(callbacks.Plugin):
|
||||
banmasker = conf.supybot.protocols.irc.banmask.makeBanmask
|
||||
self.invalidCommands.enqueue(msg)
|
||||
if self.invalidCommands.len(msg) > maximum and \
|
||||
not ircdb.checkCapability(msg.prefix, 'owner'):
|
||||
not ircdb.checkCapability(msg.prefix, 'owner') and \
|
||||
msg.prefix != irc.prefix and \
|
||||
ircutils.isUserHostmask(msg.prefix):
|
||||
penalty = conf.supybot.abuse.flood.command.invalid.punishment()
|
||||
banmask = banmasker(msg.prefix, channel=None)
|
||||
self.log.info('Ignoring %s for %s seconds due to an apparent '
|
||||
|
@ -264,6 +264,10 @@ class Services(callbacks.Plugin):
|
||||
on)
|
||||
elif 'inviting' in s:
|
||||
self.log.debug('Got "Inviting to channel" from ChanServ %s.', on)
|
||||
elif s.startswith('['):
|
||||
chanTypes = irc.state.supported['CHANTYPES']
|
||||
if re.match(r'^\[[%s]' % re.escape(chanTypes), s):
|
||||
self.log.debug('Got entrymsg from ChanServ %s.', on)
|
||||
else:
|
||||
self.log.warning('Got unexpected notice from ChanServ %s: %r.',
|
||||
on, msg)
|
||||
|
@ -129,7 +129,8 @@ if __name__ == '__main__':
|
||||
filename = os.path.join(home, filename)
|
||||
if os.path.exists(filename):
|
||||
debug('Found %s, sourcing.' % filename)
|
||||
inst.stdin.write('source %s' % filename + os.linesep)
|
||||
command = 'source %s' % filename + os.linesep
|
||||
inst.stdin.write(command.encode('utf-8'))
|
||||
cmdline = '%s --daemon %s' % (options.supybot, options.conffile)
|
||||
debug('Sending cmdline to sh process.')
|
||||
inst.stdin.write(cmdline.encode('utf-8') + os.linesep.encode('utf-8'))
|
||||
|
@ -910,6 +910,7 @@ class Irc(IrcCommandDispatcher):
|
||||
self.lastTake = 0
|
||||
self.server = 'unset'
|
||||
self.afterConnect = False
|
||||
self.startedAt = time.time()
|
||||
self.lastping = time.time()
|
||||
self.outstandingPing = False
|
||||
|
||||
|
@ -117,8 +117,13 @@ def getUrlFd(url, headers=None, data=None):
|
||||
url = scheme + '://' + url
|
||||
request = urllib2.Request(url, headers=headers, data=data)
|
||||
if 'auth' in locals():
|
||||
if sys.version_info[0] >= 3 and isinstance(auth, str):
|
||||
auth = auth.encode()
|
||||
auth = base64.b64encode(auth)
|
||||
if sys.version_info[0] >= 3:
|
||||
auth = auth.decode()
|
||||
request.add_header('Authorization',
|
||||
'Basic ' + base64.b64encode(auth))
|
||||
'Basic ' + auth)
|
||||
else:
|
||||
request = url
|
||||
request.add_data(data)
|
||||
@ -212,3 +217,4 @@ def mungeEmail(s):
|
||||
|
||||
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user