# HG changeset patch # User Goffi # Date 1658330297 -7200 # Node ID e417c478b48873fcf615969d4cf703764ba856d2 # Parent 3ef9887348691938a2909e0f738e13a2a6152276 plugin XEP-0060, tools (utils): doc/type hints diff -r 3ef988734869 -r e417c478b488 sat/plugins/plugin_xep_0060.py --- a/sat/plugins/plugin_xep_0060.py Wed Jul 20 17:12:29 2022 +0200 +++ b/sat/plugins/plugin_xep_0060.py Wed Jul 20 17:18:17 2022 +0200 @@ -725,7 +725,9 @@ @param node (str): node id. @param max_items (int): optional limit on the number of retrieved items. @param item_ids (list[str]): identifiers of the items to be retrieved (can't be - used with rsm_request). + used with rsm_request). If requested items don't exist, they won't be + returned, meaning that we can have an empty list as result (NotFound + exception is NOT raised). @param sub_id (str): optional subscription identifier. @param rsm_request (rsm.RSMRequest): RSM request data @return: a deferred couple (list[dict], dict) containing: diff -r 3ef988734869 -r e417c478b488 sat/tools/utils.py --- a/sat/tools/utils.py Wed Jul 20 17:12:29 2022 +0200 +++ b/sat/tools/utils.py Wed Jul 20 17:18:17 2022 +0200 @@ -18,6 +18,7 @@ """ various useful methods """ +from typing import Optional, Union import unicodedata import os.path import datetime @@ -137,7 +138,10 @@ return wrapper -def xmpp_date(timestamp=None, with_time=True): +def xmpp_date( + timestamp: Optional[Union[float, int]] = None, + with_time: bool = True +) -> str: """Return date according to XEP-0082 specification to avoid reveling the timezone, we always return UTC dates