Addon Manager: Bugfixes and cleanup of refactor

This commit is contained in:
Chris Hennes
2021-10-28 09:14:50 -05:00
parent fa8cac06f4
commit ba3d921f3f
5 changed files with 140 additions and 84 deletions

View File

@@ -203,10 +203,13 @@ def construct_git_url(repo, filename):
parsed_url = urlparse(repo.url)
if parsed_url.netloc == "github.com" or parsed_url.netloc == "framagit.com":
return f"{repo.url}/raw/{repo.branch}/{filename}"
elif parsed_url.netloc == "gitlab.com" or parsed_url.netloc == "salsa.debian.org":
elif parsed_url.netloc == "gitlab.com":
return f"{repo.url}/-/raw/{repo.branch}/{filename}"
elif parsed_url.netloc == "salsa.debian.org":
# e.g. https://salsa.debian.org/joha2/pyrate/-/raw/master/package.xml
return f"{repo.url}/-/raw/{repo.branch}/{filename}"
else:
FreeCAD.Console.PrintLog("Debug: addonmanager_utilities.construct_git_url: Unknown git host:", parsed_url.netloc)
FreeCAD.Console.PrintLog("Debug: addonmanager_utilities.construct_git_url: Unknown git host:" + parsed_url.netloc)
return None
def get_readme_url(repo):