From 88cfe4a5a9ee0083a08ef7da8340c54453d16a87 Mon Sep 17 00:00:00 2001 From: Overlord360 <49475695+Overlord360@users.noreply.github.com> Date: Thu, 18 Jun 2026 12:44:10 +1000 Subject: [PATCH 1/4] add aliases for 'open' and 'quit' fxconfig commands --- src/fixate/core/config_util.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/fixate/core/config_util.py b/src/fixate/core/config_util.py index ea7b85d..747bfc4 100644 --- a/src/fixate/core/config_util.py +++ b/src/fixate/core/config_util.py @@ -347,6 +347,15 @@ def _test_config_dict(self, config_dict): self.pfeedback(f"{new_id} || {idn}") self._test_print_error(port, "ID query does not match") + def do_load(self, line): + """Alias for open command""" + self.do_open(line) + + def do_exit(self, line): + """Exit the application.""" + # cmd2 already has the 'quit' command built in, so this is mostly an alias. + return True + # Stolen from discover.py. This should probably get consolidated back there, # but I want to avoid messing with the internals for now. From 873269ba87973afbcc8462adc031c4c346b27911 Mon Sep 17 00:00:00 2001 From: Overlord360 <49475695+Overlord360@users.noreply.github.com> Date: Thu, 18 Jun 2026 12:46:11 +1000 Subject: [PATCH 2/4] update release notes --- docs/release-notes.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/release-notes.rst b/docs/release-notes.rst index 345d628..aa0a667 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -28,6 +28,7 @@ Improvements now be called after performing signal acquisition. - Invert channel and vtime functions implemented in the DSO driver. - Fxconfig fixes for cmd2 4.0.0 +- Added aliases for "quit" and "open" commands in fxconfig. ************* Version 0.6.4 From 5f9bce8dea166e7348935fe96b116203c1ee3147 Mon Sep 17 00:00:00 2001 From: Overlord360 <49475695+Overlord360@users.noreply.github.com> Date: Thu, 18 Jun 2026 13:06:25 +1000 Subject: [PATCH 3/4] update tests to cover the new command --- test/core/test_config_util.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/test/core/test_config_util.py b/test/core/test_config_util.py index d369019..1571816 100644 --- a/test/core/test_config_util.py +++ b/test/core/test_config_util.py @@ -32,6 +32,10 @@ def test_open_fxconfig_no_file(test_app, monkeypatch): test_app.do_open("") assert test_app.config_file_path is None assert test_app.updated_config_dict is None + # ensure the alias also works. + test_app.do_load("") + assert test_app.config_file_path is None + assert test_app.updated_config_dict is None def test_new_config_file_default(test_app, monkeypatch, tmp_path): @@ -83,6 +87,32 @@ def test_open_fxconfig(test_app): } +def test_load_fxconfig(test_app): + test_app.do_load("test/config/instruments.json") + assert test_app.config_file_path == "test/config/instruments.json" + assert test_app.updated_config_dict == { + "INSTRUMENTS": { + "visa": [ + [ + "RIGOL TECHNOLOGIES,DG1022 ,DG1D144904270,,00.03.00.09.00.02.11\n", + "USB0::0x09C4::0x0400::DG1D144904270::INSTR", + ], + ["FLUKE,8846A,3821015,08/02/10-11:53\r\n", "ASRL38::INSTR"], + [ + "AGILENT TECHNOLOGIES,MSO-X 3014A,MY52160892,02.41.2015102200", + "USB0::0x0957::0x17A8::MY52160892::INSTR", + ], + ], + "serial": { + "COM37": [ + "address: 0,checksum: 28,command: 49,model: 6823,serial_number: 3697210019,software_version: 29440,start: 170,", + 9600, + ] + }, + } + } + + # testing the _add_visa_to_config method directly since there is too much reliance on the ResourceManager # which would need to be monkeypatched or mocked. def test_add_visa_to_config_duplicate(test_app, open_config_file): From fcf5155c9e089d67de670a4cf69e915fac4c33f8 Mon Sep 17 00:00:00 2001 From: Overlord360 <49475695+Overlord360@users.noreply.github.com> Date: Thu, 18 Jun 2026 13:45:12 +1000 Subject: [PATCH 4/4] add test for exit command --- test/core/test_config_util.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/core/test_config_util.py b/test/core/test_config_util.py index 1571816..f06a485 100644 --- a/test/core/test_config_util.py +++ b/test/core/test_config_util.py @@ -166,3 +166,7 @@ def test_do_save_same_path_backup_created(test_app, open_config_file, tmp_path): test_app.do_save(tmp_path / "instruments.json") # ensure backup file is created assert (tmp_path / "instruments.json.bak").exists() + + +def test_do_exit(test_app): + assert test_app.do_exit("") is True