From 001302d065dd00a90f33a296bd613c1a93b197bb Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Tue, 28 May 2024 23:26:19 -0700 Subject: [PATCH] gnulib-tool.py: Add missing docstring. * pygnulib/GLModuleSystem.py (GLModule.getShellId): Add docstring forgotten in the previous commit. --- ChangeLog | 4 ++++ pygnulib/GLModuleSystem.py | 3 +++ 2 files changed, 7 insertions(+) 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: -- 2.39.5