From 969ae9d41a633b0532c7daeab4601baf323b68dc Mon Sep 17 00:00:00 2001 From: Thomas Holder Date: Fri, 29 Nov 2024 18:17:47 +0100 Subject: [PATCH] th2_output: order -orientation before -align --- extensions/th2ex.py | 2 ++ tests/test_th2ex.py | 1 + 2 files changed, 3 insertions(+) diff --git a/extensions/th2ex.py b/extensions/th2ex.py index c6637fc..16f1168 100644 --- a/extensions/th2ex.py +++ b/extensions/th2ex.py @@ -421,6 +421,8 @@ def key_options_item(item: Tuple[str, OptionValue]) -> tuple: return '0' + item[0], item[1] if item[0] == 'close': return '1' + item[0], item[1] + if item[0] == 'orientation': # point + return '1' + item[0], item[1] if item[0] == 'projection': # scrap return '1' + item[0], item[1] return item diff --git a/tests/test_th2ex.py b/tests/test_th2ex.py index dbde0ce..66acc60 100644 --- a/tests/test_th2ex.py +++ b/tests/test_th2ex.py @@ -124,6 +124,7 @@ def test_format_options(): assert th2ex.format_options({'author': ["2000 Max"]}) == '-author 2000 Max' assert th2ex.format_options({'author': [("2000 Max")]}) == '-author 2000 Max' assert th2ex.format_options({'author': [("2000", "Max Foo"), ("2000", "Jane Bar")]}) == '-author 2000 "Max Foo" -author 2000 "Jane Bar"' + assert m.format_options(m.parse_options('-align b -orientation 25.723')) == '-orientation 25.723 -align b' def test_name_survex2therion():