Skip to content

Commit 7a33ddf

Browse files
author
Gonchik Tsymzhitov
committed
Merge branch 'master' of https://github.com/atlassian-api/atlassian-python-api into master
2 parents 8900f3b + a13b8da commit 7a33ddf

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

atlassian/confluence.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -758,12 +758,14 @@ def get_all_templates_from_space(self, space, start=0, limit=20, expand=None):
758758

759759
return response.get("results") or []
760760

761-
def get_all_spaces(self, start=0, limit=500, expand=None):
761+
def get_all_spaces(self, start=0, limit=500, expand=None, space_type=None, space_status=None):
762762
"""
763763
Get all spaces with provided limit
764764
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
765765
:param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted by
766766
fixed system limits. Default: 500
767+
:param space_type: OPTIONAL: Filter the list of spaces returned by type (global, personal)
768+
:param space_status: OPTIONAL: Filter the list of spaces returned by status (current, archived)
767769
:param expand: OPTIONAL: additional info, e.g. metadata, icon, description, homepage
768770
"""
769771
url = "rest/api/space"
@@ -774,7 +776,11 @@ def get_all_spaces(self, start=0, limit=500, expand=None):
774776
params["limit"] = limit
775777
if expand:
776778
params["expand"] = expand
777-
return (self.get(url, params=params) or {}).get("results")
779+
if space_type:
780+
params["type"] = space_type
781+
if space_status:
782+
params["status"] = space_status
783+
return self.get(url, params=params)
778784

779785
def add_comment(self, page_id, text):
780786
"""

atlassian/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ def parse_cookie_file(cookie_file):
330330
cookies = {}
331331
with open(cookie_file, "r") as fp:
332332
for line in fp:
333-
if not re.match(r"^#", line):
333+
if not re.match(r"^(#|$)", line):
334334
line_fields = line.strip().split("\t")
335335
cookies[line_fields[5]] = line_fields[6]
336336
return cookies

0 commit comments

Comments
 (0)