From 758958dca3d2ecb4c0e1a5a7959cd21699fd39b3 Mon Sep 17 00:00:00 2001 From: LDericher <40151420+ldericher@users.noreply.github.com> Date: Mon, 9 Aug 2021 06:18:56 +0200 Subject: [PATCH] Formatting --- fftcg/card.py | 22 +++++++++++----------- main.py | 19 +++++++++++-------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/fftcg/card.py b/fftcg/card.py index 8fd5c1d..e2ce0dd 100644 --- a/fftcg/card.py +++ b/fftcg/card.py @@ -3,14 +3,14 @@ import re class Card: __ELEMENTS_MAP = { - '火': "Fire", - '氷': "Ice", - '風': "Wind", - '土': "Earth", - '雷': "Lightning", - '水': "Water", - '光': "Light", - '闇': "Darkness" + "火": "Fire", + "氷": "Ice", + "風": "Wind", + "土": "Earth", + "雷": "Lightning", + "水": "Water", + "光": "Light", + "闇": "Darkness" } def __init__(self, data: dict[str, any], language: str = "EN"): @@ -25,18 +25,18 @@ class Card: if str(data["Code"])[0].isnumeric(): # card code starts with a number self.__opus, self.__serial, self.__rarity = \ - re.match(r'([0-9]+)-([0-9]+)([CRHLS])', data["Code"]).groups() + re.match(r"([0-9]+)-([0-9]+)([CRHLS])", data["Code"]).groups() elif str(data["Code"]).startswith("PR"): # card code starts with "PR" self.__opus, self.__serial = \ - re.match(r'(PR)-([0-9]+)', data["Code"]).groups() + re.match(r"(PR)-([0-9]+)", data["Code"]).groups() self.__rarity = "" elif str(data["Code"]).startswith("B"): # card code starts with "B" self.__opus, self.__serial = \ - re.match(r'(B)-([0-9]+)', data["Code"]).groups() + re.match(r"(B)-([0-9]+)", data["Code"]).groups() self.__rarity = "" else: diff --git a/main.py b/main.py index 00ef18e..b700af2 100755 --- a/main.py +++ b/main.py @@ -14,26 +14,29 @@ RESOLUTION = 429, 600 # default in TTsim: 480x670 pixels per card def main() -> None: # set up CLI parser = argparse.ArgumentParser( - description='Imports FFTCG cards for TT-Sim.') + description="Imports FFTCG cards for TT-Sim.", + ) parser.add_argument( - 'opus_id', - default="1", + "opus_id", + default="promo", metavar="Opus_ID", nargs="?", - help='the Opus to import') + help="the Opus to import", + ) parser.add_argument( - '-n', '--num_threads', + "-n", "--num_threads", type=int, default=20, metavar="COUNT", - help='maximum number of concurrent requests') + help="maximum number of concurrent requests", + ) args = parser.parse_args() # set up logging - logging.basicConfig(level=logging.INFO, format='%(levelname)s: %(threadName)s %(message)s') + logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(threadName)s %(message)s") # output directory if not os.path.exists("out"): @@ -50,5 +53,5 @@ def main() -> None: logging.info("Thanks for using fftcgtool!") -if __name__ == '__main__': +if __name__ == "__main__": main()