mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 11:42:52 +01:00
Config: make 'config list' exclude pseudo-children of network-specific variables.
This commit is contained in:
parent
9e58b2c936
commit
322923c957
@ -151,8 +151,13 @@ class Config(callbacks.Plugin):
|
||||
def _list(self, irc, group):
|
||||
L = []
|
||||
for (vname, v) in group._children.items():
|
||||
if hasattr(group, '_channelValue') and group._channelValue and \
|
||||
irc.isChannel(vname) and not v._children:
|
||||
if getattr(group, '_networkValue', False) and \
|
||||
vname.startswith(':'):
|
||||
# Skip pseudo-children that are network names
|
||||
continue
|
||||
if getattr(group, '_channelValue', False) and \
|
||||
irc.isChannel(vname):
|
||||
# Skip pseudo-children that are channel names
|
||||
continue
|
||||
if hasattr(v, '_channelValue') and v._channelValue:
|
||||
vname = '#' + vname
|
||||
|
@ -56,6 +56,14 @@ class ConfigTestCase(ChannelPluginTestCase):
|
||||
self.assertNotError('config list supybot.replies')
|
||||
self.assertRegexp('config list supybot', r'@plugins.*@replies.*@reply')
|
||||
|
||||
def testListExcludes(self):
|
||||
"""Checks that 'config list' excludes pseudo-children of
|
||||
network-specific and channel-specific variables."""
|
||||
self.assertNotError(
|
||||
'config channel #zpojfejf supybot.replies.error foo')
|
||||
self.assertRegexp('config list supybot.replies.error',
|
||||
"There don't seem to be any values")
|
||||
|
||||
def testHelp(self):
|
||||
self.assertError('config help alsdkfj')
|
||||
self.assertError('config help supybot.alsdkfj')
|
||||
|
Loading…
Reference in New Issue
Block a user