Compare commits
2 Commits
24a9683608
...
d0e9d6913d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d0e9d6913d | ||
|
|
c03ebbf853 |
@ -28,11 +28,15 @@ def main():
|
||||
if obj_type not in collections:
|
||||
collections[obj_type] = []
|
||||
collections[obj_type].append(obj)
|
||||
print("Inserting all data")
|
||||
mongo[DB][COLLECTION].insert_many(items)
|
||||
for collection in collections:
|
||||
print(f"Inserting collection: {collection}")
|
||||
mongo[DB][collection].insert_many(collections[collection])
|
||||
# print("Inserting all data")
|
||||
# mongo[DB][COLLECTION].insert_many(items)
|
||||
with mongo.start_session() as s:
|
||||
s.start_transaction()
|
||||
s[DB].drop_database()
|
||||
for collection in collections:
|
||||
print(f"Inserting collection: {collection}")
|
||||
mongo[DB][collection].insert_many(collections[collection])
|
||||
s.commit_transaction()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@ -17,10 +17,10 @@ with open("./db_explorer/en.json") as f:
|
||||
|
||||
@app.template_filter('filter_vtt')
|
||||
def filter_vtt(text):
|
||||
compendium_re = re.compile(r"@Compendium\[([^\]]+)\]\{([^\}]+)\}")
|
||||
compendium_re = re.compile(r"@Compendium\[(?P<ref>[^\]]+)\]\{(?P<value>[^\}]+)\}")
|
||||
def compendium_return(m):
|
||||
# TODO: Actually add links
|
||||
return f"<a>{m.group(2)}</a>"
|
||||
return f"<a>{m.group('value')}</a>"
|
||||
macro_re = re.compile(r"\[\[\/\S*?r(?:oll)?\s(?:(?P<sdice>[^\{\] ]+)[^\{\]]*|(?:\{(?P<ldice>[^\}]+)\}\[[^\]]+\])?)\]\](?:\{(?P<alt>[^\}]+)\})?")
|
||||
def macro_return(m):
|
||||
if m.group('alt') is not None:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user