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