]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: Add missing docstring.
authorCollin Funk <collin.funk1@gmail.com>
Wed, 29 May 2024 06:26:19 +0000 (23:26 -0700)
committerCollin Funk <collin.funk1@gmail.com>
Wed, 29 May 2024 06:26:19 +0000 (23:26 -0700)
* pygnulib/GLModuleSystem.py (GLModule.getShellId): Add docstring
forgotten in the previous commit.

ChangeLog
pygnulib/GLModuleSystem.py

index 9be0407793e3f29bb5100e9c74a42523d4dd5ae1..9c22b7fb38e1871fb17c6cd35a4f10f26283ca48 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2024-05-28  Collin Funk  <collin.funk1@gmail.com>
 
+       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.
index 63d4f4a73e9bea81cb6dffeced8644ba12a68b57..f1774f64fc02719caec54101934376ed01dfa2ca 100644 (file)
@@ -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: