Skip to content

Commit 642c3cb

Browse files
Gonchik TsymzhitovGonchik Tsymzhitov
Gonchik Tsymzhitov
authored and
Gonchik Tsymzhitov
committed
A new release with new Confluence methods
1 parent 610818b commit 642c3cb

File tree

6 files changed

+23
-12
lines changed

6 files changed

+23
-12
lines changed

MANIFEST.in

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
include atlassian/VERSION
22
include LICENSE
33
include README.rst
4+
include tox.ini
5+
include requirements.txt

atlassian/VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
1.15.0
1+
1.15.1
22

atlassian/bitbucket.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -1474,12 +1474,12 @@ def set_branches_permissions(self, project_key, multiple_permissions=False, matc
14741474
except_access_keys = []
14751475
headers = self.default_headers
14761476
if repository:
1477-
url = "/rest/branch-permissions/2.0/projects/{project_key}/repos/{repository}/restrictions".format(
1477+
url = "rest/branch-permissions/2.0/projects/{project_key}/repos/{repository}/restrictions".format(
14781478
project_key=project_key,
14791479
repository=repository
14801480
)
14811481
else:
1482-
url = "/rest/branch-permissions/2.0/projects/{project_key}/restrictions".format(
1482+
url = "rest/branch-permissions/2.0/projects/{project_key}/restrictions".format(
14831483
project_key=project_key
14841484
)
14851485
if multiple_permissions:
@@ -1516,13 +1516,13 @@ def delete_branch_permission(self, project_key, permission_id, repository=None):
15161516
"""
15171517

15181518
if repository:
1519-
url = "/rest/branch-permissions/2.0/projects/{project_key}/repos/{repository}/restrictions/{id}".format(
1519+
url = "rest/branch-permissions/2.0/projects/{project_key}/repos/{repository}/restrictions/{id}".format(
15201520
project_key=project_key,
15211521
repository=repository,
15221522
id=permission_id
15231523
)
15241524
else:
1525-
url = "/rest/branch-permissions/2.0/projects/{project_key}/restrictions/{id}".format(
1525+
url = "rest/branch-permissions/2.0/projects/{project_key}/restrictions/{id}".format(
15261526
project_key=project_key,
15271527
id=permission_id
15281528
)
@@ -1540,13 +1540,13 @@ def get_branch_permission(self, project_key, permission_id, repository=None):
15401540
"""
15411541

15421542
if repository:
1543-
url = "/rest/branch-permissions/2.0/projects/{project_key}/repos/{repository}/restrictions/{id}".format(
1543+
url = "rest/branch-permissions/2.0/projects/{project_key}/repos/{repository}/restrictions/{id}".format(
15441544
project_key=project_key,
15451545
repository=repository,
15461546
id=permission_id
15471547
)
15481548
else:
1549-
url = "/rest/branch-permissions/2.0/projects/{project_key}/restrictions/{id}".format(
1549+
url = "rest/branch-permissions/2.0/projects/{project_key}/restrictions/{id}".format(
15501550
project_key=project_key,
15511551
id=permission_id
15521552
)

atlassian/confluence.py

+12-3
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ def is_page_content_is_already_updated(self, page_id, body, title=None):
753753
log.debug('Old Content: """{body}"""'.format(body=confluence_body_content))
754754
log.debug('New Content: """{body}"""'.format(body=body))
755755

756-
if confluence_body_content == body:
756+
if confluence_body_content.strip() == body.strip():
757757
log.warning('Content of {page_id} is exactly the same'.format(page_id=page_id))
758758
return True
759759
else:
@@ -1040,8 +1040,10 @@ def get_space(self, space_key, expand='description.plain,homepage'):
10401040
:param expand: OPTIONAL: additional info from description, homepage
10411041
:return: Returns the space along with its ID
10421042
"""
1043-
url = 'rest/api/space/{space_key}?expand={expand}'.format(space_key=space_key,
1044-
expand=expand)
1043+
url = 'rest/api/space/{space_key}'.format(space_key=space_key)
1044+
params = {}
1045+
if expand:
1046+
params["expand"] = expand
10451047
return self.get(url)
10461048

10471049
def create_space(self, space_key, space_name):
@@ -1066,6 +1068,13 @@ def delete_space(self, space_key):
10661068
url = 'rest/api/space/{}'.format(space_key)
10671069
return self.delete(url)
10681070

1071+
def get_space_property(self, space_key, expand=None):
1072+
url = 'rest/api/space/{space}/property'.format(space=space_key)
1073+
params = {}
1074+
if expand:
1075+
params['expand'] = expand
1076+
return self.get(url, params=params)
1077+
10691078
def get_user_details_by_username(self, username, expand=None):
10701079
"""
10711080
Get information about a user through username

docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# The short X.Y version
2727
version = ''
2828
# The full version, including alpha/beta/rc tags
29-
release = '1.13.23'
29+
release = '1.15.01'
3030

3131
# -- General configuration ---------------------------------------------------
3232

examples/stash-clean-jira-branches.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from atlassian import Jira
22
from atlassian import Stash
3-
from var import config
3+
import config
44
import logging
55
import time
66

0 commit comments

Comments
 (0)