From 280a90479982ddd8de8342fc55a2f5044d378905 Mon Sep 17 00:00:00 2001 From: gudnimg Date: Sat, 10 Dec 2022 12:52:58 +0000 Subject: [PATCH] ubuntu: subprocess does not allow extended glob It's my understanding that we cannot use extended globbing on Linux because of the way I am invoking the lang-extract script. the python script is not run through bash/shell. We would need to perhaps use Shell = True in check_call() but then the all the input arguments needs to be one string. This commit was tested on Ubuntu 22.04.1 LTS --- lang/update-pot.py | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/lang/update-pot.py b/lang/update-pot.py index 13fda1167..4d8368c59 100644 --- a/lang/update-pot.py +++ b/lang/update-pot.py @@ -53,20 +53,14 @@ def main(): except ValueError as error: print(error) - # If operating system is Windows, then the script must expand - # the regex expression with glob. On Linux and Mac, the operating - # system takes care of expanding the glob for you. We only need to - # do this manually on Windows. - if sys.platform == "win32": - for pattern in SEARCH_PATHS: - for file in sorted(PO_DIR.glob(str(pattern))): - FILE_LIST.append(file) + # Extend the glob and append all found files into FILE_LIST + for pattern in SEARCH_PATHS: + for file in sorted(PO_DIR.glob(str(pattern))): + FILE_LIST.append(file) - # Convert the path to relative and use Posix format - for index, absolute_path in enumerate(FILE_LIST.copy()): - FILE_LIST[index] = PurePosixPath(absolute_path).relative_to(PO_DIR) - else: - FILE_LIST = SEARCH_PATHS + # Convert the path to relative and use Posix format + for index, absolute_path in enumerate(FILE_LIST.copy()): + FILE_LIST[index] = PurePosixPath(absolute_path).relative_to(PO_DIR) # Run the lang-extract.py script SCRIPT_PATH = BASE_DIR.joinpath("lang-extract.py")