From 30e4777956513daeba0f55cef50de4881d0bb2f1 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 7 Dec 2021 10:21:08 +0100 Subject: Documentation: Remove the snippets copy step This is no longer necessary since the snippets have been removed from the repository. Generate them directly into the build directory. Pick-to: 6.2 Task-number: PYSIDE-1721 Change-Id: I0a4d9bc3c466b689fa28a982f608104cc5936570 Reviewed-by: Cristian Maureira-Fredes --- tools/snippets_translate/main.py | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'tools/snippets_translate') diff --git a/tools/snippets_translate/main.py b/tools/snippets_translate/main.py index d279392d4..a0a4663a0 100644 --- a/tools/snippets_translate/main.py +++ b/tools/snippets_translate/main.py @@ -73,7 +73,6 @@ log = logging.getLogger("snippets_translate") # Filter and paths configuration SKIP_END = (".pro", ".pri", ".cmake", ".qdoc", ".yaml", ".frag", ".qsb", ".vert", "CMakeLists.txt") SKIP_BEGIN = ("changes-", ".") -OUT_MAIN = Path("sources/pyside6/doc/codesnippets/") SNIPPET_PATTERN = re.compile(r"//! \[([^]]+)\]") @@ -94,11 +93,11 @@ def get_parser(): ) parser.add_argument( - "--pyside", + "--target", action="store", - dest="pyside_dir", + dest="target_dir", required=True, - help="Path to the pyside-setup directory", + help="Directory into which to generate the snippets", ) parser.add_argument( @@ -155,7 +154,7 @@ def check_arguments(options): if options.write_files: if not opt_quiet: log.warning( - f"Files will be copied from '{options.qt_dir}':\n" f"\tto '{options.pyside_dir}'" + f"Files will be copied from '{options.qt_dir}':\n" f"\tto '{options.target_dir}'" ) else: msg = "This is a listing only, files are not being copied" @@ -164,11 +163,8 @@ def check_arguments(options): if not opt_quiet: log.info(msg, extra=extra) - # Check 'qt_dir' and 'pyside_dir' - if is_directory(options.qt_dir) and is_directory(options.pyside_dir): - return True - - return False + # Check 'qt_dir' + return is_directory(options.qt_dir) def is_valid_file(x): @@ -341,8 +337,7 @@ def copy_file(file_path, qt_path, out_path, write=False, debug=False): def process(options): qt_path = Path(options.qt_dir) - py_path = Path(options.pyside_dir) - out_path = py_path / OUT_MAIN + out_path = Path(options.target_dir) # (new, exists) valid_new, valid_exists = 0, 0 -- cgit v1.2.3