Merge branch 'testing' into fix/fd-leak

This commit is contained in:
nyuszika7h 2014-01-03 17:45:53 +01:00
commit 0934f1075b
2 changed files with 27 additions and 8 deletions

View File

@ -314,6 +314,8 @@ class Misc(callbacks.Plugin):
version = data['commit']['committer']['date']
# Strip the last 'Z':
version = ''.join(version.rsplit('Z', 1)).replace(':', '-')
if sys.version_info[0] < 3 and isinstance(version, unicode):
version = version.encode('utf8')
versions[branch] = version
newest = _('The newest versions available online are %s.') % \
', '.join([_('%s (in %s)') % (y,x)
@ -505,13 +507,7 @@ class Misc(callbacks.Plugin):
'regexp': 'regexpMatcher',})])
@internationalizeDocstring
def tell(self, irc, msg, args, target, text):
"""<nick> <text>
Tells the <nick> whatever <text> is. Use nested commands to your
benefit here.
"""
def _tell(self, irc, msg, args, target, text, notice):
if irc.nested:
irc.error('This command cannot be nested.', Raise=True)
if target.lower() == 'me':
@ -534,9 +530,28 @@ class Misc(callbacks.Plugin):
text = '* %s %s' % (irc.nick, text)
s = _('%s wants me to tell you: %s') % (msg.nick, text)
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'])
@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
def ping(self, irc, msg, args):
"""takes no arguments

View File

@ -186,6 +186,7 @@ class RealSupyHTTPServer(HTTPServer):
'reloaded the plugin and it didn\'t properly unhook. '
'Forced unhook.') % subdir)
self.callbacks[subdir] = callback
callback.doHook(self, subdir)
def unhook(self, subdir):
callback = self.callbacks.pop(subdir) # May raise a KeyError. We don't care.
callback.doUnhook(self)
@ -285,6 +286,9 @@ class SupyHTTPServerCallback(object):
doPost = doHead = doGet
def doHook(self, handler, subdir):
"""Method called when hooking this callback."""
pass
def doUnhook(self, handler):
"""Method called when unhooking this callback."""
pass