| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 472b300 commit c0d8810
51 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -320,7 +320,7 @@ def _compute_path(self, path: Optional[str] = None) -> Optional[str]: | |||
| 320 | 320 | for self_attr, parent_attr in self._from_parent_attrs.items() | |
| 321 | 321 | } | |
| 322 | 322 | self._parent_attrs = data | |
| 323 | - return path % data | ||
| 323 | + return path.format(**data) | ||
| 324 | 324 | ||
| 325 | 325 | @property | |
| 326 | 326 | def path(self) -> Optional[str]: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -53,7 +53,7 @@ def __init__( | |||
| 53 | 53 | # the class _path attribute, and replace the value with the result. | |
| 54 | 54 | if TYPE_CHECKING: | |
| 55 | 55 | assert self.mgr_cls._path is not None | |
| 56 | - self.mgr_cls._path = self.mgr_cls._path % self.args | ||
| 56 | + self.mgr_cls._path = self.mgr_cls._path.format(**self.args) | ||
| 57 | 57 | self.mgr = self.mgr_cls(gl) | |
| 58 | 58 | ||
| 59 | 59 | if self.mgr_cls._types: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,7 +20,7 @@ class GroupAccessRequest(AccessRequestMixin, ObjectDeleteMixin, RESTObject): | |||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | 22 | class GroupAccessRequestManager(ListMixin, CreateMixin, DeleteMixin, RESTManager): | |
| 23 | - _path = "/groups/%(group_id)s/access_requests" | ||
| 23 | + _path = "/groups/{group_id}/access_requests" | ||
| 24 | 24 | _obj_cls = GroupAccessRequest | |
| 25 | 25 | _from_parent_attrs = {"group_id": "id"} | |
| 26 | 26 | ||
@@ -30,6 +30,6 @@ class ProjectAccessRequest(AccessRequestMixin, ObjectDeleteMixin, RESTObject): | |||
| 30 | 30 | ||
| 31 | 31 | ||
| 32 | 32 | class ProjectAccessRequestManager(ListMixin, CreateMixin, DeleteMixin, RESTManager): | |
| 33 | - _path = "/projects/%(project_id)s/access_requests" | ||
| 33 | + _path = "/projects/{project_id}/access_requests" | ||
| 34 | 34 | _obj_cls = ProjectAccessRequest | |
| 35 | 35 | _from_parent_attrs = {"project_id": "id"} | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,7 +32,7 @@ class GroupAuditEvent(RESTObject): | |||
| 32 | 32 | ||
| 33 | 33 | ||
| 34 | 34 | class GroupAuditEventManager(RetrieveMixin, RESTManager): | |
| 35 | - _path = "/groups/%(group_id)s/audit_events" | ||
| 35 | + _path = "/groups/{group_id}/audit_events" | ||
| 36 | 36 | _obj_cls = GroupAuditEvent | |
| 37 | 37 | _from_parent_attrs = {"group_id": "id"} | |
| 38 | 38 | _list_filters = ("created_after", "created_before") | |
@@ -43,7 +43,7 @@ class ProjectAuditEvent(RESTObject): | |||
| 43 | 43 | ||
| 44 | 44 | ||
| 45 | 45 | class ProjectAuditEventManager(RetrieveMixin, RESTManager): | |
| 46 | - _path = "/projects/%(project_id)s/audit_events" | ||
| 46 | + _path = "/projects/{project_id}/audit_events" | ||
| 47 | 47 | _obj_cls = ProjectAuditEvent | |
| 48 | 48 | _from_parent_attrs = {"project_id": "id"} | |
| 49 | 49 | _list_filters = ("created_after", "created_before") | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,7 +22,7 @@ class ProjectIssueAwardEmoji(ObjectDeleteMixin, RESTObject): | |||
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | 24 | class ProjectIssueAwardEmojiManager(NoUpdateMixin, RESTManager): | |
| 25 | - _path = "/projects/%(project_id)s/issues/%(issue_iid)s/award_emoji" | ||
| 25 | + _path = "/projects/{project_id}/issues/{issue_iid}/award_emoji" | ||
| 26 | 26 | _obj_cls = ProjectIssueAwardEmoji | |
| 27 | 27 | _from_parent_attrs = {"project_id": "project_id", "issue_iid": "iid"} | |
| 28 | 28 | _create_attrs = RequiredOptional(required=("name",)) | |
@@ -33,9 +33,7 @@ class ProjectIssueNoteAwardEmoji(ObjectDeleteMixin, RESTObject): | |||
| 33 | 33 | ||
| 34 | 34 | ||
| 35 | 35 | class ProjectIssueNoteAwardEmojiManager(NoUpdateMixin, RESTManager): | |
| 36 | - _path = ( | ||
| 37 | - "/projects/%(project_id)s/issues/%(issue_iid)s" "/notes/%(note_id)s/award_emoji" | ||
| 38 | - ) | ||
| 36 | + _path = "/projects/{project_id}/issues/{issue_iid}/notes/{note_id}/award_emoji" | ||
| 39 | 37 | _obj_cls = ProjectIssueNoteAwardEmoji | |
| 40 | 38 | _from_parent_attrs = { | |
| 41 | 39 | "project_id": "project_id", | |
@@ -50,7 +48,7 @@ class ProjectMergeRequestAwardEmoji(ObjectDeleteMixin, RESTObject): | |||
| 50 | 48 | ||
| 51 | 49 | ||
| 52 | 50 | class ProjectMergeRequestAwardEmojiManager(NoUpdateMixin, RESTManager): | |
| 53 | - _path = "/projects/%(project_id)s/merge_requests/%(mr_iid)s/award_emoji" | ||
| 51 | + _path = "/projects/{project_id}/merge_requests/{mr_iid}/award_emoji" | ||
| 54 | 52 | _obj_cls = ProjectMergeRequestAwardEmoji | |
| 55 | 53 | _from_parent_attrs = {"project_id": "project_id", "mr_iid": "iid"} | |
| 56 | 54 | _create_attrs = RequiredOptional(required=("name",)) | |
@@ -61,10 +59,7 @@ class ProjectMergeRequestNoteAwardEmoji(ObjectDeleteMixin, RESTObject): | |||
| 61 | 59 | ||
| 62 | 60 | ||
| 63 | 61 | class ProjectMergeRequestNoteAwardEmojiManager(NoUpdateMixin, RESTManager): | |
| 64 | - _path = ( | ||
| 65 | - "/projects/%(project_id)s/merge_requests/%(mr_iid)s" | ||
| 66 | - "/notes/%(note_id)s/award_emoji" | ||
| 67 | - ) | ||
| 62 | + _path = "/projects/{project_id}/merge_requests/{mr_iid}/notes/{note_id}/award_emoji" | ||
| 68 | 63 | _obj_cls = ProjectMergeRequestNoteAwardEmoji | |
| 69 | 64 | _from_parent_attrs = { | |
| 70 | 65 | "project_id": "project_id", | |
@@ -79,7 +74,7 @@ class ProjectSnippetAwardEmoji(ObjectDeleteMixin, RESTObject): | |||
| 79 | 74 | ||
| 80 | 75 | ||
| 81 | 76 | class ProjectSnippetAwardEmojiManager(NoUpdateMixin, RESTManager): | |
| 82 | - _path = "/projects/%(project_id)s/snippets/%(snippet_id)s/award_emoji" | ||
| 77 | + _path = "/projects/{project_id}/snippets/{snippet_id}/award_emoji" | ||
| 83 | 78 | _obj_cls = ProjectSnippetAwardEmoji | |
| 84 | 79 | _from_parent_attrs = {"project_id": "project_id", "snippet_id": "id"} | |
| 85 | 80 | _create_attrs = RequiredOptional(required=("name",)) | |
@@ -90,10 +85,7 @@ class ProjectSnippetNoteAwardEmoji(ObjectDeleteMixin, RESTObject): | |||
| 90 | 85 | ||
| 91 | 86 | ||
| 92 | 87 | class ProjectSnippetNoteAwardEmojiManager(NoUpdateMixin, RESTManager): | |
| 93 | - _path = ( | ||
| 94 | - "/projects/%(project_id)s/snippets/%(snippet_id)s" | ||
| 95 | - "/notes/%(note_id)s/award_emoji" | ||
| 96 | - ) | ||
| 88 | + _path = "/projects/{project_id}/snippets/{snippet_id}/notes/{note_id}/award_emoji" | ||
| 97 | 89 | _obj_cls = ProjectSnippetNoteAwardEmoji | |
| 98 | 90 | _from_parent_attrs = { | |
| 99 | 91 | "project_id": "project_id", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,7 +16,7 @@ class GroupBadge(SaveMixin, ObjectDeleteMixin, RESTObject): | |||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | class GroupBadgeManager(BadgeRenderMixin, CRUDMixin, RESTManager): | |
| 19 | - _path = "/groups/%(group_id)s/badges" | ||
| 19 | + _path = "/groups/{group_id}/badges" | ||
| 20 | 20 | _obj_cls = GroupBadge | |
| 21 | 21 | _from_parent_attrs = {"group_id": "id"} | |
| 22 | 22 | _create_attrs = RequiredOptional(required=("link_url", "image_url")) | |
@@ -28,7 +28,7 @@ class ProjectBadge(SaveMixin, ObjectDeleteMixin, RESTObject): | |||
| 28 | 28 | ||
| 29 | 29 | ||
| 30 | 30 | class ProjectBadgeManager(BadgeRenderMixin, CRUDMixin, RESTManager): | |
| 31 | - _path = "/projects/%(project_id)s/badges" | ||
| 31 | + _path = "/projects/{project_id}/badges" | ||
| 32 | 32 | _obj_cls = ProjectBadge | |
| 33 | 33 | _from_parent_attrs = {"project_id": "id"} | |
| 34 | 34 | _create_attrs = RequiredOptional(required=("link_url", "image_url")) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,7 +20,7 @@ class GroupBoardList(SaveMixin, ObjectDeleteMixin, RESTObject): | |||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | 22 | class GroupBoardListManager(CRUDMixin, RESTManager): | |
| 23 | - _path = "/groups/%(group_id)s/boards/%(board_id)s/lists" | ||
| 23 | + _path = "/groups/{group_id}/boards/{board_id}/lists" | ||
| 24 | 24 | _obj_cls = GroupBoardList | |
| 25 | 25 | _from_parent_attrs = {"group_id": "group_id", "board_id": "id"} | |
| 26 | 26 | _create_attrs = RequiredOptional(required=("label_id",)) | |
@@ -37,7 +37,7 @@ class GroupBoard(SaveMixin, ObjectDeleteMixin, RESTObject): | |||
| 37 | 37 | ||
| 38 | 38 | ||
| 39 | 39 | class GroupBoardManager(CRUDMixin, RESTManager): | |
| 40 | - _path = "/groups/%(group_id)s/boards" | ||
| 40 | + _path = "/groups/{group_id}/boards" | ||
| 41 | 41 | _obj_cls = GroupBoard | |
| 42 | 42 | _from_parent_attrs = {"group_id": "id"} | |
| 43 | 43 | _create_attrs = RequiredOptional(required=("name",)) | |
@@ -51,7 +51,7 @@ class ProjectBoardList(SaveMixin, ObjectDeleteMixin, RESTObject): | |||
| 51 | 51 | ||
| 52 | 52 | ||
| 53 | 53 | class ProjectBoardListManager(CRUDMixin, RESTManager): | |
| 54 | - _path = "/projects/%(project_id)s/boards/%(board_id)s/lists" | ||
| 54 | + _path = "/projects/{project_id}/boards/{board_id}/lists" | ||
| 55 | 55 | _obj_cls = ProjectBoardList | |
| 56 | 56 | _from_parent_attrs = {"project_id": "project_id", "board_id": "id"} | |
| 57 | 57 | _create_attrs = RequiredOptional(required=("label_id",)) | |
@@ -68,7 +68,7 @@ class ProjectBoard(SaveMixin, ObjectDeleteMixin, RESTObject): | |||
| 68 | 68 | ||
| 69 | 69 | ||
| 70 | 70 | class ProjectBoardManager(CRUDMixin, RESTManager): | |
| 71 | - _path = "/projects/%(project_id)s/boards" | ||
| 71 | + _path = "/projects/{project_id}/boards" | ||
| 72 | 72 | _obj_cls = ProjectBoard | |
| 73 | 73 | _from_parent_attrs = {"project_id": "id"} | |
| 74 | 74 | _create_attrs = RequiredOptional(required=("name",)) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,7 +14,7 @@ class ProjectBranch(ObjectDeleteMixin, RESTObject): | |||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | 16 | class ProjectBranchManager(NoUpdateMixin, RESTManager): | |
| 17 | - _path = "/projects/%(project_id)s/repository/branches" | ||
| 17 | + _path = "/projects/{project_id}/repository/branches" | ||
| 18 | 18 | _obj_cls = ProjectBranch | |
| 19 | 19 | _from_parent_attrs = {"project_id": "id"} | |
| 20 | 20 | _create_attrs = RequiredOptional(required=("branch", "ref")) | |
@@ -25,7 +25,7 @@ class ProjectProtectedBranch(ObjectDeleteMixin, RESTObject): | |||
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | 27 | class ProjectProtectedBranchManager(NoUpdateMixin, RESTManager): | |
| 28 | - _path = "/projects/%(project_id)s/protected_branches" | ||
| 28 | + _path = "/projects/{project_id}/protected_branches" | ||
| 29 | 29 | _obj_cls = ProjectProtectedBranch | |
| 30 | 30 | _from_parent_attrs = {"project_id": "id"} | |
| 31 | 31 | _create_attrs = RequiredOptional( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,7 +17,7 @@ class GroupCluster(SaveMixin, ObjectDeleteMixin, RESTObject): | |||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 19 | class GroupClusterManager(CRUDMixin, RESTManager): | |
| 20 | - _path = "/groups/%(group_id)s/clusters" | ||
| 20 | + _path = "/groups/{group_id}/clusters" | ||
| 21 | 21 | _obj_cls = GroupCluster | |
| 22 | 22 | _from_parent_attrs = {"group_id": "id"} | |
| 23 | 23 | _create_attrs = RequiredOptional( | |
@@ -63,7 +63,7 @@ class ProjectCluster(SaveMixin, ObjectDeleteMixin, RESTObject): | |||
| 63 | 63 | ||
| 64 | 64 | ||
| 65 | 65 | class ProjectClusterManager(CRUDMixin, RESTManager): | |
| 66 | - _path = "/projects/%(project_id)s/clusters" | ||
| 66 | + _path = "/projects/{project_id}/clusters" | ||
| 67 | 67 | _obj_cls = ProjectCluster | |
| 68 | 68 | _from_parent_attrs = {"project_id": "id"} | |
| 69 | 69 | _create_attrs = RequiredOptional( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -143,7 +143,7 @@ def signature(self, **kwargs: Any) -> Union[Dict[str, Any], requests.Response]: | |||
| 143 | 143 | ||
| 144 | 144 | ||
| 145 | 145 | class ProjectCommitManager(RetrieveMixin, CreateMixin, RESTManager): | |
| 146 | - _path = "/projects/%(project_id)s/repository/commits" | ||
| 146 | + _path = "/projects/{project_id}/repository/commits" | ||
| 147 | 147 | _obj_cls = ProjectCommit | |
| 148 | 148 | _from_parent_attrs = {"project_id": "id"} | |
| 149 | 149 | _create_attrs = RequiredOptional( | |
@@ -158,7 +158,7 @@ class ProjectCommitComment(RESTObject): | |||
| 158 | 158 | ||
| 159 | 159 | ||
| 160 | 160 | class ProjectCommitCommentManager(ListMixin, CreateMixin, RESTManager): | |
| 161 | - _path = "/projects/%(project_id)s/repository/commits/%(commit_id)s" "/comments" | ||
| 161 | + _path = "/projects/{project_id}/repository/commits/{commit_id}/comments" | ||
| 162 | 162 | _obj_cls = ProjectCommitComment | |
| 163 | 163 | _from_parent_attrs = {"project_id": "project_id", "commit_id": "id"} | |
| 164 | 164 | _create_attrs = RequiredOptional( | |
@@ -171,7 +171,7 @@ class ProjectCommitStatus(RefreshMixin, RESTObject): | |||
| 171 | 171 | ||
| 172 | 172 | ||
| 173 | 173 | class ProjectCommitStatusManager(ListMixin, CreateMixin, RESTManager): | |
| 174 | - _path = "/projects/%(project_id)s/repository/commits/%(commit_id)s" "/statuses" | ||
| 174 | + _path = "/projects/{project_id}/repository/commits/{commit_id}/statuses" | ||
| 175 | 175 | _obj_cls = ProjectCommitStatus | |
| 176 | 176 | _from_parent_attrs = {"project_id": "project_id", "commit_id": "id"} | |
| 177 | 177 | _create_attrs = RequiredOptional( | |
@@ -202,10 +202,10 @@ def create( | |||
| 202 | 202 | # project_id and commit_id are in the data dict when using the CLI, but | |
| 203 | 203 | # they are missing when using only the API | |
| 204 | 204 | # See #511 | |
| 205 | - base_path = "/projects/%(project_id)s/statuses/%(commit_id)s" | ||
| 205 | + base_path = "/projects/{project_id}/statuses/{commit_id}" | ||
| 206 | 206 | path: Optional[str] | |
| 207 | 207 | if data is not None and "project_id" in data and "commit_id" in data: | |
| 208 | - path = base_path % data | ||
| 208 | + path = base_path.format(**data) | ||
| 209 | 209 | else: | |
| 210 | 210 | path = self._compute_path(base_path) | |
| 211 | 211 | if TYPE_CHECKING: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments