aboutsummaryrefslogtreecommitdiffstats
path: root/pyGHDL/libghdl/errorout_memory.py
diff options
context:
space:
mode:
authorXiretza <xiretza@xiretza.xyz>2021-02-10 19:17:23 +0100
committertgingold <tgingold@users.noreply.github.com>2021-02-10 21:36:22 +0100
commitd52693df5bc7480c3917b7248f8602f2942aeab7 (patch)
tree6404e02d6f053a6b53c561c6b60a6a54152a9e63 /pyGHDL/libghdl/errorout_memory.py
parent8f563f9df8ad94e44f1bd8eecd91d5611e507cc7 (diff)
downloadghdl-d52693df5bc7480c3917b7248f8602f2942aeab7.tar.gz
ghdl-d52693df5bc7480c3917b7248f8602f2942aeab7.tar.bz2
ghdl-d52693df5bc7480c3917b7248f8602f2942aeab7.zip
pyGHDL: format using black
Diffstat (limited to 'pyGHDL/libghdl/errorout_memory.py')
-rw-r--r--pyGHDL/libghdl/errorout_memory.py101
1 files changed, 51 insertions, 50 deletions
diff --git a/pyGHDL/libghdl/errorout_memory.py b/pyGHDL/libghdl/errorout_memory.py
index 26152a9de..d4cbaeed9 100644
--- a/pyGHDL/libghdl/errorout_memory.py
+++ b/pyGHDL/libghdl/errorout_memory.py
@@ -42,34 +42,35 @@ from pyGHDL.libghdl._types import ErrorIndex
@export
class Error_Message(Structure):
- """
- Id : Msgid_Type
- Message error/warning id
+ """
+ Id : Msgid_Type
+ Message error/warning id
- Group : Group_Type;
- Whether this is an single message or a related one.
+ Group : Group_Type;
+ Whether this is an single message or a related one.
- File : Source_File_Entry;
- Error soure file.
+ File : Source_File_Entry;
+ Error soure file.
- Line : Natural;
- The first line is line 1, 0 can be used when line number is not relevant.
+ Line : Natural;
+ The first line is line 1, 0 can be used when line number is not relevant.
- Offset : Natural;
- Offset in the line. The first character is at offset 0.
+ Offset : Natural;
+ Offset in the line. The first character is at offset 0.
- Length : Natural;
- Length of the location (for a range). It is assumed to be on the same line;
- use 0 when unknown.
- """
- _fields_ = [
- ("id", c_int8),
- ("group", c_int8),
- ("file", c_int32),
- ("line", c_int32),
- ("offset", c_int32),
- ("length", c_int32),
- ]
+ Length : Natural;
+ Length of the location (for a range). It is assumed to be on the same line;
+ use 0 when unknown.
+ """
+
+ _fields_ = [
+ ("id", c_int8),
+ ("group", c_int8),
+ ("file", c_int32),
+ ("line", c_int32),
+ ("offset", c_int32),
+ ("length", c_int32),
+ ]
# Values for group:
@@ -81,51 +82,51 @@ Msg_Last = 3
@export
def Install_Handler() -> None:
- """Install the handlers for reporting errors."""
- libghdl.errorout__memory__install_handler()
+ """Install the handlers for reporting errors."""
+ libghdl.errorout__memory__install_handler()
@export
def Get_Nbr_Messages() -> ErrorIndex:
- """
- Get number of error messages available.
+ """
+ Get number of error messages available.
- :return: Number of messages available.
- """
- return libghdl.errorout__memory__get_nbr_messages()
+ :return: Number of messages available.
+ """
+ return libghdl.errorout__memory__get_nbr_messages()
@export
def Get_Error_Record(Idx: ErrorIndex) -> Error_Message:
- """
- Get error messages by index :obj:`Idy` as structure :class:`Error_Message`.
+ """
+ Get error messages by index :obj:`Idy` as structure :class:`Error_Message`.
- :param Idx: Index from 1 to ``Nbr_Messages`` See :func:`Get_Nbr_Messages`.
- :return: Type: ``Error_Message``
- """
- func = libghdl.errorout__memory__get_error_record
- func.argstypes = [c_int32]
- func.restype = Error_Message
+ :param Idx: Index from 1 to ``Nbr_Messages`` See :func:`Get_Nbr_Messages`.
+ :return: Type: ``Error_Message``
+ """
+ func = libghdl.errorout__memory__get_error_record
+ func.argstypes = [c_int32]
+ func.restype = Error_Message
- return func(Idx)
+ return func(Idx)
@export
def Get_Error_Message(Idx: ErrorIndex) -> str:
- """
- Get error messages by index :obj:`Idy` as string.
+ """
+ Get error messages by index :obj:`Idy` as string.
- :param Idx: Index from 1 to ``Nbr_Messages`` See :func:`Get_Nbr_Messages`.
- :return: Type: ``Error_Message``
- """
- func = libghdl.errorout__memory__get_error_message_addr
- func.argstype = [c_int32]
- func.restype = c_char_p
+ :param Idx: Index from 1 to ``Nbr_Messages`` See :func:`Get_Nbr_Messages`.
+ :return: Type: ``Error_Message``
+ """
+ func = libghdl.errorout__memory__get_error_message_addr
+ func.argstype = [c_int32]
+ func.restype = c_char_p
- return func(Idx).decode("utf-8")
+ return func(Idx).decode("utf-8")
@export
def Clear_Errors() -> None:
- """Remove all error messages."""
- libghdl.errorout__memory__clear_errors()
+ """Remove all error messages."""
+ libghdl.errorout__memory__clear_errors()