diff options
author | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2021-06-22 18:17:05 +0200 |
---|---|---|
committer | umarcor <unai.martinezcorral@ehu.eus> | 2021-06-22 18:51:03 +0200 |
commit | 79d7e4f88b5ea170386628e3d2d00a1bd9634154 (patch) | |
tree | cbf1bf1b67c90f40a4630abbc109748b171a66fb | |
parent | ea27f434ff85455310193725cdb3d861522e20f0 (diff) | |
download | ghdl-79d7e4f88b5ea170386628e3d2d00a1bd9634154.tar.gz ghdl-79d7e4f88b5ea170386628e3d2d00a1bd9634154.tar.bz2 ghdl-79d7e4f88b5ea170386628e3d2d00a1bd9634154.zip |
scripts/pnodespy: cleaner print_file_header
-rw-r--r-- | pyGHDL/libghdl/vhdl/elocations.py | 1 | ||||
-rwxr-xr-x | scripts/pnodespy.py | 18 |
2 files changed, 5 insertions, 14 deletions
diff --git a/pyGHDL/libghdl/vhdl/elocations.py b/pyGHDL/libghdl/vhdl/elocations.py index 852b7cfea..dd3600ecf 100644 --- a/pyGHDL/libghdl/vhdl/elocations.py +++ b/pyGHDL/libghdl/vhdl/elocations.py @@ -2,6 +2,7 @@ # Call 'make' in 'src/vhdl' to regenerate: # from pydecor import export + from pyGHDL.libghdl import libghdl diff --git a/scripts/pnodespy.py b/scripts/pnodespy.py index 7860b2f30..e76869683 100755 --- a/scripts/pnodespy.py +++ b/scripts/pnodespy.py @@ -35,21 +35,11 @@ def print_file_header(includeIntEnumUnique=True, includeBindToLibGHDL=True): # Auto generated Python source file from Ada sources # Call 'make' in 'src/vhdl' to regenerate: # - """), end='' - ) - - if includeIntEnumUnique: - print("from enum import IntEnum, unique") - - print("from pydecor import export") - - if includeBindToLibGHDL: - print(dedent("""\ - - from pyGHDL.libghdl._decorator import BindToLibGHDL - - """), end='' + """) + "{sysImports}from pydecor import export\n{moduleImports}".format( + sysImports = "from enum import IntEnum, unique\n" if includeIntEnumUnique else "", + moduleImports = "\nfrom pyGHDL.libghdl._decorator import BindToLibGHDL\n" if includeBindToLibGHDL else "", ) + ) def do_class_kinds(): |