Feat: Enable use of recursion-level parameter for wiki get_page (show) command (#1405)

This commit is contained in:
Devvox93 2024-04-22 13:55:11 +02:00 коммит произвёл GitHub
Родитель 87b9d07ff1
Коммит 22694d5dd9
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -182,7 +182,7 @@ def update_page(wiki, path, version, comment=_DEFAULT_PAGE_UPDATE_MESSAGE, conte
def get_page(wiki, path, version=None, open=False, # pylint: disable=redefined-builtin
include_content=False, organization=None, project=None, detect=None):
include_content=False, organization=None, project=None, detect=None, recursion_level=None):
"""Get the content of a page or open a page.
:param wiki: Name or Id of the wiki.
:type wiki: str
@ -194,6 +194,8 @@ def get_page(wiki, path, version=None, open=False, # pylint: disable=redefined-
:type include_content: str
:param open: Open the wiki page in your web browser.
:type open: bool
:param recursion_level: Include subpages of the page.
:type recursion_level: str
"""
organization, project = resolve_instance_and_project(detect=detect,
organization=organization,
@ -201,7 +203,7 @@ def get_page(wiki, path, version=None, open=False, # pylint: disable=redefined-
wiki_client = get_wiki_client(organization)
page_object = wiki_client.get_page(
wiki_identifier=wiki, project=project, path=path,
recursion_level=None, version_descriptor=version,
recursion_level=recursion_level, version_descriptor=version,
include_content=include_content)
if open:
webbrowser.open_new(url=page_object.page.remote_url)