only match sections at top level
This commit is contained in:
parent
55322cce67
commit
c0e665eb67
1 changed files with 3 additions and 3 deletions
|
@ -31,10 +31,10 @@ def update(config_jsonc='config.jsonc', base='config.pandora.jsonc'):
|
|||
current_docs = get(config_jsonc)
|
||||
for key in docs:
|
||||
if key in current_docs:
|
||||
match = re.escape(' '+docs[key]) + '\W+"' + re.escape(key) + '":'
|
||||
match = '\n' + re.escape(' '+docs[key]) + '\W+"' + re.escape(key) + '":'
|
||||
else:
|
||||
match = ' "' + re.escape(key) + '":'
|
||||
data = re.sub(match, ' %s\n "%s":' % (docs[key], key), data)
|
||||
match = '\n "' + re.escape(key) + '":'
|
||||
data = re.sub(match, '\n %s\n "%s":' % (docs[key], key), data)
|
||||
if data != config:
|
||||
print('updating config documentation', config_jsonc)
|
||||
with open('%s' % config_jsonc, 'wb') as fd:
|
||||
|
|
Loading…
Reference in a new issue