mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-25 19:44:13 +01:00
Merge branch 'testing' into fix/fd-leak
This commit is contained in:
commit
0934f1075b
@ -314,6 +314,8 @@ class Misc(callbacks.Plugin):
|
|||||||
version = data['commit']['committer']['date']
|
version = data['commit']['committer']['date']
|
||||||
# Strip the last 'Z':
|
# Strip the last 'Z':
|
||||||
version = ''.join(version.rsplit('Z', 1)).replace(':', '-')
|
version = ''.join(version.rsplit('Z', 1)).replace(':', '-')
|
||||||
|
if sys.version_info[0] < 3 and isinstance(version, unicode):
|
||||||
|
version = version.encode('utf8')
|
||||||
versions[branch] = version
|
versions[branch] = version
|
||||||
newest = _('The newest versions available online are %s.') % \
|
newest = _('The newest versions available online are %s.') % \
|
||||||
', '.join([_('%s (in %s)') % (y,x)
|
', '.join([_('%s (in %s)') % (y,x)
|
||||||
@ -505,13 +507,7 @@ class Misc(callbacks.Plugin):
|
|||||||
'regexp': 'regexpMatcher',})])
|
'regexp': 'regexpMatcher',})])
|
||||||
|
|
||||||
|
|
||||||
@internationalizeDocstring
|
def _tell(self, irc, msg, args, target, text, notice):
|
||||||
def tell(self, irc, msg, args, target, text):
|
|
||||||
"""<nick> <text>
|
|
||||||
|
|
||||||
Tells the <nick> whatever <text> is. Use nested commands to your
|
|
||||||
benefit here.
|
|
||||||
"""
|
|
||||||
if irc.nested:
|
if irc.nested:
|
||||||
irc.error('This command cannot be nested.', Raise=True)
|
irc.error('This command cannot be nested.', Raise=True)
|
||||||
if target.lower() == 'me':
|
if target.lower() == 'me':
|
||||||
@ -534,9 +530,28 @@ class Misc(callbacks.Plugin):
|
|||||||
text = '* %s %s' % (irc.nick, text)
|
text = '* %s %s' % (irc.nick, text)
|
||||||
s = _('%s wants me to tell you: %s') % (msg.nick, text)
|
s = _('%s wants me to tell you: %s') % (msg.nick, text)
|
||||||
irc.replySuccess()
|
irc.replySuccess()
|
||||||
irc.reply(s, to=target, private=True)
|
irc.reply(s, to=target, private=True, notice=notice)
|
||||||
|
|
||||||
|
@internationalizeDocstring
|
||||||
|
def tell(self, *args):
|
||||||
|
"""<nick> <text>
|
||||||
|
|
||||||
|
Tells the <nick> whatever <text> is. Use nested commands to your
|
||||||
|
benefit here.
|
||||||
|
"""
|
||||||
|
self._tell(*args, notice=False)
|
||||||
tell = wrap(tell, ['something', 'text'])
|
tell = wrap(tell, ['something', 'text'])
|
||||||
|
|
||||||
|
@internationalizeDocstring
|
||||||
|
def noticetell(self, *args):
|
||||||
|
"""<nick> <text>
|
||||||
|
|
||||||
|
Tells the <nick> whatever <text> is, in a notice. Use nested
|
||||||
|
commands to your benefit here.
|
||||||
|
"""
|
||||||
|
self._tell(*args, notice=True)
|
||||||
|
noticetell = wrap(noticetell, ['something', 'text'])
|
||||||
|
|
||||||
@internationalizeDocstring
|
@internationalizeDocstring
|
||||||
def ping(self, irc, msg, args):
|
def ping(self, irc, msg, args):
|
||||||
"""takes no arguments
|
"""takes no arguments
|
||||||
|
@ -186,6 +186,7 @@ class RealSupyHTTPServer(HTTPServer):
|
|||||||
'reloaded the plugin and it didn\'t properly unhook. '
|
'reloaded the plugin and it didn\'t properly unhook. '
|
||||||
'Forced unhook.') % subdir)
|
'Forced unhook.') % subdir)
|
||||||
self.callbacks[subdir] = callback
|
self.callbacks[subdir] = callback
|
||||||
|
callback.doHook(self, subdir)
|
||||||
def unhook(self, subdir):
|
def unhook(self, subdir):
|
||||||
callback = self.callbacks.pop(subdir) # May raise a KeyError. We don't care.
|
callback = self.callbacks.pop(subdir) # May raise a KeyError. We don't care.
|
||||||
callback.doUnhook(self)
|
callback.doUnhook(self)
|
||||||
@ -285,6 +286,9 @@ class SupyHTTPServerCallback(object):
|
|||||||
|
|
||||||
doPost = doHead = doGet
|
doPost = doHead = doGet
|
||||||
|
|
||||||
|
def doHook(self, handler, subdir):
|
||||||
|
"""Method called when hooking this callback."""
|
||||||
|
pass
|
||||||
def doUnhook(self, handler):
|
def doUnhook(self, handler):
|
||||||
"""Method called when unhooking this callback."""
|
"""Method called when unhooking this callback."""
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user