From e93bf7f0ff88b914aabdc0dc7492d0728d405097 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Tue, 20 Feb 2024 12:06:17 +0100 Subject: [PATCH] autoupdater: Move upstream.rstrip('/') to rest_api classes --- autoupdate_app_sources/autoupdate_app_sources.py | 2 +- autoupdate_app_sources/rest_api.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/autoupdate_app_sources/autoupdate_app_sources.py b/autoupdate_app_sources/autoupdate_app_sources.py index aa0c8f8..358aa55 100755 --- a/autoupdate_app_sources/autoupdate_app_sources.py +++ b/autoupdate_app_sources/autoupdate_app_sources.py @@ -461,7 +461,7 @@ class AppAutoUpdater: self, strategy: str, asset: Union[str, dict], infos: dict[str, Any] ) -> Optional[tuple[str, Union[str, dict[str, str]], str]]: autoupdate = infos.get("autoupdate") - upstream = autoupdate.get("upstream", self.main_upstream).strip("/") + upstream = autoupdate.get("upstream", self.main_upstream) version_re = autoupdate.get("version_regex", None) allow_prereleases = autoupdate.get("allow_prereleases", False) _, remote_type, revision_type = strategy.split("_") diff --git a/autoupdate_app_sources/rest_api.py b/autoupdate_app_sources/rest_api.py index 9c47ca0..2cedefd 100644 --- a/autoupdate_app_sources/rest_api.py +++ b/autoupdate_app_sources/rest_api.py @@ -15,7 +15,7 @@ class RefType(Enum): class GithubAPI: def __init__(self, upstream: str, auth: Optional[tuple[str, str]] = None): - self.upstream = upstream + self.upstream = upstream.strip("/") self.upstream_repo = upstream.replace("https://github.com/", "").strip("/") assert ( len(self.upstream_repo.split("/")) == 2