mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-19 08:59:27 +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):
|
def _list(self, irc, group):
|
||||||
L = []
|
L = []
|
||||||
for (vname, v) in group._children.items():
|
for (vname, v) in group._children.items():
|
||||||
if hasattr(group, '_channelValue') and group._channelValue and \
|
if getattr(group, '_networkValue', False) and \
|
||||||
irc.isChannel(vname) and not v._children:
|
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
|
continue
|
||||||
if hasattr(v, '_channelValue') and v._channelValue:
|
if hasattr(v, '_channelValue') and v._channelValue:
|
||||||
vname = '#' + vname
|
vname = '#' + vname
|
||||||
|
@ -56,6 +56,14 @@ class ConfigTestCase(ChannelPluginTestCase):
|
|||||||
self.assertNotError('config list supybot.replies')
|
self.assertNotError('config list supybot.replies')
|
||||||
self.assertRegexp('config list supybot', r'@plugins.*@replies.*@reply')
|
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):
|
def testHelp(self):
|
||||||
self.assertError('config help alsdkfj')
|
self.assertError('config help alsdkfj')
|
||||||
self.assertError('config help supybot.alsdkfj')
|
self.assertError('config help supybot.alsdkfj')
|
||||||
|
Loading…
Reference in New Issue
Block a user