Merge branch 'master' into 'master'

correct regexp in getSymbolDict

See merge request tile-os/tileos-settings-river!1
This commit is contained in:
Aleksey Samoilov 2024-03-14 06:25:39 +00:00
commit ecf24c8a5c

View file

@ -63,13 +63,13 @@ def getDocsConfig(lines: list[str]):
def getSymbolDict(lines: list[str]): def getSymbolDict(lines: list[str]):
setRegex = r"^set\s+(?P<variable>\$.+?)\s(?P<value>.+)?" setRegex = r"^(?P<variable>\w+)\=\"(?P<value>[^\"]+)+\" ?"
dictionary = {} dictionary = {}
for line in lines: for line in lines:
match = re.match(setRegex, line) match = re.match(setRegex, line)
if match: if match:
if match.group('variable'): if match.group('variable'):
dictionary[match.group('variable')] = match.group('value') dictionary['$'+match.group('variable')] = match.group('value')
return dict(dictionary) return dict(dictionary)