From cfe904dfe204ffbec3029808f02c30f3981c9342 Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Fri, 13 Jan 2023 10:21:07 -0500 Subject: [PATCH] Allow execution of scripts even if lt package is not installed --- scripts/compile_locales.py | 1 + scripts/install_models.py | 3 +++ scripts/update_locales.py | 1 + 3 files changed, 5 insertions(+) diff --git a/scripts/compile_locales.py b/scripts/compile_locales.py index 9825237..5aff9af 100755 --- a/scripts/compile_locales.py +++ b/scripts/compile_locales.py @@ -1,6 +1,7 @@ #!/usr/bin/env python import sys import os +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) from babel.messages.frontend import main as pybabel if __name__ == "__main__": diff --git a/scripts/install_models.py b/scripts/install_models.py index 8fbae93..d844afb 100755 --- a/scripts/install_models.py +++ b/scripts/install_models.py @@ -1,4 +1,7 @@ #!/usr/bin/env python +import sys +import os +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) import argparse from libretranslate.init import check_and_install_models diff --git a/scripts/update_locales.py b/scripts/update_locales.py index 79dfb4e..1fd2853 100755 --- a/scripts/update_locales.py +++ b/scripts/update_locales.py @@ -1,6 +1,7 @@ #!/usr/bin/env python import sys import os +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) import re import polib import json