Skip to content

Commit dde3b3b

Browse files
author
Gonchik Tsymzhitov
committed
Documentation
1 parent 0c4e6c2 commit dde3b3b

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

atlassian/confluence.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,20 @@ def get_page_child_by_type(self, page_id, type='page', start=None, limit=None):
5252
return None
5353

5454
def get_page_id(self, space, title):
55+
"""
56+
Provide content id from search result by title and space
57+
:param space: SPACE key
58+
:param title: title
59+
:return:
60+
"""
5561
return self.get_page_by_title(space, title).get('id')
5662

5763
def get_page_space(self, page_id):
64+
"""
65+
Provide space key from content id
66+
:param page_id: content ID
67+
:return:
68+
"""
5869
return self.get_page_by_id(page_id, expand='space')['space']['key']
5970

6071
def get_page_by_title(self, space, title, start=None, limit=None):
@@ -86,6 +97,12 @@ def get_page_by_title(self, space, title, start=None, limit=None):
8697
return None
8798

8899
def get_page_by_id(self, page_id, expand=None):
100+
"""
101+
Get page by ID
102+
:param page_id: Content ID
103+
:param expand: OPTIONAL: expand e.g. history
104+
:return:
105+
"""
89106
url = 'rest/api/content/{page_id}?expand={expand}'.format(page_id=page_id, expand=expand)
90107
return self.get(url)
91108

@@ -281,6 +298,12 @@ def history(self, page_id):
281298
return self.get('rest/api/content/{0}/history'.format(page_id))
282299

283300
def is_page_content_is_already_updated(self, page_id, body):
301+
"""
302+
Compare content and check is already updated or not
303+
:param page_id: Content ID for retrieve storage value
304+
:param body: Body for compare it
305+
:return: True if the same
306+
"""
284307
confluence_content = self.get_page_by_id(page_id, expand='body.storage')['body']['storage']['value']
285308
confluence_content = confluence_content.replace('ó', u'ó')
286309

0 commit comments

Comments
 (0)