From: Collin Funk <collin.funk1@gmail.com>
Date: Sun, 21 Apr 2024 02:47:28 +0000 (-0700)
Subject: gnulib-tool.py: Update type hints and docstring.
X-Git-Tag: v1.0~22
X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=83ce09b8b1d245841ff9248d4e970a8c37d397be;p=gnulib.git

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.
---

diff --git a/ChangeLog b/ChangeLog
index 4bb812ef1a..930743d67d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-04-21  Collin Funk  <collin.funk1@gmail.com>
+
+	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  <bruno@clisp.org>
 
 	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 @@ AC_DEFUN([%s_FILE_LIST], [\n''' % macro_prefix
                 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 @@ AC_DEFUN([%s_FILE_LIST], [\n''' % macro_prefix
         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.'''