mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 19:22:45 +01:00
Elide ignored replies from nested command output.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit c10d964604
)
Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
This commit is contained in:
parent
16dbd8917a
commit
dbde5fc250
@ -1,5 +1,6 @@
|
|||||||
###
|
###
|
||||||
# Copyright (c) 2002-2004, Jeremiah Fincher
|
# Copyright (c) 2002-2004, Jeremiah Fincher
|
||||||
|
# Copyright (c) 2010, James Vega
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@ -43,7 +44,11 @@ class Utilities(callbacks.Plugin):
|
|||||||
Does nothing. Useful sometimes for sequencing commands when you don't
|
Does nothing. Useful sometimes for sequencing commands when you don't
|
||||||
care about their non-error return values.
|
care about their non-error return values.
|
||||||
"""
|
"""
|
||||||
pass
|
if irc.nested:
|
||||||
|
msg.tag('ignored')
|
||||||
|
# Need to call NestedCommandsIrcProxy.reply to continue evaluation
|
||||||
|
# of the remaining nested commands.
|
||||||
|
irc.reply('')
|
||||||
# Do be careful not to wrap this unless you do any('something').
|
# Do be careful not to wrap this unless you do any('something').
|
||||||
|
|
||||||
def success(self, irc, msg, args, text):
|
def success(self, irc, msg, args, text):
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
###
|
###
|
||||||
# Copyright (c) 2002-2005, Jeremiah Fincher
|
# Copyright (c) 2002-2005, Jeremiah Fincher
|
||||||
# Copyright (c) 2008-2009, James Vega
|
# Copyright (c) 2008-2010, James Vega
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@ -920,7 +920,14 @@ class NestedCommandsIrcProxy(ReplyIrcProxy):
|
|||||||
finally:
|
finally:
|
||||||
self._resetReplyAttributes()
|
self._resetReplyAttributes()
|
||||||
else:
|
else:
|
||||||
self.args[self.counter] = s
|
if msg.ignored:
|
||||||
|
# Since the final reply string is constructed via
|
||||||
|
# ' '.join(self.args), the args index for ignored commands
|
||||||
|
# needs to be popped to avoid extra spaces in the final reply.
|
||||||
|
self.args.pop(self.counter)
|
||||||
|
msg.tag('ignored', False)
|
||||||
|
else:
|
||||||
|
self.args[self.counter] = s
|
||||||
self.evalArgs()
|
self.evalArgs()
|
||||||
|
|
||||||
def error(self, s='', Raise=False, **kwargs):
|
def error(self, s='', Raise=False, **kwargs):
|
||||||
|
Loading…
Reference in New Issue
Block a user