diff --git a/atlassian/VERSION b/atlassian/VERSION index 63e799cf4..a4cc55716 100644 --- a/atlassian/VERSION +++ b/atlassian/VERSION @@ -1 +1 @@ -1.14.1 +1.14.2 diff --git a/atlassian/__init__.py b/atlassian/__init__.py index 2c6308697..cf793bbdc 100644 --- a/atlassian/__init__.py +++ b/atlassian/__init__.py @@ -1,13 +1,13 @@ -from .confluence import Confluence -from .jira import Jira +from .bamboo import Bamboo from .bitbucket import Bitbucket from .bitbucket import Bitbucket as Stash -from .portfolio import Portfolio -from .bamboo import Bamboo +from .confluence import Confluence from .crowd import Crowd -from .service_desk import ServiceDesk -from .marketplace import MarketPlace +from .jira import Jira from .jira8 import Jira8 +from .marketplace import MarketPlace +from .portfolio import Portfolio +from .service_desk import ServiceDesk __all__ = [ 'Confluence', diff --git a/atlassian/bamboo.py b/atlassian/bamboo.py index 8a40153b9..41db89577 100755 --- a/atlassian/bamboo.py +++ b/atlassian/bamboo.py @@ -1,6 +1,8 @@ # coding=utf-8 import logging + from requests.exceptions import HTTPError + from .rest_client import AtlassianRestAPI log = logging.getLogger(__name__) @@ -196,6 +198,7 @@ def get_vcs_branches(self, plan_key, max_results=25): """ Get all vcs names for the current plan :param plan_key: str TST-BLD + :param max_results :return: """ resource = 'plan/{plan_key}/vcsBranches'.format(plan_key=plan_key) @@ -302,6 +305,7 @@ def build_result(self, build_key, expand=None, include_all_states=False): using stages.stage.results.result. All expand parameters should contain results.result prefix. :param build_key: Should be in the form XX-YY[-ZZ]-99, that is, the last token should be an integer representing the build number + :param include_all_states """ try: int(build_key.split('-')[-1]) diff --git a/atlassian/bitbucket.py b/atlassian/bitbucket.py index 89418a115..5f42aef86 100644 --- a/atlassian/bitbucket.py +++ b/atlassian/bitbucket.py @@ -1,5 +1,6 @@ # coding=utf-8 import logging + from .rest_client import AtlassianRestAPI log = logging.getLogger(__name__) @@ -560,7 +561,8 @@ def get_pull_request_settings(self, project, repository): :param repository: :return: """ - url = 'rest/api/1.0/projects/{project}/repos/{repository}/settings/pull-requests'.format(project=project,repository=repository) + url = 'rest/api/1.0/projects/{project}/repos/{repository}/settings/pull-requests'.format(project=project, + repository=repository) return self.get(url) def set_pull_request_settings(self, project, repository, data): @@ -571,7 +573,8 @@ def set_pull_request_settings(self, project, repository, data): :param data: json body :return: """ - url = 'rest/api/1.0/projects/{project}/repos/{repository}/settings/pull-requests'.format(project=project,repository=repository) + url = 'rest/api/1.0/projects/{project}/repos/{repository}/settings/pull-requests'.format(project=project, + repository=repository) return self.post(url, data=data) def get_pull_requests(self, project, repository, state='OPEN', order='newest', limit=100, start=0, at=None): @@ -1074,7 +1077,7 @@ def get_branches_permissions(self, project, repository=None, start=0, limit=25): :param limit: :return: """ - if repository != None: + if repository is not None: url = 'rest/branch-permissions/2.0/projects/{project}/repos/{repository}/restrictions'.format( project=project, repository=repository) @@ -1098,12 +1101,12 @@ def all_branches_permissions(self, project, repository=None): """ start = 0 branches_permissions = [] - response = self.get_branches_permissions(project=project, repository=repository, start=start) - branches_permissions += response.get('values') + response = self.get_branches_permissions(project=project, repository=repository, start=start) + branches_permissions += response.get('values') while not response.get('isLastPage'): start = response.get('nextPageStart') - response = self.get_branches_permissions(project=project, repository=repository, start=start) - branches_permissions += response.get('values') + response = self.get_branches_permissions(project=project, repository=repository, start=start) + branches_permissions += response.get('values') return branches_permissions def reindex(self): diff --git a/atlassian/confluence.py b/atlassian/confluence.py index 60fd5bab8..9a44b5233 100644 --- a/atlassian/confluence.py +++ b/atlassian/confluence.py @@ -1,11 +1,13 @@ # coding=utf-8 -from atlassian import utils -from .rest_client import AtlassianRestAPI -from requests import HTTPError import logging import os import time +from requests import HTTPError + +from atlassian import utils +from .rest_client import AtlassianRestAPI + log = logging.getLogger(__name__) diff --git a/atlassian/crowd.py b/atlassian/crowd.py index 0f3583a48..e7b2f91fa 100644 --- a/atlassian/crowd.py +++ b/atlassian/crowd.py @@ -1,5 +1,6 @@ # coding=utf-8 import logging + from .rest_client import AtlassianRestAPI log = logging.getLogger(__name__) diff --git a/atlassian/jira.py b/atlassian/jira.py index 14d7808b3..ce0972fb8 100644 --- a/atlassian/jira.py +++ b/atlassian/jira.py @@ -1,6 +1,8 @@ # coding=utf-8 import logging + from requests.exceptions import HTTPError + from .rest_client import AtlassianRestAPI log = logging.getLogger(__name__) diff --git a/atlassian/jira8.py b/atlassian/jira8.py index 87bd538f7..960592678 100644 --- a/atlassian/jira8.py +++ b/atlassian/jira8.py @@ -1,5 +1,6 @@ # coding=utf-8 import logging + from .rest_client import AtlassianRestAPI log = logging.getLogger(__name__) diff --git a/atlassian/marketplace.py b/atlassian/marketplace.py index 47b70cb56..0f983e1b9 100644 --- a/atlassian/marketplace.py +++ b/atlassian/marketplace.py @@ -1,5 +1,6 @@ # coding=utf-8 import logging + from .rest_client import AtlassianRestAPI log = logging.getLogger(__name__) diff --git a/atlassian/portfolio.py b/atlassian/portfolio.py index 4907be073..a1f127db5 100644 --- a/atlassian/portfolio.py +++ b/atlassian/portfolio.py @@ -1,5 +1,6 @@ # coding=utf-8 import logging + from .rest_client import AtlassianRestAPI log = logging.getLogger(__name__) diff --git a/atlassian/request_utils.py b/atlassian/request_utils.py index e968fa404..f1e4027cb 100644 --- a/atlassian/request_utils.py +++ b/atlassian/request_utils.py @@ -1,4 +1,5 @@ import logging + from six import PY3 diff --git a/atlassian/rest_client.py b/atlassian/rest_client.py index a44dd11af..3761ed9eb 100644 --- a/atlassian/rest_client.py +++ b/atlassian/rest_client.py @@ -1,10 +1,12 @@ # coding=utf-8 import json import logging -from six.moves.urllib.parse import urlencode + import requests from oauthlib.oauth1 import SIGNATURE_RSA from requests_oauthlib import OAuth1 +from six.moves.urllib.parse import urlencode + from atlassian.request_utils import get_default_logger log = get_default_logger(__name__) diff --git a/atlassian/service_desk.py b/atlassian/service_desk.py index 56046b833..a7b30df79 100644 --- a/atlassian/service_desk.py +++ b/atlassian/service_desk.py @@ -1,5 +1,6 @@ # coding=utf-8 import logging + from .rest_client import AtlassianRestAPI log = logging.getLogger(__name__)