From 6e1bbc43fc29528ceaf5d422461206e29e801744 Mon Sep 17 00:00:00 2001 From: umarcor Date: Tue, 22 Jun 2021 19:31:18 +0200 Subject: fix more codacy issues --- scripts/pnodes.py | 2 +- scripts/pnodespy.py | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) (limited to 'scripts') 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") -- cgit v1.2.3