File tree Expand file tree Collapse file tree 4 files changed +20
-19
lines changed
Expand file tree Collapse file tree 4 files changed +20
-19
lines changed Original file line number Diff line number Diff line change 1- #!/usr/bin/env python
2- # coding:utf-8
3- # Author: mozman -- <[email protected] > 41# Purpose: build header var tables
5- # Created: 12.03.2011
6- # Copyright (C) 2011, Manfred Moitzi
2+ # Copyright (C) 2011-2022, Manfred Moitzi
73# License: MIT License
84from collections import OrderedDict
9- from pathlib import Path
5+ import ezdxf
106from ezdxf .lldxf .loader import load_dxf_structure
117
128TABLEPRELUDE = """# auto-generated by buildheadertables.py - do not edit
2824 "DXF2013" ,
2925 "DXF2018" ,
3026]
31- TEMPLATES = Path ( r"D:\Source\dxftest\ templates")
27+ TEMPLATES = ezdxf . options . test_files_path / " templates"
3228
3329
3430def write_table (filename , vars ):
Original file line number Diff line number Diff line change 1- from pathlib import Path
1+ # Copyright (c) 2022, Manfred Moitzi
2+ # License: MIT License
3+ import pathlib
24import logging
35import ezdxf
46from ezdxf .proxygraphic import ProxyGraphicDebugger
57
68ezdxf .options .load_proxy_graphics = True
79
8- OUTBOX = Path ("~/Desktop/Outbox" ).expanduser ()
9- logging .basicConfig (filename = OUTBOX / "ezdxf-log.txt" , level = "DEBUG" )
10+ CWD = pathlib .Path ("~/Desktop/Outbox" ).expanduser ()
11+ if not CWD .exists ():
12+ CWD = pathlib .Path ("." )
13+
14+ logging .basicConfig (filename = CWD / "ezdxf-log.txt" , level = "DEBUG" )
1015logger = logging .getLogger ("ezdxf" )
1116
12- EXAMPLE = Path ( ezdxf .EZDXF_TEST_FILES ) / "mleader" / "mbway-mleader.dxf"
17+ EXAMPLE = ezdxf .options . test_files_path / "mleader" / "mbway-mleader.dxf"
1318
1419doc = ezdxf .readfile (EXAMPLE )
1520mleader = doc .entitydb ["403" ]
16- with open (OUTBOX / "proxy-debug.txt" , mode = "wt" ) as stream :
21+ with open (CWD / "proxy-debug.txt" , mode = "wt" ) as stream :
1722 proxy = ProxyGraphicDebugger (
1823 mleader .proxy_graphic , doc , debug_stream = stream
1924 )
Original file line number Diff line number Diff line change 11# Copyright (c) 2019-2022, Manfred Moitzi
22# License: MIT License
3- from pathlib import Path
3+ import pathlib
44import ezdxf
55from ezdxf import colors
66from ezdxf .addons .drawing .matplotlib import qsave
77
8- DIR = Path ("~/Desktop/Outbox" ).expanduser ()
9- if not DIR .exists ():
10- DIR = Path ("." )
8+ CWD = pathlib . Path ("~/Desktop/Outbox" ).expanduser ()
9+ if not CWD .exists ():
10+ CWD = pathlib . Path ("." )
1111
1212
1313def main ():
@@ -41,7 +41,7 @@ def add_connection_point(p):
4141 add_connection_point (cp1 )
4242 qsave (
4343 msp ,
44- str (DIR / f"{ ezdxf .ARROWS .block_name (name )} .png" ),
44+ str (CWD / f"{ ezdxf .ARROWS .block_name (name )} .png" ),
4545 bg = "#FFFFFF" ,
4646 dpi = 100 ,
4747 size_inches = (3 , 1 ),
Original file line number Diff line number Diff line change 1- # Copyright (c) 2018-2020 Manfred Moitzi
1+ # Copyright (c) 2018-2022 Manfred Moitzi
22# License: MIT License
33
44import ezdxf
@@ -40,4 +40,4 @@ def process_dir(folder: Path):
4040 print ("*" * 40 + "\n " )
4141
4242
43- process_dir (Path ( ezdxf .EZDXF_TEST_FILES ) )
43+ process_dir (ezdxf .options . test_files_path )
You can’t perform that action at this time.
0 commit comments