mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-02 17:29:22 +01:00
Elide ignored replies from nested command output.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
This commit is contained in:
parent
d78f7b6ac5
commit
c10d964604
@ -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
|
||||||
@ -919,6 +919,13 @@ class NestedCommandsIrcProxy(ReplyIrcProxy):
|
|||||||
return m
|
return m
|
||||||
finally:
|
finally:
|
||||||
self._resetReplyAttributes()
|
self._resetReplyAttributes()
|
||||||
|
else:
|
||||||
|
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:
|
else:
|
||||||
self.args[self.counter] = s
|
self.args[self.counter] = s
|
||||||
self.evalArgs()
|
self.evalArgs()
|
||||||
|
Loading…
Reference in New Issue
Block a user