forked from 0x2620/pandora
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)
|
current_docs = get(config_jsonc)
|
||||||
for key in docs:
|
for key in docs:
|
||||||
if key in current_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:
|
else:
|
||||||
match = ' "' + re.escape(key) + '":'
|
match = '\n "' + re.escape(key) + '":'
|
||||||
data = re.sub(match, ' %s\n "%s":' % (docs[key], key), data)
|
data = re.sub(match, '\n %s\n "%s":' % (docs[key], key), data)
|
||||||
if data != config:
|
if data != config:
|
||||||
print('updating config documentation', config_jsonc)
|
print('updating config documentation', config_jsonc)
|
||||||
with open('%s' % config_jsonc, 'wb') as fd:
|
with open('%s' % config_jsonc, 'wb') as fd:
|
||||||
|
|
Loading…
Reference in a new issue