Mercurial > libervia-backend
diff libervia/backend/plugins/plugin_xep_0059.py @ 4270:0d7bb4df2343
Reformatted code base using black.
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 19 Jun 2024 18:44:57 +0200 |
parents | 4b842c1fb686 |
children |
line wrap: on
line diff
--- a/libervia/backend/plugins/plugin_xep_0059.py Tue Jun 18 12:06:45 2024 +0200 +++ b/libervia/backend/plugins/plugin_xep_0059.py Wed Jun 19 18:44:57 2024 +0200 @@ -61,7 +61,7 @@ @return (rsm.RSMRequest, None): request with parsed arguments or None if no RSM arguments have been found """ - if int(extra.get(RSM_PREFIX + 'max', 0)) < 0: + if int(extra.get(RSM_PREFIX + "max", 0)) < 0: raise ValueError(_("rsm_max can't be negative")) rsm_args = {} @@ -122,10 +122,7 @@ if rsm_response is None: # may happen if result set it empty, or we are at the end return None - if ( - rsm_response.count is not None - and rsm_response.index is not None - ): + if rsm_response.count is not None and rsm_response.index is not None: next_index = rsm_response.index + rsm_request.max if next_index >= rsm_response.count: # we have reached the last page @@ -140,13 +137,10 @@ if rsm_response.last is None: if rsm_response.count: - log.warning("Can't do pagination, no \"last\" received") + log.warning('Can\'t do pagination, no "last" received') return None - return rsm.RSMRequest( - max_=rsm_request.max, - after=rsm_response.last - ) + return rsm.RSMRequest(max_=rsm_request.max, after=rsm_response.last) @implementer(iwokkel.IDisco)