From: Collin Funk Date: Wed, 29 May 2024 06:26:19 +0000 (-0700) Subject: gnulib-tool.py: Add missing docstring. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=001302d065dd00a90f33a296bd613c1a93b197bb;p=gnulib.git gnulib-tool.py: Add missing docstring. * pygnulib/GLModuleSystem.py (GLModule.getShellId): Add docstring forgotten in the previous commit. --- diff --git a/ChangeLog b/ChangeLog index 9be0407793..9c22b7fb38 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2024-05-28 Collin Funk + gnulib-tool.py: Add missing docstring. + * pygnulib/GLModuleSystem.py (GLModule.getShellId): Add docstring + forgotten in the previous commit. + gnulib-tool.py: Simplify creation of module shell ids. * pygnulib/GLModuleSystem.py (GLModule.shell_id_chars): Remove class variable. diff --git a/pygnulib/GLModuleSystem.py b/pygnulib/GLModuleSystem.py index 63d4f4a73e..f1774f64fc 100644 --- a/pygnulib/GLModuleSystem.py +++ b/pygnulib/GLModuleSystem.py @@ -379,8 +379,11 @@ class GLModule: return lines_to_multiline(directives) def getShellId(self) -> str: + '''Return an unique id suitable for use in shell scripts. If the + module name is not a valid shell identifier use its MD5 digest.''' if re.match(self.shell_id_pattern, self.name): return self.name + # Newline character needed for compatibility with gnulib-tool.sh. return hashlib.md5(f'{self.name}\n'.encode(ENCS['default'])).hexdigest() def getShellFunc(self) -> str: