Newer
Older
software_list = next(os.walk('.'))[1]
# In case that there is 'all' module
if 'all' in software_list:
software_list.remove('all')
return software_list
return next(os.walk('.'))[2]
def get_module_description(module_path):
"""Return software homepage URL and description"""
url = ""
data = re.search(r"whatis\((\[\[|\[==\[)Description: ?([\s\S]+)(?:\]\]|\]==\])\)\s+whatis\((?:\[\[|\[==\[)Homepage:\s(\S+)(?:\]\]|\]==\])\)",
else:
data = re.search(r"module-whatis\s{(Description: )?(.+)\s-\sHomepage:\s(\S+)}",
except AttributeError:
pass
return url, description
if __name__ == "__main__":
HTML_SOURCE_DATA = {}
# Ignore the specific path
if subdir == "/apps/all/Lmod/8.7.37/modulefiles/Core":
continue
if subdir == "/apps/all/Lmod/8.7.37/lmod/lmod/modulefiles/Core":
continue
if subdir == "/apps/all/intel-compilers/2023.2.1/modulefiles":
continue
if subdir == "/opt/cray/pe/modulefiles":
continue
if subdir == "/opt/cray/pe/craype-targets/1.4.0/modulefiles":
print("\n## {}\n".format(os.path.basename(subdir).title()))
print("| Module | Description |")
print("| ------ | ----------- |")
software_versions = [ver for ver in software_versions if not ver[0] == '.']
if not software_versions:
continue
first_module_path = os.path.join(software_path, software_versions[0])
software_url, software_description = get_module_description(first_module_path)
'url': software_url,
'description': software_description}
print("| {} | {} |".format(soft, " ".join(software_description.split())))