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:
|
else:
|
||||||
return attempt
|
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):
|
def do(self, connection, event, nick, userhost, replypath, what, admin_unlocked):
|
||||||
"""
|
"""
|
||||||
Do the primary thing this module was intended to do.
|
Do the primary thing this module was intended to do.
|
||||||
|
@ -49,12 +49,7 @@ class Countdown(Module):
|
|||||||
elif whats[1] == 'list':
|
elif whats[1] == 'list':
|
||||||
try:
|
try:
|
||||||
cdlist = self.config.options(self.__class__.__name__)
|
cdlist = self.config.options(self.__class__.__name__)
|
||||||
cdlist.remove('debug')
|
self.remove_metaoptions(cdlist)
|
||||||
# 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
|
|
||||||
cdlist.sort()
|
cdlist.sort()
|
||||||
liststr = ', '.join(cdlist)
|
liststr = ', '.join(cdlist)
|
||||||
return self.reply(connection, replypath, liststr)
|
return self.reply(connection, replypath, liststr)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user