diff options
Diffstat (limited to 'gitlab/v4')
| -rw-r--r-- | gitlab/v4/objects/merge_request_approvals.py | 17 | ||||
| -rw-r--r-- | gitlab/v4/objects/projects.py | 17 |
2 files changed, 21 insertions, 13 deletions
diff --git a/gitlab/v4/objects/merge_request_approvals.py b/gitlab/v4/objects/merge_request_approvals.py index 0882edc..f05b977 100644 --- a/gitlab/v4/objects/merge_request_approvals.py +++ b/gitlab/v4/objects/merge_request_approvals.py @@ -140,7 +140,7 @@ class ProjectMergeRequestApprovalManager(GetWithoutIdMixin, UpdateMixin, RESTMan approval_rules: ProjectMergeRequestApprovalRuleManager = ( self._parent.approval_rules ) - """ update any existing approval rule matching the name""" + # update any existing approval rule matching the name existing_approval_rules = approval_rules.list() for ar in existing_approval_rules: if ar.name == approval_rule_name: @@ -149,7 +149,7 @@ class ProjectMergeRequestApprovalManager(GetWithoutIdMixin, UpdateMixin, RESTMan ar.group_ids = data["group_ids"] ar.save() return ar - """ if there was no rule matching the rule name, create a new one""" + # if there was no rule matching the rule name, create a new one return approval_rules.create(data=data) @@ -171,13 +171,13 @@ class ProjectMergeRequestApprovalRule(SaveMixin, RESTObject): GitlabAuthenticationError: If authentication is not correct GitlabUpdateError: If the server cannot perform the request """ - # There is a mismatch between the name of our id attribute and the put REST API name for the - # project_id, so we override it here. + # There is a mismatch between the name of our id attribute and the put + # REST API name for the project_id, so we override it here. self.approval_rule_id = self.id self.merge_request_iid = self._parent_attrs["mr_iid"] self.id = self._parent_attrs["project_id"] - # save will update self.id with the result from the server, so no need to overwrite with - # what it was before we overwrote it.""" + # save will update self.id with the result from the server, so no need + # to overwrite with what it was before we overwrote it. SaveMixin.save(self, **kwargs) @@ -198,8 +198,9 @@ class ProjectMergeRequestApprovalRuleManager( ), optional=("user_ids", "group_ids"), ) - # Important: When approval_project_rule_id is set, the name, users and groups of - # project-level rule will be copied. The approvals_required specified will be used. """ + # Important: When approval_project_rule_id is set, the name, users and + # groups of project-level rule will be copied. The approvals_required + # specified will be used. _create_attrs = RequiredOptional( required=("id", "merge_request_iid", "name", "approvals_required"), optional=("approval_project_rule_id", "user_ids", "group_ids"), diff --git a/gitlab/v4/objects/projects.py b/gitlab/v4/objects/projects.py index 3c26935..14519db 100644 --- a/gitlab/v4/objects/projects.py +++ b/gitlab/v4/objects/projects.py @@ -597,10 +597,12 @@ class Project(RefreshMixin, SaveMixin, ObjectDeleteMixin, RepositoryMixin, RESTO chunk_size: int = 1024, **kwargs: Any, ) -> Optional[bytes]: - """Download a single artifact file from a specific tag or branch from within the job’s artifacts archive. + """Download a single artifact file from a specific tag or branch from + within the job’s artifacts archive. Args: - ref_name: Branch or tag name in repository. HEAD or SHA references are not supported. + ref_name: Branch or tag name in repository. HEAD or SHA references + are not supported. artifact_path: Path to a file inside the artifacts archive. job: The name of the job. streamed: If True the data will be processed by chunks of @@ -619,7 +621,10 @@ class Project(RefreshMixin, SaveMixin, ObjectDeleteMixin, RepositoryMixin, RESTO The artifacts if `streamed` is False, None otherwise. """ - path = f"/projects/{self.get_id()}/jobs/artifacts/{ref_name}/raw/{artifact_path}?job={job}" + path = ( + f"/projects/{self.get_id()}/jobs/artifacts/{ref_name}/raw/" + f"{artifact_path}?job={job}" + ) result = self.manager.gitlab.http_get( path, streamed=streamed, raw=True, **kwargs ) @@ -857,7 +862,8 @@ class ProjectManager(CRUDMixin, RESTManager): .. note:: This request may take longer than most other API requests. - So this method will specify a 60 second default timeout if none is specified. + So this method will specify a 60 second default timeout if none is + specified. A timeout can be specified via kwargs to override this functionality. Args: @@ -945,7 +951,8 @@ class ProjectManager(CRUDMixin, RESTManager): .. note:: This request may take longer than most other API requests. - So this method will specify a 60 second default timeout if none is specified. + So this method will specify a 60 second default timeout if none is + specified. A timeout can be specified via kwargs to override this functionality. Args: |
