From 0c5884349c2daf924579ce5f8a58494a349a578c Mon Sep 17 00:00:00 2001 From: david mueller Date: Wed, 22 Jul 2026 18:35:15 +0200 Subject: [PATCH] Gmoccapy: File extension tweaks - Fixes wrong INI key descriptor in warning message - Minor rewording of warning message - Adds option to exclude *.ngc files from file selection screen --- docs/src/gui/gmoccapy.adoc | 8 +++++++- src/emc/usr_intf/gmoccapy/getiniinfo.py | 9 ++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/docs/src/gui/gmoccapy.adoc b/docs/src/gui/gmoccapy.adoc index 25caed8e1bb..67cd9331bd3 100644 --- a/docs/src/gui/gmoccapy.adoc +++ b/docs/src/gui/gmoccapy.adoc @@ -1370,7 +1370,13 @@ To avoid that any program is loaded at start up, just press the None button. The file selection screen will use the filters you have set in the INI file, if there aren't any filters given, you will only see *NGC files*. -The path will be set according to the INI settings in `[DISPLAY] PROGRAM_PREFIX`. +The path will be set according to the INI settings in `[DISPLAY] PROGRAM_PREFIX`. + +NGC files can be explicitly excluded from the file selection screen by passing *no_ngc* instead of an extension: + +[source,ini] +---- +PROGRAM_EXTENSION = no_ngc Exclude ngc files from selection screen +---- .Jump to dir diff --git a/src/emc/usr_intf/gmoccapy/getiniinfo.py b/src/emc/usr_intf/gmoccapy/getiniinfo.py index 20be167976e..e9ec0965a84 100644 --- a/src/emc/usr_intf/gmoccapy/getiniinfo.py +++ b/src/emc/usr_intf/gmoccapy/getiniinfo.py @@ -343,10 +343,13 @@ def get_file_ext(self): raw_ext = data.split(",") for extension in raw_ext: ext = extension.split() - ext_list.append(ext[0].replace(".", "*.")) + if ext[0] == "no_ngc": + ext_list.remove("*.ngc") + else: + ext_list.append(ext[0].replace(".", "*.")) else: - LOG.warning("Error converting the file extensions from INI file [FILTER]PROGRAM_PREFIX, " - "using as default '*.ngc'") + LOG.warning("Error converting the file extensions from INI file [FILTER]PROGRAM_EXTENSION, " + "Using default '.ngc'") ext_list = ["*.ngc"] return ext_list