Formatting + type hints
This commit is contained in:
parent
1782fc69d1
commit
610eac0718
4 changed files with 15 additions and 13 deletions
|
|
@ -665,7 +665,7 @@ class Memory:
|
|||
to_jid: jid.JID | None,
|
||||
limit: int = C.HISTORY_LIMIT_NONE,
|
||||
between: bool = True,
|
||||
filters: dict[str, str] | None = None,
|
||||
filters: dict[str, str | bool] | None = None,
|
||||
profile: str = C.PROF_KEY_NONE,
|
||||
) -> defer.Deferred[list]:
|
||||
"""Retrieve messages in history
|
||||
|
|
|
|||
|
|
@ -547,13 +547,15 @@ class Storage:
|
|||
@aio
|
||||
async def history_get(
|
||||
self,
|
||||
from_jid: Optional[jid.JID],
|
||||
to_jid: Optional[jid.JID],
|
||||
limit: Optional[int] = None,
|
||||
from_jid: jid.JID | None,
|
||||
to_jid: jid.JID | None,
|
||||
limit: int | None = None,
|
||||
between: bool = True,
|
||||
filters: Optional[Dict[str, str]] = None,
|
||||
profile: Optional[str] = None,
|
||||
) -> List[Tuple[str, int, str, str, Dict[str, str], Dict[str, str], str, str, str]]:
|
||||
filters: dict[str, str | bool] | None = None,
|
||||
profile: str | None = None,
|
||||
) -> list[
|
||||
tuple[str, float, str, str, dict[str, str], dict[str, str], str, dict[str, Any]]
|
||||
]:
|
||||
"""Retrieve messages in history
|
||||
|
||||
@param from_jid: source JID (full, or bare for catchall)
|
||||
|
|
|
|||
|
|
@ -1188,9 +1188,11 @@ class XEP_0277:
|
|||
pass
|
||||
else:
|
||||
# other server, let's try to find a non PEP service there
|
||||
d = defer.ensureDeferred(self.host.find_service_entity(
|
||||
client, "pubsub", "service", parent_service
|
||||
))
|
||||
d = defer.ensureDeferred(
|
||||
self.host.find_service_entity(
|
||||
client, "pubsub", "service", parent_service
|
||||
)
|
||||
)
|
||||
d.addCallback(lambda entity: entity or parent_service)
|
||||
else:
|
||||
# parent is already on a normal Pubsub service, we re-use it
|
||||
|
|
|
|||
|
|
@ -972,9 +972,7 @@ class Preview(base.CommandBase, common.BaseEdit):
|
|||
self.disp(_('File "{file}" doesn\'t exist!').format(file=self.args.file))
|
||||
self.host.quit(C.EXIT_NOT_FOUND)
|
||||
|
||||
self.syntax = await guess_syntax_from_path(
|
||||
self.host, self.content_file_path
|
||||
)
|
||||
self.syntax = await guess_syntax_from_path(self.host, self.content_file_path)
|
||||
|
||||
# at this point the syntax is converted, we can display the preview
|
||||
preview_file = tempfile.NamedTemporaryFile(suffix=".xhtml", delete=False)
|
||||
|
|
|
|||
Loading…
Reference in a new issue