Skip to content
Snippets Groups Projects
Commit 67f02ae7 authored by Lukáš Krupčík's avatar Lukáš Krupčík
Browse files

Mon, 27 Nov 2017 16:52:38 +0100

parent 626397cf
No related branches found
No related tags found
No related merge requests found
......@@ -22,16 +22,22 @@ def get_software_versions(software_path):
def get_module_description(module_path):
"""Return software homepage URL and description"""
url = ""
url_position = 0
description = " "
with open(module_path) as f:
content = f.read()
print(module_path)
#data = re.search(r"module-whatis\s{(Description: )?(.+)\s-\sHomepage:\s(\S+)}",
data = re.search(r"whatis\((\[\[|\[==\[)Description: ?([\s\S]+)(\]\]|\]==\])\)\s+whatis\((\[\[|\[==\[)Homepage:\s(\S+)(\]\]|\]==\])\)",
if module_path.endswith('lua'):
data = re.search(r"whatis\((\[\[|\[==\[)Description: ?([\s\S]+)(\]\]|\]==\])\)\s+whatis\((\[\[|\[==\[)Homepage:\s(\S+)(\]\]|\]==\])\)",
content, re.DOTALL)
url_position = 5
else:
data = re.search(r"module-whatis\s{(Description: )?(.+)\s-\sHomepage:\s(\S+)}",
content, re.DOTALL)
url_position = 3
try:
description = data.group(2)
url = data.group(5)
url = data.group(url_position)
except AttributeError:
pass
return url, description
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment