aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Lehmann <Patrick.Lehmann@plc2.de>2021-06-22 18:17:05 +0200
committerumarcor <unai.martinezcorral@ehu.eus>2021-06-22 18:51:03 +0200
commit79d7e4f88b5ea170386628e3d2d00a1bd9634154 (patch)
treecbf1bf1b67c90f40a4630abbc109748b171a66fb
parentea27f434ff85455310193725cdb3d861522e20f0 (diff)
downloadghdl-79d7e4f88b5ea170386628e3d2d00a1bd9634154.tar.gz
ghdl-79d7e4f88b5ea170386628e3d2d00a1bd9634154.tar.bz2
ghdl-79d7e4f88b5ea170386628e3d2d00a1bd9634154.zip
scripts/pnodespy: cleaner print_file_header
-rw-r--r--pyGHDL/libghdl/vhdl/elocations.py1
-rwxr-xr-xscripts/pnodespy.py18
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():