From f1b179f77fb64aed33f40cdd8ad3bd7a2c83ba8d Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Sat, 20 Apr 2024 19:47:28 -0700 Subject: [PATCH] gnulib-tool.py: Update type hints and docstring. * pygnulib/GLImport.py (GLImport.execute): Update transformer type hint to reflect change from sed expressions to re.sub() arguments. (GLImport.prepare): Likewise. Don't reference sed or license replacements in docstring. --- ChangeLog | 8 ++++++++ pygnulib/GLImport.py | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4bb812ef1a..2ede5219a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2024-04-20 Collin Funk + + gnulib-tool.py: Update type hints and docstring. + * pygnulib/GLImport.py (GLImport.execute): Update transformer type hint + to reflect change from sed expressions to re.sub() arguments. + (GLImport.prepare): Likewise. Don't reference sed or license + replacements in docstring. + 2024-04-20 Bruno Haible signed-snan: Relicense under LGPLv2+. diff --git a/pygnulib/GLImport.py b/pygnulib/GLImport.py index 0863ba530e..cc7648890d 100644 --- a/pygnulib/GLImport.py +++ b/pygnulib/GLImport.py @@ -805,9 +805,9 @@ def _update_ignorelist_(self, directory: str, ignore: str, files_added: list[str else: # if self.config['dryrun'] print('Create %s' % srcpath) - def prepare(self) -> tuple[dict[str, list[str]], dict[str, str]]: - '''Make all preparations before the execution of the code. - Returns filetable and sed transformers, which change the license.''' + def prepare(self) -> tuple[dict[str, list[str]], dict[str, tuple[re.Pattern, str] | None]]: + '''Perform preperations before GLImport.execute(). + Returns a filetable and the transformers passed to GLFileAssistant().''' destdir = self.config['destdir'] modules = list(self.config['modules']) m4base = self.config['m4base'] @@ -979,7 +979,7 @@ def prepare(self) -> tuple[dict[str, list[str]], dict[str, str]]: result = tuple([filetable, transformers]) return result - def execute(self, filetable: dict[str, list[str]], transformers: dict[str, str]) -> None: + def execute(self, filetable: dict[str, list[str]], transformers: dict[str, tuple[re.Pattern, str] | None]) -> None: '''Perform operations on the lists of files, which are given in a special format except filelist argument. Such lists of files can be created using GLImport.prepare() function.''' -- 2.44.0