diff --git a/modules.py b/modules.py index 6aa734e67dbe3b878201c1acd82a07c26f2db770..446663f515bd496349a2afec5ec04268cb28933d 100755 --- a/modules.py +++ b/modules.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """Script to generate module lists""" import os @@ -43,10 +43,17 @@ if __name__ == "__main__": SUBDIRS = os.environ['MODULEPATH'].split(':') for subdir in sorted(SUBDIRS, key=lambda s: s.lower()): + # Ignore the specific path + if subdir == "/apps/all/Lmod/8.7.37/modulefiles/Core": + continue + if subdir == "/apps/all/Lmod/8.7.37/modulefiles/Linux": + continue + + available_software = get_software_list(subdir) - print "\n## %s\n" % os.path.basename(subdir).title() - print "| Module | Description |" - print "| ------ | ----------- |" + print("\n## {}\n".format(os.path.basename(subdir).title())) + print("| Module | Description |") + print("| ------ | ----------- |") HTML_SOURCE_DATA[subdir] = {} for soft in sorted(available_software, key=str.lower): software_path = os.path.join(subdir, soft) @@ -63,6 +70,6 @@ if __name__ == "__main__": for version in software_versions: HTML_SOURCE_DATA[subdir][soft]['versions'].append(version) if software_url in ["", "(none)", "N/A"]: - print "| %s | %s |" % (soft, " ".join(software_description.split())) + print("| {} | {} |".format(soft, " ".join(software_description.split()))) else: - print "| [%s](%s) | %s |" % (soft, software_url, " ".join(software_description.split())) + print("| [{}]({}) | {} |".format(soft, software_url, " ".join(software_description.split())))