mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-05 18:49:23 +01:00
Don't strip spaces when parsing registry values.
It breaks plugins.Messageparser.listSeparator, and probably others.
This commit is contained in:
parent
bd1d7c9fa1
commit
43a8724d3a
@ -103,9 +103,9 @@ def open_registry(filename, clear=False):
|
||||
else:
|
||||
acc += line
|
||||
try:
|
||||
(key, value) = re.split(r'(?<!\\):', acc, 1)
|
||||
(key, value) = re.split(r'(?<!\\): ', acc, 1)
|
||||
key = key.strip()
|
||||
value = value.strip()
|
||||
value = value.strip('\r\n')
|
||||
value = decoder(value)[0]
|
||||
acc = ''
|
||||
except ValueError:
|
||||
|
@ -200,6 +200,14 @@ class ValuesTestCase(SupyTestCase):
|
||||
registry.open_registry(filename)
|
||||
self.assertEqual(conf.supybot.reply.whenAddressedBy.chars(), '\\')
|
||||
|
||||
def testSpacesValues(self):
|
||||
with conf.supybot.networks.test.password.context(' foo '):
|
||||
self.assertEqual(conf.supybot.networks.test.password(), ' foo ')
|
||||
filename = conf.supybot.directories.conf.dirize('spaces.conf')
|
||||
registry.close(conf.supybot, filename)
|
||||
registry.open_registry(filename)
|
||||
self.assertEqual(conf.supybot.networks.test.password(), ' foo ')
|
||||
|
||||
def testWith(self):
|
||||
v = registry.String('foo', 'help')
|
||||
self.assertEqual(v(), 'foo')
|
||||
|
Loading…
Reference in New Issue
Block a user