add method to remove metaoptions (debug, the new 'meta.pubmsg_needs_bot_prefix') from a list. provided for convenience
This commit is contained in:
parent
d590eede2a
commit
e13264fc3b
10
Module.py
10
Module.py
|
@ -226,6 +226,16 @@ class Module(object):
|
|||
else:
|
||||
return attempt
|
||||
|
||||
def remove_metaoptions(self, list):
|
||||
"""Remove metaoptions from provided list, which was probably from a config file."""
|
||||
|
||||
list.remove('debug')
|
||||
# if this option has been provided, don't print it
|
||||
try:
|
||||
self.config.get(self.__class__.__name__, 'meta.pubmsg_needs_bot_prefix')
|
||||
cdlist.remove('meta.pubmsg_needs_bot_prefix')
|
||||
except NoOptionError: pass
|
||||
|
||||
def do(self, connection, event, nick, userhost, replypath, what, admin_unlocked):
|
||||
"""
|
||||
Do the primary thing this module was intended to do.
|
||||
|
|
|
@ -49,12 +49,7 @@ class Countdown(Module):
|
|||
elif whats[1] == 'list':
|
||||
try:
|
||||
cdlist = self.config.options(self.__class__.__name__)
|
||||
cdlist.remove('debug')
|
||||
# if this option has been provided, don't print it
|
||||
try:
|
||||
self.config.get(self.__class__.__name__, 'meta.pubmsg_needs_bot_prefix')
|
||||
cdlist.remove('meta.pubmsg_needs_bot_prefix')
|
||||
except NoOptionError: pass
|
||||
self.remove_metaoptions(cdlist)
|
||||
cdlist.sort()
|
||||
liststr = ', '.join(cdlist)
|
||||
return self.reply(connection, replypath, liststr)
|
||||
|
|
Loading…
Reference in New Issue