]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: Update type hints and docstring.
authorCollin Funk <collin.funk1@gmail.com>
Sun, 21 Apr 2024 02:47:28 +0000 (19:47 -0700)
committerBruno Haible <bruno@clisp.org>
Sun, 21 Apr 2024 11:05:34 +0000 (13:05 +0200)
* 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
pygnulib/GLImport.py

index 4bb812ef1af88f979d4dbde6696d02b8e70fc5f5..930743d67db937e9064c714c16af7db3c7fcc1c4 100644 (file)
--- 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+.
index 0863ba530eeaa781bd3256a573595a01a12cc9e9..cc7648890dae39212591f16ec324cf1fb4162bea 100644 (file)
@@ -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.'''