From 302d9fcdbaf48b982885a575c554875b7c872f9d Mon Sep 17 00:00:00 2001 From: Gonchik Tsymzhitov Date: Wed, 8 Feb 2023 07:27:58 +0200 Subject: [PATCH] Polish --- atlassian/bitbucket/cloud/repositories/refs.py | 1 - atlassian/insight.py | 4 +++- atlassian/jira.py | 6 ++++++ atlassian/xray.py | 3 --- docs/jira.rst | 5 ++++- examples/confluence/confluence_copy_labels.py | 1 - examples/jira/jira_dc_create_support_zips.py | 7 ------- 7 files changed, 13 insertions(+), 14 deletions(-) diff --git a/atlassian/bitbucket/cloud/repositories/refs.py b/atlassian/bitbucket/cloud/repositories/refs.py index 0af321801..0a14c6749 100644 --- a/atlassian/bitbucket/cloud/repositories/refs.py +++ b/atlassian/bitbucket/cloud/repositories/refs.py @@ -22,7 +22,6 @@ def create( ): """ Creates a ref with the given target commit - :param name: string: name :param commit: string: commit hash diff --git a/atlassian/insight.py b/atlassian/insight.py index 7a37e2f31..8df668df8 100644 --- a/atlassian/insight.py +++ b/atlassian/insight.py @@ -47,7 +47,9 @@ def __cloud_init(self, *args, **kwargs): return args, kwargs def __get_workspace_id(self): - return self.get("rest/servicedeskapi/insight/workspace", headers=self.default_headers,)["values"][ + return self.get( + "rest/servicedeskapi/insight/workspace", + headers=self.default_headers,)["values"][ 0 ]["workspaceId"] diff --git a/atlassian/jira.py b/atlassian/jira.py index e7d8dd382..7900cb6db 100644 --- a/atlassian/jira.py +++ b/atlassian/jira.py @@ -2124,6 +2124,12 @@ def archive_project(self, key): return self.put(url) def project(self, key, expand=None): + """ + Get project with details + :param key: + :param expand: + :return: + """ params = {} if expand: params["expand"] = expand diff --git a/atlassian/xray.py b/atlassian/xray.py index b6d9aa760..1d4b1625e 100644 --- a/atlassian/xray.py +++ b/atlassian/xray.py @@ -8,12 +8,9 @@ class Xray(AtlassianRestAPI): def __init__(self, *args, **kwargs): - if "api_version" not in kwargs: kwargs["api_version"] = "1.0" - kwargs["api_root"] = "rest/raven" - super(Xray, self).__init__(*args, **kwargs) def resource_url(self, resource, api_root=None, api_version=None): diff --git a/docs/jira.rst b/docs/jira.rst index 1d97367da..781b9a904 100644 --- a/docs/jira.rst +++ b/docs/jira.rst @@ -97,7 +97,10 @@ Manage projects jira.archive_project(key) # Get project - jira.project(key) + jira.project(key, expand=None) + + # Get project info + jira.get_project(key, expand=None) # Get project components using project key jira.get_project_components(key) diff --git a/examples/confluence/confluence_copy_labels.py b/examples/confluence/confluence_copy_labels.py index 1039e9b73..f2891e104 100644 --- a/examples/confluence/confluence_copy_labels.py +++ b/examples/confluence/confluence_copy_labels.py @@ -45,7 +45,6 @@ def sync_labels_pages(pages, destination_space): if __name__ == "__main__": - # Setting the logging level. INFO|ERROR|DEBUG are the most common. logging.basicConfig(level=logging.INFO) # Initialize argparse module with some program name and additional information diff --git a/examples/jira/jira_dc_create_support_zips.py b/examples/jira/jira_dc_create_support_zips.py index f30e31973..4abea9b26 100644 --- a/examples/jira/jira_dc_create_support_zips.py +++ b/examples/jira/jira_dc_create_support_zips.py @@ -10,23 +10,16 @@ in_progress_zips = list() while True: - for task in jira.check_support_zip_status(zips_creation_task_id)["tasks"]: - if task["status"] == "IN_PROGRESS": print("file {} {}".format(task["fileName"], task["progressMessage"])) - if task["fileName"] not in in_progress_zips: in_progress_zips.append(task["fileName"]) - else: support_zip = jira.download_support_zip(task["fileName"]) - with open(task["fileName"], "wb") as fp: fp.write(support_zip) - print("{} written.".format(task["fileName"])) - if task["fileName"] in in_progress_zips: in_progress_zips.remove(task["fileName"])