From 829587b67d5be107bd44cfcb0c24e3bdddf0fc21 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Fri, 24 Jun 2022 23:19:00 +0200 Subject: Tiny fixes. (cherry picked from commit 2cb36a37f5efa1185ba4c61ea65b49aa6e9345a0) --- pyGHDL/dom/_Utils.py | 4 ++-- pyGHDL/libghdl/libraries.py | 13 ++++++++----- pyGHDL/libghdl/vhdl/std_package.py | 18 +++++++++++++++--- 3 files changed, 25 insertions(+), 10 deletions(-) (limited to 'pyGHDL') diff --git a/pyGHDL/dom/_Utils.py b/pyGHDL/dom/_Utils.py index 3b647013b..d8cd9a15c 100644 --- a/pyGHDL/dom/_Utils.py +++ b/pyGHDL/dom/_Utils.py @@ -109,5 +109,5 @@ def GetModeOfNode(node: Iir) -> Mode: try: return __MODE_TRANSLATION[nodes.Get_Mode(node)] - except KeyError: - raise LibGHDLException("Unknown mode.") + except KeyError as ex: + raise DOMException(f"Unknown mode '{ex.args[0]}'.") from ex diff --git a/pyGHDL/libghdl/libraries.py b/pyGHDL/libghdl/libraries.py index fe09fa920..f31d3ec5f 100644 --- a/pyGHDL/libghdl/libraries.py +++ b/pyGHDL/libghdl/libraries.py @@ -50,15 +50,18 @@ __all__ = ["Library_Location", "Work_Library"] Library_Location: LocationType = c_int32.in_dll(libghdl, "libraries__library_location") """ -A location for library declarations (such as library WORK). Use ``.value`` to -access this variable inside libghdl. +A location for library declarations (such as library WORK). + +Use the property ``.value`` to access the variable's value. """ Work_Library: Iir_Library_Declaration = c_int32.in_dll(libghdl, "libraries__work_library") """ -Library declaration for the work library. Note: the identifier of the work_library -is ``work_library_name``, which may be different from 'WORK'. Use ``.value`` to -access this variable inside libghdl. +Library declaration for the work library. + +.. note:: The identifier of the work_library is ``work_library_name``, which may be different from 'WORK'. + +Use the property ``.value`` to access the variable's value. """ diff --git a/pyGHDL/libghdl/vhdl/std_package.py b/pyGHDL/libghdl/vhdl/std_package.py index f2c46385a..d9035779c 100644 --- a/pyGHDL/libghdl/vhdl/std_package.py +++ b/pyGHDL/libghdl/vhdl/std_package.py @@ -46,12 +46,24 @@ __all__ = ["Std_Location", "Standard_Package", "Character_Type_Definition"] Std_Location: LocationType = c_int32.in_dll(libghdl, "vhdl__std_package__std_location") -"""Virtual location for the ``std.standard`` package. Use ``.value`` to access this variable inside libghdl.""" +""" +Virtual location for the ``std.standard`` package. + +Use the property ``.value`` to access the variable's value. +""" Standard_Package: Iir_Package_Declaration = c_int32.in_dll(libghdl, "vhdl__std_package__standard_package") -"""Virtual package ``std.package``. Use ``.value`` to access this variable inside libghdl.""" +""" +Virtual package ``std.package``. + +Use the property ``.value`` to access the variable's value. +""" Character_Type_Definition: Iir_Enumeration_Type_Definition = c_int32.in_dll( libghdl, "vhdl__std_package__character_type_definition" ) -"""Predefined character. Use ``.value`` to access this variable inside libghdl.""" +""" +Predefined character. + +Use the property ``.value`` to access the variable's value. +""" -- cgit v1.2.3