Elide ignored replies from nested command output.

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
This commit is contained in:
James Vega 2010-06-24 00:25:44 -04:00
parent d78f7b6ac5
commit c10d964604
2 changed files with 15 additions and 3 deletions

View File

@ -1,5 +1,6 @@
###
# Copyright (c) 2002-2004, Jeremiah Fincher
# Copyright (c) 2010, James Vega
# All rights reserved.
#
# 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
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').
def success(self, irc, msg, args, text):

View File

@ -1,6 +1,6 @@
###
# Copyright (c) 2002-2005, Jeremiah Fincher
# Copyright (c) 2008-2009, James Vega
# Copyright (c) 2008-2010, James Vega
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@ -920,7 +920,14 @@ class NestedCommandsIrcProxy(ReplyIrcProxy):
finally:
self._resetReplyAttributes()
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()
def error(self, s='', Raise=False, **kwargs):