From 2cb6f698e914629d78b510951294e42dffa1f291 Mon Sep 17 00:00:00 2001 From: zero01101 Date: Sat, 29 Jul 2023 10:26:51 -0500 Subject: [PATCH] hey guess who had an internet outage and realized openOutpaint extension doesn't work when that occurs --- install.py | 6 +++++- scripts/main.py | 12 ++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/install.py b/install.py index ee5b272..1bbade6 100644 --- a/install.py +++ b/install.py @@ -18,4 +18,8 @@ print(stdout) except ImportError: print("[openoutpaint-extension] We failed to import the 'launch' module. Using 'os'") - os.system(command) + try: + os.system(command) + except: + # TODO: find exception type + print(f"[openOutpaint-extension-submodule] failed to download update, check network") diff --git a/scripts/main.py b/scripts/main.py index 7ed2d38..f5b1e02 100644 --- a/scripts/main.py +++ b/scripts/main.py @@ -50,10 +50,14 @@ def started(demo, app: FastAPI): def update_app(): - git = os.environ.get('GIT', "git") - # print(scripts.basedir) - run(f'"{git}" -C "' + os.path.join(scripts.basedir(), usefulDirs[0], usefulDirs[1]) + - '" submodule update --init --recursive --remote', live=True) + try: + git = os.environ.get('GIT', "git") + # print(scripts.basedir) + run(f'"{git}" -C "' + os.path.join(scripts.basedir(), usefulDirs[0], usefulDirs[1]) + + '" submodule update --init --recursive --remote', live=True) + except: + # TODO: find exception type + print(f"[openOutpaint-extension-submodule] failed to download update, check network") def add_tab():