Compare commits

..

No commits in common. "d0e9d6913d12c0afaecbf601685219ca341ca197" and "24a9683608e469b93abfd97a76f563b7c23261ce" have entirely different histories.

2 changed files with 7 additions and 11 deletions

View File

@ -28,15 +28,11 @@ def main():
if obj_type not in collections: if obj_type not in collections:
collections[obj_type] = [] collections[obj_type] = []
collections[obj_type].append(obj) collections[obj_type].append(obj)
# print("Inserting all data") print("Inserting all data")
# mongo[DB][COLLECTION].insert_many(items) mongo[DB][COLLECTION].insert_many(items)
with mongo.start_session() as s: for collection in collections:
s.start_transaction() print(f"Inserting collection: {collection}")
s[DB].drop_database() mongo[DB][collection].insert_many(collections[collection])
for collection in collections:
print(f"Inserting collection: {collection}")
mongo[DB][collection].insert_many(collections[collection])
s.commit_transaction()
if __name__ == "__main__": if __name__ == "__main__":
main() main()

View File

@ -17,10 +17,10 @@ with open("./db_explorer/en.json") as f:
@app.template_filter('filter_vtt') @app.template_filter('filter_vtt')
def filter_vtt(text): def filter_vtt(text):
compendium_re = re.compile(r"@Compendium\[(?P<ref>[^\]]+)\]\{(?P<value>[^\}]+)\}") compendium_re = re.compile(r"@Compendium\[([^\]]+)\]\{([^\}]+)\}")
def compendium_return(m): def compendium_return(m):
# TODO: Actually add links # TODO: Actually add links
return f"<a>{m.group('value')}</a>" return f"<a>{m.group(2)}</a>"
macro_re = re.compile(r"\[\[\/\S*?r(?:oll)?\s(?:(?P<sdice>[^\{\] ]+)[^\{\]]*|(?:\{(?P<ldice>[^\}]+)\}\[[^\]]+\])?)\]\](?:\{(?P<alt>[^\}]+)\})?") macro_re = re.compile(r"\[\[\/\S*?r(?:oll)?\s(?:(?P<sdice>[^\{\] ]+)[^\{\]]*|(?:\{(?P<ldice>[^\}]+)\}\[[^\]]+\])?)\]\](?:\{(?P<alt>[^\}]+)\})?")
def macro_return(m): def macro_return(m):
if m.group('alt') is not None: if m.group('alt') is not None: