Merge branch 'master' into 'master'
correct regexp in getSymbolDict See merge request tile-os/tileos-settings-river!1
This commit is contained in:
commit
ecf24c8a5c
1 changed files with 3 additions and 3 deletions
|
@ -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)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue