Alle Programme so weit angepasst, dass Programmkette läuft.

This commit is contained in:
2025-05-20 15:34:29 +02:00
parent a48c39018c
commit bf6cb53c2e
6 changed files with 6764 additions and 15624 deletions
+5 -5
View File
@@ -84,14 +84,14 @@ def check_file_in_work(work_dir, filename):
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='draws a dxf file with the given cable coordinates', prog='drawdxf')
parser.add_argument('-j', '--jsonfile', action='store', required=True, help='this json file contains all cables and its coordinates which should be drawn. Saved with an unique timestamp', metavar='myfile.json')
parser.add_argument('-f', '--filename', action='store', required=True, help='this json file contains all cables and its coordinates which should be drawn. Saved with an unique timestamp', metavar='myfile.json')
parser.add_argument('-d', '--dxf', action='store', help='this dxf drawing will be copied and the new layer with the cables will be added', metavar='myfile.dxf')
parser.add_argument('-n', '--new', action='store_true', help='create a new dxf file with cables in it. Name is basename and a timtestamp')
parser.add_argument('-n', '--new', action='store', help='create a new dxf file with cables in it. Name is basename and a timtestamp')
args = parser.parse_args()
work_dir = os.fspath(os.environ.get('PROJECT_WORK'))
jfile = args.jsonfile
jfile = args.filename
(json_path, jexists) = check_file_in_work(work_dir, jfile)
if not jexists:
print("file %s does not exit", jfile)
@@ -112,8 +112,8 @@ if __name__ == '__main__':
# erzeuge eine neue dxf Datei mit aktuellen Zeitstempel im Namen
#basename = os.path.splitext(dxf_path)[0]
#timestamp = datetime.now().strftime(basename+"_%Y%m%d-%H%M%S.dxf")
timestamp = datetime.now().strftime("%Y%m%d-%H%M%S.dxf")
out_path = os.path.join(work_dir, timestamp)
#timestamp = datetime.now().strftime("%Y%m%d-%H%M%S.dxf")
out_path = os.path.join(work_dir, args.new)
res_pos = new_dxf(json_path, out_path)