From db3806e78f35667aac311e3d46c95d57a671d49d Mon Sep 17 00:00:00 2001 From: JoYo <> Date: Wed, 5 Jan 2022 15:40:58 -0500 Subject: [PATCH] tcc cli script --- banana/scripts.py | 45 ++++++++++++++++++++++++++++++++++++++++++--- setup.py | 5 ++++- 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/banana/scripts.py b/banana/scripts.py index 4e9a83e..d6206f5 100644 --- a/banana/scripts.py +++ b/banana/scripts.py @@ -16,9 +16,7 @@ def periodical_script(): parser.add_argument( "-p", "--eso_live_path", - default=Path.home().joinpath( - ".steam/steam/steamapps/compatdata/306130/pfx/drive_c/users/steamuser/Documents/Elder Scrolls Online/live/" - ), + default=Path.home().joinpath("ESO/live/"), help='default: "~/.steam/steam/steamapps/compatdata/306130/pfx/drive_c/users/steamuser/Documents/Elder Scrolls Online/live/"', ) args = parser.parse_args() @@ -69,3 +67,44 @@ def periodical_script(): compare.esoui_to_live(esoui_uris=esoui_uris, live_path=live_path) tamriel_trade_centre.update(live_path=live_path) + + +def ttc(): + parser = ArgumentParser( + description="Visit https://www.esoui.com/ to search for addons and their dependencies URLs. Edit addons.yaml in the ESO live path and add the URL for each addon for installation. " + ) + parser.add_argument("-v", "--verbose", action="count", help="verbose logging") + parser.add_argument( + "-p", + "--eso_live_path", + default=Path.home().joinpath( + ".steam/steam/steamapps/compatdata/306130/pfx/drive_c/users/steamuser/Documents/Elder Scrolls Online/live/" + ), + help='default: "~/.steam/steam/steamapps/compatdata/306130/pfx/drive_c/users/steamuser/Documents/Elder Scrolls Online/live/"', + ) + args = parser.parse_args() + + if args.verbose: + logging.basicConfig( + level=logging.DEBUG, + format="%(asctime)s %(filename)s:%(lineno)d %(message)s", + ) + else: + logging.basicConfig( + level=logging.INFO, + format="%(message)s", + ) + + logging.info(args) + + if isinstance(args.eso_live_path, str): + if args.eso_live_path[:2] == "~/": + args.eso_live_path = Path.home().joinpath(args.eso_live_path[2:]) + + live_path = Path(args.eso_live_path).joinpath("AddOns") + + if not live_path.is_dir(): + logging.error(f"eso_live_path_invalid_dir {live_path}") + return + + tamriel_trade_centre.update(live_path=live_path) diff --git a/setup.py b/setup.py index e845526..e9cd551 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,10 @@ setup( version="0.0.1", packages=["banana"], entry_points={ - "console_scripts": ["eso-banana-script = banana:scripts.periodical_script"], + "console_scripts": [ + "eso-banana-script = banana:scripts.periodical_script", + "eso-ttc = banana:scripts.ttc", + ], }, python_requires=">3", install_requires=[