diff options
author | Nejc Habjan <hab.nejc@gmail.com> | 2021-11-01 19:22:18 +0100 |
---|---|---|
committer | Nejc Habjan <hab.nejc@gmail.com> | 2021-11-02 07:03:33 +0100 |
commit | 30fa865cfe145d172b7061cb2af03837b3d1d312 (patch) | |
tree | 414f0a060d4dce56310327e07cbdcf7f41f39fc3 /gitlab/v4/objects/repositories.py | |
parent | c7fdad42f68927d79e0d1963ade3324370b9d0e2 (diff) | |
download | gitlab-refactor/f-strings.tar.gz |
refactor: use f-strings for string formattingrefactor/f-strings
Diffstat (limited to 'gitlab/v4/objects/repositories.py')
-rw-r--r-- | gitlab/v4/objects/repositories.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gitlab/v4/objects/repositories.py b/gitlab/v4/objects/repositories.py index de5f0d2..e1067bd 100644 --- a/gitlab/v4/objects/repositories.py +++ b/gitlab/v4/objects/repositories.py @@ -27,7 +27,7 @@ class RepositoryMixin: """ submodule = submodule.replace("/", "%2F") # .replace('.', '%2E') - path = "/projects/%s/repository/submodules/%s" % (self.get_id(), submodule) + path = f"/projects/{self.get_id()}/repository/submodules/{submodule}" data = {"branch": branch, "commit_sha": commit_sha} if "commit_message" in kwargs: data["commit_message"] = kwargs["commit_message"] @@ -56,7 +56,7 @@ class RepositoryMixin: Returns: list: The representation of the tree """ - gl_path = "/projects/%s/repository/tree" % self.get_id() + gl_path = f"/projects/{self.get_id()}/repository/tree" query_data = {"recursive": recursive} if path: query_data["path"] = path @@ -81,7 +81,7 @@ class RepositoryMixin: dict: The blob content and metadata """ - path = "/projects/%s/repository/blobs/%s" % (self.get_id(), sha) + path = f"/projects/{self.get_id()}/repository/blobs/{sha}" return self.manager.gitlab.http_get(path, **kwargs) @cli.register_custom_action("Project", ("sha",)) @@ -108,7 +108,7 @@ class RepositoryMixin: Returns: str: The blob content if streamed is False, None otherwise """ - path = "/projects/%s/repository/blobs/%s/raw" % (self.get_id(), sha) + path = f"/projects/{self.get_id()}/repository/blobs/{sha}/raw" result = self.manager.gitlab.http_get( path, streamed=streamed, raw=True, **kwargs ) @@ -131,7 +131,7 @@ class RepositoryMixin: Returns: str: The diff """ - path = "/projects/%s/repository/compare" % self.get_id() + path = f"/projects/{self.get_id()}/repository/compare" query_data = {"from": from_, "to": to} return self.manager.gitlab.http_get(path, query_data=query_data, **kwargs) @@ -155,7 +155,7 @@ class RepositoryMixin: Returns: list: The contributors """ - path = "/projects/%s/repository/contributors" % self.get_id() + path = f"/projects/{self.get_id()}/repository/contributors" return self.manager.gitlab.http_list(path, **kwargs) @cli.register_custom_action("Project", tuple(), ("sha",)) @@ -182,7 +182,7 @@ class RepositoryMixin: Returns: bytes: The binary data of the archive """ - path = "/projects/%s/repository/archive" % self.get_id() + path = f"/projects/{self.get_id()}/repository/archive" query_data = {} if sha: query_data["sha"] = sha @@ -203,5 +203,5 @@ class RepositoryMixin: GitlabAuthenticationError: If authentication is not correct GitlabDeleteError: If the server failed to perform the request """ - path = "/projects/%s/repository/merged_branches" % self.get_id() + path = f"/projects/{self.get_id()}/repository/merged_branches" self.manager.gitlab.http_delete(path, **kwargs) |