From 82ff5f86f4449b8c1fa14106894ed6c4eae7c0c4 Mon Sep 17 00:00:00 2001 From: Trysdyn Black Date: Wed, 16 Oct 2024 22:58:57 -0700 Subject: [PATCH 1/4] Fix formatting oddness for foes with no weakness --- main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.py b/main.py index 1394bee..7b2798d 100644 --- a/main.py +++ b/main.py @@ -60,6 +60,11 @@ class Parser: # noqa: PLR0904 weak_text = "WEAK: " info["nullifies"] = null_text.split(": ")[1].split(", ") info["weak"] = weak_text.split(": ")[1].split(", ") + + # Due to split oddness we can populate a blank string into weakness + # Delete it if we did. + if info["weak"] == [""]: + del info["weak"] # Specials are name=>desc as k:v # I *think* you can only have one special... elif line.startswith("SPECIAL"): From 1af6a89e6b20bf939693caaf7c8ec003a9b7e19f Mon Sep 17 00:00:00 2001 From: Trysdyn Black Date: Wed, 16 Oct 2024 23:09:59 -0700 Subject: [PATCH 2/4] Add names to large data objects This is so if you do a jq query like `.CHARACTERS[] | select(originally == "Mog")` you'll get their name in the data output. --- main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 7b2798d..3daaa48 100644 --- a/main.py +++ b/main.py @@ -43,6 +43,7 @@ class Parser: # noqa: PLR0904 if "(Level " in line: name = line.split(" (")[0] info["stats"]["level"] = int(line.split("(Level ")[1][:-1]) + info["name"] = name # Stat chart rows elif line.startswith("|"): for stat in line[1:-1].split("|"): @@ -144,6 +145,7 @@ class Parser: # noqa: PLR0904 # Name if line[0:2].isdigit(): name = line[4:] + info["name"] = name # Stat chart rows: BCEX Version only elif line.startswith("|"): @@ -422,7 +424,7 @@ class Parser: # noqa: PLR0904 elif line.strip(): dance = line.strip() if dance not in result: - result[dance] = {} + result[dance] = {"name": dance} return result @@ -450,7 +452,7 @@ class Parser: # noqa: PLR0904 elif next_esper: esper = line.strip() if esper not in result: - result[esper] = {"learnset": {}} + result[esper] = {"learnset": {}, "name": esper} next_esper = False # Any line with ":" is a k=v we should just shove into the dict elif ": " in line: From 8f74ce3a28f59f86dda1b84b24712b3cfd642f53 Mon Sep 17 00:00:00 2001 From: Trysdyn Black Date: Sat, 19 Oct 2024 17:40:07 -0700 Subject: [PATCH 3/4] Add license to prepare for use by another project --- LICENSE.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 LICENSE.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..b53c985 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,29 @@ +"i'm so tired" software license 1.0 + +copyright (c) 2024 Trysdyn Black + +this is anti-capitalist, anti-bigotry software, made by people who are tired of ill-intended organisations and individuals, and would rather not have those around their creations. + +permission is granted, free of charge, to any user (be they a person or an organisation) obtaining a copy of this software, to use it for personal, commercial, or educational purposes, subject to the following conditions: + +1. the above copyright notice and this permission notice shall be included in all copies or modified versions of this software. + +2. the user is one of the following: + a. an individual person, labouring for themselves + b. a non-profit organisation + c. an educational institution + d. an organization that seeks shared profit for all of its members, and allows non-members to set the cost of their labor + +3. if the user is an organization with owners, then all owners are workers and all workers are owners with equal equity and/or equal vote. + +4. if the user is an organization, then the user is not law enforcement or military, or working for or under either. + +5. the user does not use the software for ill-intentioned reasons, as determined by the authors of the software. said reasons include but are not limited to: + a. bigotry, including but not limited to racism, xenophobia, homophobia, transphobia, ableism, sexism, antisemitism, religious intolerance + b. pedophilia, zoophilia, and/or incest + c. support for cops and/or the military + d. any blockchain-related technology, including but not limited to cryptocurrencies + +6. the user does not promote or engage with any of the activities listed in the previous item, and is not affiliated with any group that promotes or engages with any of such activities. + +this software is provided as is, without any warranty or condition. in no event shall the authors be liable to anyone for any damages related to this software or this license, under any kind of legal claim. From 03fb76e0fcb587f03a08cffa736c5cf450780f2e Mon Sep 17 00:00:00 2001 From: Trysdyn Black Date: Mon, 21 Oct 2024 20:33:32 -0700 Subject: [PATCH 4/4] Remove unused mode variable --- main.py | 1 - 1 file changed, 1 deletion(-) diff --git a/main.py b/main.py index 3daaa48..0d16b67 100644 --- a/main.py +++ b/main.py @@ -508,7 +508,6 @@ class Parser: # noqa: PLR0904 need. """ result = {} - mode = None for line in data.split("\n"): if "-----" in line or not line.strip():