From 4ef913098d7a43f00964dbbf769e50b3e8206b9d Mon Sep 17 00:00:00 2001 From: alex Date: Sat, 7 Oct 2023 23:45:58 +0200 Subject: [PATCH] check if template file exists --- main.py | 6 ++++++ template.lbrn | 59 ++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 50 insertions(+), 15 deletions(-) diff --git a/main.py b/main.py index ba75064..bdf0f76 100644 --- a/main.py +++ b/main.py @@ -8,6 +8,12 @@ base_path = os.path.dirname(os.path.abspath(__file__)) input_path = base_path + '/inputs/' output_path = base_path + '/outputs/' +# check if template file exists + +if not os.path.exists('./template.lbrn'): + print("Template file not found! Please create a template.lbrn file") + exit() + # read template file with open('./template.lbrn', 'r') as file: diff --git a/template.lbrn b/template.lbrn index 1261923..95faad9 100644 --- a/template.lbrn +++ b/template.lbrn @@ -1,5 +1,5 @@ - + @@ -32,7 +32,7 @@ - + @@ -48,7 +48,7 @@ - + @@ -61,26 +61,55 @@ 1 3.25841e-07 -3.25841e-07 1 289.157 257.016 - + 1 3.25841e-07 -3.25841e-07 1 344.555 154.108 - V-85 -103.09998c0x-85c0y-105.30911c1x1V-81 -107.09998c0x1c1x-83.209137c1y-107.09998V81 -107.09998c0x83.209137c0y-107.09998c1x1V85 -103.09998c0x1c1x85c1y-105.30911V85 89.31266c0x1c1x1 - B0 1L1 2B2 3L3 4 + + + + + +

+

+

+

- + 1 3.25841e-07 -3.25841e-07 1 344.555 154.108 - V85 89.31266c0x85c0y91.353905c1x1V81.433792 93.28907c0x1c1x83.462997c1y93.067703V60.866211 95.532799c0x58.837002c0y95.754166c1x1V57.299999 99.509209c0x1c1x57.299999c1y97.467964V57.299999 106.09998c0x1c1x1 + + + + + +

+

+

+

- + 1 3.25841e-07 -3.25841e-07 1 344.555 154.108 - V57.299999 106.09998c0x1c1x1V56.299999 107.09998c0x1c1x1V-56.299999 107.09998c0x1c1x1V-57.299999 106.09998c0x1c1x1V-57.299999 99.509209c0x-57.299999c0y97.467964c1x1V-60.866211 95.532799c0x1c1x-58.837002c1y95.754166V-81.433792 93.28907c0x-83.462997c0y93.067703c1x1V-85 89.31266c0x1c1x-85c1y91.353905 - L0 1L1 2L2 3L3 4B4 5L5 6B6 7 + + + + + + + + +

+

+

+

+

+

+

- + 1 3.25841e-07 -3.25841e-07 1 344.555 154.108 - V-85 89.31266c0x1c1x1V-85 -103.09998c0x1c1x1 - L0 1 + + +

- + 0.476578 0 0 0.476578 344.555 154.115