| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b644721 commit 23feae9
9 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -967,6 +967,7 @@ def http_post( | |||
| 967 | 967 | query_data=query_data, | |
| 968 | 968 | post_data=post_data, | |
| 969 | 969 | files=files, | |
| 970 | + raw=raw, | ||
| 970 | 971 | **kwargs, | |
| 971 | 972 | ) | |
| 972 | 973 | try: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -381,7 +381,7 @@ def get_dict( | |||
| 381 | 381 | ||
| 382 | 382 | class JSONPrinter: | |
| 383 | 383 | @staticmethod | |
| 384 | - def display(d: Union[str, Dict[str, Any]], **kwargs: Any) -> None: | ||
| 384 | + def display(d: Union[str, Dict[str, Any]], **_kwargs: Any) -> None: | ||
| 385 | 385 | import json # noqa | |
| 386 | 386 | ||
| 387 | 387 | print(json.dumps(d)) | |
@@ -390,7 +390,7 @@ def display(d: Union[str, Dict[str, Any]], **kwargs: Any) -> None: | |||
| 390 | 390 | def display_list( | |
| 391 | 391 | data: List[Union[str, gitlab.base.RESTObject]], | |
| 392 | 392 | fields: List[str], | |
| 393 | - **kwargs: Any, | ||
| 393 | + **_kwargs: Any, | ||
| 394 | 394 | ) -> None: | |
| 395 | 395 | import json # noqa | |
| 396 | 396 | ||
@@ -399,7 +399,7 @@ def display_list( | |||
| 399 | 399 | ||
| 400 | 400 | class YAMLPrinter: | |
| 401 | 401 | @staticmethod | |
| 402 | - def display(d: Union[str, Dict[str, Any]], **kwargs: Any) -> None: | ||
| 402 | + def display(d: Union[str, Dict[str, Any]], **_kwargs: Any) -> None: | ||
| 403 | 403 | try: | |
| 404 | 404 | import yaml # noqa | |
| 405 | 405 | ||
@@ -415,7 +415,7 @@ def display(d: Union[str, Dict[str, Any]], **kwargs: Any) -> None: | |||
| 415 | 415 | def display_list( | |
| 416 | 416 | data: List[Union[str, gitlab.base.RESTObject]], | |
| 417 | 417 | fields: List[str], | |
| 418 | - **kwargs: Any, | ||
| 418 | + **_kwargs: Any, | ||
| 419 | 419 | ) -> None: | |
| 420 | 420 | try: | |
| 421 | 421 | import yaml # noqa | |
@@ -434,7 +434,7 @@ def display_list( | |||
| 434 | 434 | ||
| 435 | 435 | ||
| 436 | 436 | class LegacyPrinter: | |
| 437 | - def display(self, d: Union[str, Dict[str, Any]], **kwargs: Any) -> None: | ||
| 437 | + def display(self, _d: Union[str, Dict[str, Any]], **kwargs: Any) -> None: | ||
| 438 | 438 | verbose = kwargs.get("verbose", False) | |
| 439 | 439 | padding = kwargs.get("padding", 0) | |
| 440 | 440 | obj: Optional[Union[Dict[str, Any], gitlab.base.RESTObject]] = kwargs.get("obj") | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -183,7 +183,7 @@ def delete_ldap_group_link( | |||
| 183 | 183 | if provider is not None: | |
| 184 | 184 | path += f"/{provider}" | |
| 185 | 185 | path += f"/{cn}" | |
| 186 | - self.manager.gitlab.http_delete(path) | ||
| 186 | + self.manager.gitlab.http_delete(path, **kwargs) | ||
| 187 | 187 | ||
| 188 | 188 | @cli.register_custom_action("Group") | |
| 189 | 189 | @exc.on_http_error(exc.GitlabCreateError) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,7 +28,7 @@ def cancel(self, **kwargs: Any) -> Dict[str, Any]: | |||
| 28 | 28 | GitlabJobCancelError: If the job could not be canceled | |
| 29 | 29 | """ | |
| 30 | 30 | path = f"{self.manager.path}/{self.encoded_id}/cancel" | |
| 31 | - result = self.manager.gitlab.http_post(path) | ||
| 31 | + result = self.manager.gitlab.http_post(path, **kwargs) | ||
| 32 | 32 | if TYPE_CHECKING: | |
| 33 | 33 | assert isinstance(result, dict) | |
| 34 | 34 | return result | |
@@ -46,7 +46,7 @@ def retry(self, **kwargs: Any) -> Dict[str, Any]: | |||
| 46 | 46 | GitlabJobRetryError: If the job could not be retried | |
| 47 | 47 | """ | |
| 48 | 48 | path = f"{self.manager.path}/{self.encoded_id}/retry" | |
| 49 | - result = self.manager.gitlab.http_post(path) | ||
| 49 | + result = self.manager.gitlab.http_post(path, **kwargs) | ||
| 50 | 50 | if TYPE_CHECKING: | |
| 51 | 51 | assert isinstance(result, dict) | |
| 52 | 52 | return result | |
@@ -64,7 +64,7 @@ def play(self, **kwargs: Any) -> None: | |||
| 64 | 64 | GitlabJobPlayError: If the job could not be triggered | |
| 65 | 65 | """ | |
| 66 | 66 | path = f"{self.manager.path}/{self.encoded_id}/play" | |
| 67 | - self.manager.gitlab.http_post(path) | ||
| 67 | + self.manager.gitlab.http_post(path, **kwargs) | ||
| 68 | 68 | ||
| 69 | 69 | @cli.register_custom_action("ProjectJob") | |
| 70 | 70 | @exc.on_http_error(exc.GitlabJobEraseError) | |
@@ -79,7 +79,7 @@ def erase(self, **kwargs: Any) -> None: | |||
| 79 | 79 | GitlabJobEraseError: If the job could not be erased | |
| 80 | 80 | """ | |
| 81 | 81 | path = f"{self.manager.path}/{self.encoded_id}/erase" | |
| 82 | - self.manager.gitlab.http_post(path) | ||
| 82 | + self.manager.gitlab.http_post(path, **kwargs) | ||
| 83 | 83 | ||
| 84 | 84 | @cli.register_custom_action("ProjectJob") | |
| 85 | 85 | @exc.on_http_error(exc.GitlabCreateError) | |
@@ -94,7 +94,7 @@ def keep_artifacts(self, **kwargs: Any) -> None: | |||
| 94 | 94 | GitlabCreateError: If the request could not be performed | |
| 95 | 95 | """ | |
| 96 | 96 | path = f"{self.manager.path}/{self.encoded_id}/artifacts/keep" | |
| 97 | - self.manager.gitlab.http_post(path) | ||
| 97 | + self.manager.gitlab.http_post(path, **kwargs) | ||
| 98 | 98 | ||
| 99 | 99 | @cli.register_custom_action("ProjectJob") | |
| 100 | 100 | @exc.on_http_error(exc.GitlabCreateError) | |
@@ -109,7 +109,7 @@ def delete_artifacts(self, **kwargs: Any) -> None: | |||
| 109 | 109 | GitlabDeleteError: If the request could not be performed | |
| 110 | 110 | """ | |
| 111 | 111 | path = f"{self.manager.path}/{self.encoded_id}/artifacts" | |
| 112 | - self.manager.gitlab.http_delete(path) | ||
| 112 | + self.manager.gitlab.http_delete(path, **kwargs) | ||
| 113 | 113 | ||
| 114 | 114 | @cli.register_custom_action("ProjectJob") | |
| 115 | 115 | @exc.on_http_error(exc.GitlabGetError) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -157,7 +157,7 @@ def set_approvers( | |||
| 157 | 157 | ar.save() | |
| 158 | 158 | return ar | |
| 159 | 159 | # if there was no rule matching the rule name, create a new one | |
| 160 | - return approval_rules.create(data=data) | ||
| 160 | + return approval_rules.create(data=data, **kwargs) | ||
| 161 | 161 | ||
| 162 | 162 | ||
| 163 | 163 | class ProjectMergeRequestApprovalRule(SaveMixin, ObjectDeleteMixin, RESTObject): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -71,7 +71,7 @@ def cancel(self, **kwargs: Any) -> Union[Dict[str, Any], requests.Response]: | |||
| 71 | 71 | GitlabPipelineCancelError: If the request failed | |
| 72 | 72 | """ | |
| 73 | 73 | path = f"{self.manager.path}/{self.encoded_id}/cancel" | |
| 74 | - return self.manager.gitlab.http_post(path) | ||
| 74 | + return self.manager.gitlab.http_post(path, **kwargs) | ||
| 75 | 75 | ||
| 76 | 76 | @cli.register_custom_action("ProjectPipeline") | |
| 77 | 77 | @exc.on_http_error(exc.GitlabPipelineRetryError) | |
@@ -86,7 +86,7 @@ def retry(self, **kwargs: Any) -> Union[Dict[str, Any], requests.Response]: | |||
| 86 | 86 | GitlabPipelineRetryError: If the request failed | |
| 87 | 87 | """ | |
| 88 | 88 | path = f"{self.manager.path}/{self.encoded_id}/retry" | |
| 89 | - return self.manager.gitlab.http_post(path) | ||
| 89 | + return self.manager.gitlab.http_post(path, **kwargs) | ||
| 90 | 90 | ||
| 91 | 91 | ||
| 92 | 92 | class ProjectPipelineManager(RetrieveMixin, CreateMixin, DeleteMixin, RESTManager): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -464,7 +464,7 @@ def upload( | |||
| 464 | 464 | ||
| 465 | 465 | url = f"/projects/{self.encoded_id}/uploads" | |
| 466 | 466 | file_info = {"file": (filename, filedata)} | |
| 467 | - data = self.manager.gitlab.http_post(url, files=file_info) | ||
| 467 | + data = self.manager.gitlab.http_post(url, files=file_info, **kwargs) | ||
| 468 | 468 | ||
| 469 | 469 | if TYPE_CHECKING: | |
| 470 | 470 | assert isinstance(data, dict) | |
@@ -504,7 +504,7 @@ def snapshot( | |||
| 504 | 504 | """ | |
| 505 | 505 | path = f"/projects/{self.encoded_id}/snapshot" | |
| 506 | 506 | result = self.manager.gitlab.http_get( | |
| 507 | - path, streamed=streamed, raw=True, **kwargs | ||
| 507 | + path, streamed=streamed, raw=True, wiki=wiki, **kwargs | ||
| 508 | 508 | ) | |
| 509 | 509 | if TYPE_CHECKING: | |
| 510 | 510 | assert isinstance(result, requests.Response) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -267,7 +267,7 @@ def get( | |||
| 267 | 267 | return cast(ProjectService, super().get(id=id, lazy=lazy, **kwargs)) | |
| 268 | 268 | ||
| 269 | 269 | @cli.register_custom_action("ProjectServiceManager") | |
| 270 | - def available(self, **kwargs: Any) -> List[str]: | ||
| 270 | + def available(self) -> List[str]: | ||
| 271 | 271 | """List the services known by python-gitlab. | |
| 272 | 272 | ||
| 273 | 273 | Returns: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -70,8 +70,6 @@ disable = [ | |||
| 70 | 70 | "too-many-locals", | |
| 71 | 71 | "too-many-statements", | |
| 72 | 72 | "unsubscriptable-object", | |
| 73 | - "unused-argument", | ||
| 74 | - | ||
| 75 | 73 | ] | |
| 76 | 74 | ||
| 77 | 75 | [tool.pytest.ini_options] | |
| Back | FazBrowse Home | New Git URL |
0 commit comments