mirror of
https://github.com/weechat/weechat.git
synced 2026-07-02 15:53:12 +02:00
doc: fix pylint errors
This commit is contained in:
+2
-1
@@ -487,7 +487,8 @@ class AutogenDoc():
|
||||
f'autogen_{name}.{self.locale[:2]}.adoc',
|
||||
)
|
||||
self.filename_tmp = f'{self.filename}.tmp'
|
||||
self._file = open(self.filename_tmp, 'w')
|
||||
# pylint: disable=consider-using-with
|
||||
self._file = open(self.filename_tmp, 'w', encoding='utf-8')
|
||||
|
||||
def write_autogen_files(self, weechat_doc):
|
||||
"""Write auto-generated files."""
|
||||
|
||||
+4
-2
@@ -56,7 +56,8 @@ def print_stub_constants() -> None:
|
||||
"string": "str",
|
||||
}
|
||||
constant_pattern = re.compile(CONSTANT_RE)
|
||||
with open(DOC_DIR / "weechat_scripting.en.adoc") as scripting_file:
|
||||
with open(DOC_DIR / "weechat_scripting.en.adoc",
|
||||
encoding="utf-8") as scripting_file:
|
||||
scripting = scripting_file.read()
|
||||
for match in constant_pattern.finditer(scripting):
|
||||
print(f'{match["constant"]}: {types[match["type"]]}')
|
||||
@@ -65,7 +66,8 @@ def print_stub_constants() -> None:
|
||||
def print_stub_functions() -> None:
|
||||
"""Print function prototypes, extracted from the Plugin API reference."""
|
||||
function_pattern = re.compile(FUNCTION_RE, re.DOTALL)
|
||||
with open(DOC_DIR / "weechat_plugin_api.en.adoc") as api_doc_file:
|
||||
with open(DOC_DIR / "weechat_plugin_api.en.adoc",
|
||||
encoding="utf-8") as api_doc_file:
|
||||
api_doc = api_doc_file.read()
|
||||
for match in function_pattern.finditer(api_doc):
|
||||
url = f'https://weechat.org/doc/api/#_{match["function"]}'
|
||||
|
||||
Reference in New Issue
Block a user