Skip to content

Commit 211f26b

Browse files
authored
Fix errors of black (atlassian-api#1093)
* Adjust for only python3 support
1 parent 991e2c2 commit 211f26b

22 files changed

+753
-160
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ Apache License
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2014 Mateusz Harasymczuk
189+
Copyright 2014 Mateusz Harasymczuk, Gonchik Tsymzhitov
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

atlassian/bamboo.py

Lines changed: 51 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,15 @@ def _get_generator(
6262
yield response
6363

6464
def base_list_call(
65-
self, resource, expand, favourite, clover_enabled, max_results, label=None, start_index=0, **kwargs
65+
self,
66+
resource,
67+
expand,
68+
favourite,
69+
clover_enabled,
70+
max_results,
71+
label=None,
72+
start_index=0,
73+
**kwargs,
6674
):
6775
flags = []
6876
params = {"max-results": max_results}
@@ -89,7 +97,13 @@ def base_list_call(
8997

9098
""" Projects & Plans """
9199

92-
def projects(self, expand=None, favourite=False, clover_enabled=False, max_results=25):
100+
def projects(
101+
self,
102+
expand=None,
103+
favourite=False,
104+
clover_enabled=False,
105+
max_results=25,
106+
):
93107
return self.base_list_call(
94108
"project",
95109
expand=expand,
@@ -369,7 +383,7 @@ def results(
369383
elements_key="results",
370384
element_key="result",
371385
label=label,
372-
**params
386+
**params,
373387
)
374388

375389
def latest_results(
@@ -483,7 +497,14 @@ def plan_results(
483497
include_all_states=include_all_states,
484498
)
485499

486-
def build_result(self, build_key, expand=None, include_all_states=False, start=0, max_results=25):
500+
def build_result(
501+
self,
502+
build_key,
503+
expand=None,
504+
include_all_states=False,
505+
start=0,
506+
max_results=25,
507+
):
487508
"""
488509
Returns details of a specific build result
489510
:param expand: expands build result details on request. Possible values are: artifacts, comments, labels,
@@ -545,7 +566,14 @@ def delete_build_result(self, build_key):
545566
params = {"buildKey": plan_key, "buildNumber": build_number}
546567
return self.post(custom_resource, params=params, headers=self.form_token_headers)
547568

548-
def execute_build(self, plan_key, stage=None, execute_all_stages=True, custom_revision=None, **bamboo_variables):
569+
def execute_build(
570+
self,
571+
plan_key,
572+
stage=None,
573+
execute_all_stages=True,
574+
custom_revision=None,
575+
**bamboo_variables,
576+
):
549577
"""
550578
Fire build execution for specified plan.
551579
!IMPORTANT! NOTE: for some reason, this method always execute all stages
@@ -581,7 +609,14 @@ def stop_build(self, plan_key):
581609

582610
""" Comments & Labels """
583611

584-
def comments(self, project_key, plan_key, build_number, start_index=0, max_results=25):
612+
def comments(
613+
self,
614+
project_key,
615+
plan_key,
616+
build_number,
617+
start_index=0,
618+
max_results=25,
619+
):
585620
resource = "result/{}-{}-{}/comment".format(project_key, plan_key, build_number)
586621
params = {"start-index": start_index, "max-results": max_results}
587622
return self.get(self.resource_url(resource), params=params)
@@ -594,7 +629,14 @@ def create_comment(self, project_key, plan_key, build_number, comment, author=No
594629
}
595630
return self.post(self.resource_url(resource), data=comment_data)
596631

597-
def labels(self, project_key, plan_key, build_number, start_index=0, max_results=25):
632+
def labels(
633+
self,
634+
project_key,
635+
plan_key,
636+
build_number,
637+
start_index=0,
638+
max_results=25,
639+
):
598640
resource = "result/{}-{}-{}/label".format(project_key, plan_key, build_number)
599641
params = {"start-index": start_index, "max-results": max_results}
600642
return self.get(self.resource_url(resource), params=params)
@@ -1018,7 +1060,8 @@ def agent_capabilities(self, agent_id, include_shared=True):
10181060
:return: agents
10191061
"""
10201062
return self.get(
1021-
self.resource_url("agent/{}/capability".format(agent_id)), params={"includeShared": include_shared}
1063+
self.resource_url("agent/{}/capability".format(agent_id)),
1064+
params={"includeShared": include_shared},
10221065
)
10231066

10241067
def activity(self):
@@ -1100,22 +1143,6 @@ def health_check(self):
11001143
response = self.get("rest/supportHealthCheck/1.0/check/")
11011144
return response
11021145

1103-
def upload_plugin(self, plugin_path):
1104-
"""
1105-
Provide plugin path for upload into Jira e.g. useful for auto deploy
1106-
:param plugin_path:
1107-
:return:
1108-
"""
1109-
files = {"plugin": open(plugin_path, "rb")}
1110-
upm_token = self.request(
1111-
method="GET",
1112-
path="rest/plugins/1.0/",
1113-
headers=self.no_check_headers,
1114-
trailing=True,
1115-
).headers["upm-token"]
1116-
url = "rest/plugins/1.0/?token={upm_token}".format(upm_token=upm_token)
1117-
return self.post(url, files=files, headers=self.no_check_headers)
1118-
11191146
def get_elastic_instance_logs(self, instance_id):
11201147
"""
11211148
Get logs from an EC2 instance

0 commit comments

Comments
 (0)