From 9a37e9859c7f852e82e8c22d24e988d400c99227 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Wed, 11 Oct 2023 16:16:36 +0300 Subject: [PATCH] Add pydocs --- reportportal_client/helpers.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/reportportal_client/helpers.py b/reportportal_client/helpers.py index f563c10..b7a902e 100644 --- a/reportportal_client/helpers.py +++ b/reportportal_client/helpers.py @@ -203,13 +203,18 @@ def get_package_parameters(package_name: str, parameters: List[str] = None) -> L def get_package_version(package_name: str) -> Optional[str]: """Get version of the given package. - :param package_name: Name of the package - :return: Version of the package + :param package_name: Name of the package. + :return: Version of the package. """ return get_package_parameters(package_name, ['version'])[0] def truncate_attribute_string(text: str) -> str: + """Truncate a text if it's longer than allowed. + + :param text: Text to truncate. + :return: Truncated text. + """ truncation_length = len(TRUNCATE_REPLACEMENT) if len(text) > ATTRIBUTE_LENGTH_LIMIT and len(text) > truncation_length: return text[:ATTRIBUTE_LENGTH_LIMIT - truncation_length] + TRUNCATE_REPLACEMENT