Config.py: remove unnessary manual newline remove (strip does that), split each config.txt line only once, so that : works in values.

This commit is contained in:
Context 77
2024-08-03 00:44:41 +02:00
parent 3e289134f9
commit 2e55e97492

View File

@@ -26,9 +26,9 @@ class Config(object):
if not append:
self._config_dict = {}
for l in f.readlines():
kv_pair = l.split(':')
kv_pair = l.split(':', 1)
if len(kv_pair) == 2:
self._config_dict[kv_pair[0].strip()] = kv_pair[1][:-1].strip()
self._config_dict[kv_pair[0].strip()] = kv_pair[1].strip()
mods = self._config_dict['mods'].split(',')
self._config_dict['mods'] = []
for mod in mods:
@@ -86,4 +86,4 @@ class Config(object):
@property
def first_greeting(self):
return self._config_dict['first_greeting']
return self._config_dict['first_greeting']