From d5af4f67f4e23e31a94abc419e15e8d610f635c7 Mon Sep 17 00:00:00 2001 From: MariannaGerina Date: Mon, 22 Jan 2024 23:27:14 +0100 Subject: [PATCH 1/3] Quote file names in ConvertUI --- src/sas/qtgui/convertUI.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sas/qtgui/convertUI.py b/src/sas/qtgui/convertUI.py index b15fd593f3..3a53cf6f63 100644 --- a/src/sas/qtgui/convertUI.py +++ b/src/sas/qtgui/convertUI.py @@ -24,7 +24,7 @@ def pyrrc(in_file, out_file): """ Run the qt resource compiler """ - run_line = f"pyside6-rcc {in_file} -o {out_file}" + run_line = f'pyside6-rcc "{in_file}" -o "{out_file}"' os.system(run_line) @@ -34,7 +34,7 @@ def pyuic(in_file, out_file): """ in_file2 = os.path.abspath(in_file) out_file2 = os.path.abspath(out_file) - run_line = "pyside6-uic " + in_file2 + " -o " + out_file2 + run_line = f'pyside6-uic "{in_file2}" -o "{out_file2}"' os.system(run_line) def file_in_newer(file_in, file_out): From 3f135e0f338b721d771e73be0bcd332bb234f622 Mon Sep 17 00:00:00 2001 From: Paul Butler Date: Thu, 15 Feb 2024 19:35:27 -0500 Subject: [PATCH 2/3] follow @llimeht recommendation (I think) to remove problems with special characters in file names. --- src/sas/qtgui/convertUI.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sas/qtgui/convertUI.py b/src/sas/qtgui/convertUI.py index 3a53cf6f63..f39deb23cc 100644 --- a/src/sas/qtgui/convertUI.py +++ b/src/sas/qtgui/convertUI.py @@ -24,8 +24,8 @@ def pyrrc(in_file, out_file): """ Run the qt resource compiler """ - run_line = f'pyside6-rcc "{in_file}" -o "{out_file}"' - os.system(run_line) + run_line = ["pyside6-rcc", in_file, "-o" ,out_file] + subprocess.run(run_line) def pyuic(in_file, out_file): @@ -34,8 +34,8 @@ def pyuic(in_file, out_file): """ in_file2 = os.path.abspath(in_file) out_file2 = os.path.abspath(out_file) - run_line = f'pyside6-uic "{in_file2}" -o "{out_file2}"' - os.system(run_line) + run_line = ["pyside6-uic", in_file2 "-o", out_file2] + subprocess.run(run_line) def file_in_newer(file_in, file_out): """ From 79f2594dbe6199917ab9e272f9ce2d3816caf2da Mon Sep 17 00:00:00 2001 From: Paul Butler Date: Tue, 20 Feb 2024 23:53:31 +0000 Subject: [PATCH 3/3] added check=true to capture errors as per @llimeht suggestion. --- src/sas/qtgui/convertUI.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sas/qtgui/convertUI.py b/src/sas/qtgui/convertUI.py index f39deb23cc..b5e64d6de1 100644 --- a/src/sas/qtgui/convertUI.py +++ b/src/sas/qtgui/convertUI.py @@ -25,7 +25,7 @@ def pyrrc(in_file, out_file): Run the qt resource compiler """ run_line = ["pyside6-rcc", in_file, "-o" ,out_file] - subprocess.run(run_line) + subprocess.run(run_line, check=True) def pyuic(in_file, out_file): @@ -35,7 +35,7 @@ def pyuic(in_file, out_file): in_file2 = os.path.abspath(in_file) out_file2 = os.path.abspath(out_file) run_line = ["pyside6-uic", in_file2 "-o", out_file2] - subprocess.run(run_line) + subprocess.run(run_line, check=True) def file_in_newer(file_in, file_out): """