aboutsummaryrefslogtreecommitdiffstats
path: root/pyGHDL/libghdl/files_map_editor.py
diff options
context:
space:
mode:
authorPatrick Lehmann <Patrick.Lehmann@plc2.de>2021-06-17 23:12:36 +0200
committerUnai Martinez-Corral <38422348+umarcor@users.noreply.github.com>2021-06-17 22:53:27 +0100
commit0c726ac36be1ad1cba24eb7eff476b9a32e643fb (patch)
tree524d81d4df412cca136b766305506574b34bf15e /pyGHDL/libghdl/files_map_editor.py
parente5891f3900f5e58df37d32c2c18a0f339c094cf4 (diff)
downloadghdl-0c726ac36be1ad1cba24eb7eff476b9a32e643fb.tar.gz
ghdl-0c726ac36be1ad1cba24eb7eff476b9a32e643fb.tar.bz2
ghdl-0c726ac36be1ad1cba24eb7eff476b9a32e643fb.zip
Black found more files - strange.
Executed black to make code unreadable. (cherry picked from commit 1b34c2368428b1ec295073ee47d201ac1def35f6)
Diffstat (limited to 'pyGHDL/libghdl/files_map_editor.py')
-rw-r--r--pyGHDL/libghdl/files_map_editor.py41
1 files changed, 33 insertions, 8 deletions
diff --git a/pyGHDL/libghdl/files_map_editor.py b/pyGHDL/libghdl/files_map_editor.py
index 1b1f86a01..eceb3efe2 100644
--- a/pyGHDL/libghdl/files_map_editor.py
+++ b/pyGHDL/libghdl/files_map_editor.py
@@ -41,9 +41,17 @@ from pyGHDL.libghdl._decorator import BindToLibGHDL
from pyGHDL.libghdl._types import SourceFileEntry
-#@export
+# @export
@BindToLibGHDL("files_map__editor__replace_text_ptr")
-def _Replace_Text(File: SourceFileEntry, Start_Line: int, Start_Offset: int, End_Line: int, End_Offset: int, Text_Pointer: c_char_p, Text_Length: int) -> bool:
+def _Replace_Text(
+ File: SourceFileEntry,
+ Start_Line: int,
+ Start_Offset: int,
+ End_Line: int,
+ End_Offset: int,
+ Text_Pointer: c_char_p,
+ Text_Length: int,
+) -> bool:
"""Replace [START; END) by TEXT.
:param File: File where to replace a text section.
@@ -58,8 +66,15 @@ def _Replace_Text(File: SourceFileEntry, Start_Line: int, Start_Offset: int, End
@export
-def Replace_Text(File: SourceFileEntry, Start_Line: int, Start_Offset: int, End_Line: int, End_Offset: int, Text: str) -> bool:
- """ Replace [START; END) by TEXT.
+def Replace_Text(
+ File: SourceFileEntry,
+ Start_Line: int,
+ Start_Offset: int,
+ End_Line: int,
+ End_Offset: int,
+ Text: str,
+) -> bool:
+ """Replace [START; END) by TEXT.
:param File: File where to replace a text section.
:param Start_Line: undocumented
@@ -70,11 +85,19 @@ def Replace_Text(File: SourceFileEntry, Start_Line: int, Start_Offset: int, End_
:return: Return True in case of success, False in case of failure (the gap is too small).
"""
buffer = Text.encode("utf-8")
- return _Replace_Text(File, Start_Line, Start_Offset, End_Line, End_Offset, c_char_p(buffer), len(buffer))
+ return _Replace_Text(
+ File,
+ Start_Line,
+ Start_Offset,
+ End_Line,
+ End_Offset,
+ c_char_p(buffer),
+ len(buffer),
+ )
@export
-#@BindToLibGHDL("files_map__editor__fill_text_ptr")
+# @BindToLibGHDL("files_map__editor__fill_text_ptr")
def Fill_Text(File: SourceFileEntry, Text_Pointer, Text_Length: int) -> None:
"""Replace the content of :obj:`File` with TEXT.
@@ -88,8 +111,10 @@ def Fill_Text(File: SourceFileEntry, Text_Pointer, Text_Length: int) -> None:
@export
-#@BindToLibGHDL("files_map__editor__check_buffer_content")
-def Check_Buffer_Content(File: SourceFileEntry, String_Pointer, String_Length: int) -> None:
+# @BindToLibGHDL("files_map__editor__check_buffer_content")
+def Check_Buffer_Content(
+ File: SourceFileEntry, String_Pointer, String_Length: int
+) -> None:
"""
Check that content of :obj:`File` is STR[1 .. STR_LEN].