summaryrefslogtreecommitdiff
path: root/gitlab/v4/objects/files.py
diff options
context:
space:
mode:
authorNejc Habjan <hab.nejc@gmail.com>2021-11-01 19:22:18 +0100
committerNejc Habjan <hab.nejc@gmail.com>2021-11-02 07:03:33 +0100
commit30fa865cfe145d172b7061cb2af03837b3d1d312 (patch)
tree414f0a060d4dce56310327e07cbdcf7f41f39fc3 /gitlab/v4/objects/files.py
parentc7fdad42f68927d79e0d1963ade3324370b9d0e2 (diff)
downloadgitlab-refactor/f-strings.tar.gz
refactor: use f-strings for string formattingrefactor/f-strings
Diffstat (limited to 'gitlab/v4/objects/files.py')
-rw-r--r--gitlab/v4/objects/files.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/gitlab/v4/objects/files.py b/gitlab/v4/objects/files.py
index ff45478..6c8c80c 100644
--- a/gitlab/v4/objects/files.py
+++ b/gitlab/v4/objects/files.py
@@ -123,7 +123,7 @@ class ProjectFileManager(GetMixin, CreateMixin, UpdateMixin, DeleteMixin, RESTMa
self._check_missing_create_attrs(data)
new_data = data.copy()
file_path = new_data.pop("file_path").replace("/", "%2F")
- path = "%s/%s" % (self.path, file_path)
+ path = f"{self.path}/{file_path}"
server_data = self.gitlab.http_post(path, post_data=new_data, **kwargs)
return self._obj_cls(self, server_data)
@@ -147,7 +147,7 @@ class ProjectFileManager(GetMixin, CreateMixin, UpdateMixin, DeleteMixin, RESTMa
data = new_data.copy()
file_path = file_path.replace("/", "%2F")
data["file_path"] = file_path
- path = "%s/%s" % (self.path, file_path)
+ path = f"{self.path}/{file_path}"
self._check_missing_update_attrs(data)
return self.gitlab.http_put(path, post_data=data, **kwargs)
@@ -168,7 +168,7 @@ class ProjectFileManager(GetMixin, CreateMixin, UpdateMixin, DeleteMixin, RESTMa
GitlabAuthenticationError: If authentication is not correct
GitlabDeleteError: If the server cannot perform the request
"""
- path = "%s/%s" % (self.path, file_path.replace("/", "%2F"))
+ path = f"{self.path}/{file_path.replace('/', '%2F')}"
data = {"branch": branch, "commit_message": commit_message}
self.gitlab.http_delete(path, query_data=data, **kwargs)
@@ -198,7 +198,7 @@ class ProjectFileManager(GetMixin, CreateMixin, UpdateMixin, DeleteMixin, RESTMa
str: The file content
"""
file_path = file_path.replace("/", "%2F").replace(".", "%2E")
- path = "%s/%s/raw" % (self.path, file_path)
+ path = f"{self.path}/{file_path}/raw"
query_data = {"ref": ref}
result = self.gitlab.http_get(
path, query_data=query_data, streamed=streamed, raw=True, **kwargs
@@ -223,6 +223,6 @@ class ProjectFileManager(GetMixin, CreateMixin, UpdateMixin, DeleteMixin, RESTMa
list(blame): a list of commits/lines matching the file
"""
file_path = file_path.replace("/", "%2F").replace(".", "%2E")
- path = "%s/%s/blame" % (self.path, file_path)
+ path = f"{self.path}/{file_path}/blame"
query_data = {"ref": ref}
return self.gitlab.http_list(path, query_data, **kwargs)