gitea-migrator/migrator/helper.py

12 lines
262 B
Python
Raw Normal View History

2020-08-03 22:05:16 +02:00
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