aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorumarcor <unai.martinezcorral@ehu.eus>2021-06-22 19:31:18 +0200
committerumarcor <unai.martinezcorral@ehu.eus>2021-06-23 17:09:44 +0200
commit6e1bbc43fc29528ceaf5d422461206e29e801744 (patch)
treea3273f25e220b2c69869c4c8376f31e8229dbcda /scripts
parentc6283d9a9b40c3e9afeba912fcb13aa9d56b9c52 (diff)
downloadghdl-6e1bbc43fc29528ceaf5d422461206e29e801744.tar.gz
ghdl-6e1bbc43fc29528ceaf5d422461206e29e801744.tar.bz2
ghdl-6e1bbc43fc29528ceaf5d422461206e29e801744.zip
fix more codacy issues
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/pnodes.py2
-rwxr-xr-xscripts/pnodespy.py15
2 files changed, 8 insertions, 9 deletions
diff --git a/scripts/pnodes.py b/scripts/pnodes.py
index 94adb01fd..f260c4b1a 100755
--- a/scripts/pnodes.py
+++ b/scripts/pnodes.py
@@ -473,7 +473,7 @@ def gen_choices(choices):
print(" =>")
-def gen_get_format(formats, nodes, kinds):
+def gen_get_format(formats, nodes, kinds=None):
"""Generate the Get_Format function."""
print(" function Get_Format (Kind : " + type_name + ") " + "return Format_Type is")
print(" begin")
diff --git a/scripts/pnodespy.py b/scripts/pnodespy.py
index f443d36c5..1f016a82d 100755
--- a/scripts/pnodespy.py
+++ b/scripts/pnodespy.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
-"""Like pnodes but output for Python"""
+"""Like pnodes but output for Python."""
from __future__ import print_function
@@ -65,7 +65,7 @@ def do_iirs_subprg():
@export
@BindToLibGHDL("{classname}__get_kind")
def Get_Kind(node: Iir) -> IirKind:
- \"\"\"Get node kind\"\"\"
+ \"\"\"Get node kind.\"\"\"
@export
@BindToLibGHDL("{classname}__get_location")
@@ -84,13 +84,13 @@ def do_iirs_subprg():
@export
@BindToLibGHDL("{classname}__get_{kname_lower}")
def Get_{kname}(obj: Iir) -> {rtype}:
- \"\"\"{gettercomment}\"\"\"
+ \"\"\"\"\"\"
@export
@BindToLibGHDL("{classname}__set_{kname_lower}")
def Set_{kname}(obj: Iir, value: {rtype}) -> None:
- \"\"\"{settercomment}\"\"\"
+ \"\"\"\"\"\"
""").format(kname=k.name, kname_lower=k.name.lower(), rtype=rtype,
- libname=libname, classname=classname, gettercomment="", settercomment="")
+ libname=libname, classname=classname)
)
@@ -191,7 +191,6 @@ def do_libghdl_nodes():
print(dedent("""\
from typing import TypeVar
from ctypes import c_int32
- from pyGHDL.libghdl import libghdl
from pyGHDL.libghdl._types import (
Iir,
IirKind,
@@ -334,7 +333,7 @@ def do_libghdl_names():
val_max = max(val_max, val)
dict[name_def] = val
res.append((name_def, val))
- print_file_header(includeBindToLibGHDL=False)
+ print_file_header(includeIntEnumUnique=False, includeBindToLibGHDL=False)
print(dedent("""
@export
@@ -350,7 +349,7 @@ def do_libghdl_names():
def do_libghdl_tokens():
- print_file_header()
+ print_file_header(includeBindToLibGHDL=False)
read_enum("vhdl-tokens.ads", "Token_Type", "Tok_", "Tok")