gitea-migrator/migrator/helper.py
2020-08-03 22:05:16 +02:00

11 lines
262 B
Python

import re
def get_dict_from_query(query, name):
d = {}
matcher = re.compile("^%s\[(.+)\]$" % name)
for key, value in query.items():
match = matcher.match(key)
if match is not None:
d[match.group(1)] = value
return d