* pygnulib/GLModuleSystem.py (GLModule.getShellId): Add docstring
forgotten in the previous commit.
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.
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: