--- /dev/null
+import json
+import re
+
+quote_pattern = re.compile(r"^\"(.*)\" \- (.*?)\|(.*?)\@(.*?)$")
+
+quote_list = []
+
+with open("../test/quotes.json", mode="r", encoding="utf-8") as quotes_json_file:
+ quote_list.extend(json.load(quotes_json_file))
+
+with open("../test/quotes.txt", mode="r", encoding="utf-8") as quotes_file:
+ for quote in quotes_file:
+ quote = quote.rstrip()
+ match = quote_pattern.fullmatch(quote)
+
+ text, author, portrait, link = match.groups()
+ quote_dict = {
+ "quote": text,
+ "author": author,
+ "portrait": "portrait-" + portrait.lower().replace(" ", "-").replace("'", ""),
+ "link": link.removeprefix("https://mechyrdia.info/lore/")
+ }
+ quote_list.append(quote_dict)
+
+with open("../test/quotes.json", mode="w", encoding="utf-8") as quotes_json_file:
+ json.dump(quote_list, quotes_json_file, indent="\t")
+++ /dev/null
-import json
-import re
-
-quote_pattern = re.compile(r"^\"(.*)\" \- (.*?)\|(.*?)\@(.*?)$")
-
-quote_list = []
-
-with open("../test/quotes.json", mode="r", encoding="utf-8") as quotes_json_file:
- quote_list.extend(json.load(quotes_json_file))
-
-with open("../test/quotes.txt", mode="r", encoding="utf-8") as quotes_file:
- for quote in quotes_file:
- quote = quote.rstrip()
- match = quote_pattern.fullmatch(quote)
-
- text, author, portrait, link = match.groups()
- quote_dict = {
- "quote": text,
- "author": author,
- "portrait": "portrait-" + portrait.lower().replace(" ", "-").replace("'", ""),
- "link": link.removeprefix("https://mechyrdia.info/lore/")
- }
- quote_list.append(quote_dict)
-
-with open("../test/quotes.json", mode="w", encoding="utf-8") as quotes_json_file:
- json.dump(quote_list, quotes_json_file, indent="\t")