From 58b37f478cc58a816d4e7422a61acec2dbf35c13 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 9 Nov 2019 16:41:22 +0100 Subject: [PATCH] Bump version --- royalnet/utils/wikiport.py | 33 --------------------------------- royalnet/version.py | 2 +- 2 files changed, 1 insertion(+), 34 deletions(-) delete mode 100644 royalnet/utils/wikiport.py diff --git a/royalnet/utils/wikiport.py b/royalnet/utils/wikiport.py deleted file mode 100644 index e2a58599..00000000 --- a/royalnet/utils/wikiport.py +++ /dev/null @@ -1,33 +0,0 @@ -import os -import re -import datetime -import difflib -import uuid -from royalnet.database import Alchemy -from royalnet.packs.common.tables import User -from royalnet.packs.royal.tables import WikiPage, WikiRevision - - -if __name__ == "__main__": - alchemy = Alchemy(os.environ["DB_PATH"], {User, WikiPage, WikiRevision}) - with open(r"data.txt") as file, alchemy.session_cm() as session: - for line in file.readlines(): - match = re.match("^([^\t]+)\t([^\t]+)\t([tf])$", line) - if match is None: - continue - title = match.group(1) - content = match.group(2).replace(r"\r\n", "\n").replace(r"\t", "\t") - page = alchemy.WikiPage(page_id=uuid.uuid4(), - title=title, - content=content) - session.flush() - revision = alchemy.WikiRevision(revision_id=uuid.uuid4(), - page=page, - author_id=31, # Royalbot - timestamp=datetime.datetime.now(), - reason="Imported from 'four' database", - diff="\n".join(difflib.unified_diff([], content.split("\n")))) - session.add(page) - session.add(revision) - print(f"{title} done.") - session.commit() diff --git a/royalnet/version.py b/royalnet/version.py index e6064ad5..71edc665 100644 --- a/royalnet/version.py +++ b/royalnet/version.py @@ -1,4 +1,4 @@ -semantic = "5.0a90" +semantic = "5.0a91" if __name__ == "__main__": print(semantic)