Reformatted code base using black.

This commit is contained in:
Goffi 2024-06-19 18:44:57 +02:00
commit 53fdaa9d09

View file

@ -84,10 +84,7 @@ class XEP_0191:
return XEP_0191_Handler(self)
@ensure_deferred
async def _block_list(
self,
profile_key=C.PROF_KEY_NONE
) -> List[str]:
async def _block_list(self, profile_key=C.PROF_KEY_NONE) -> List[str]:
client = self.host.get_client(profile_key)
blocked_jids = await self.block_list(client)
return [j.full() for j in blocked_jids]
@ -113,11 +110,7 @@ class XEP_0191:
return blocked_jids
def _block(
self,
entities: List[str],
profile_key: str = C.PROF_KEY_NONE
) -> str:
def _block(self, entities: List[str], profile_key: str = C.PROF_KEY_NONE) -> str:
client = self.host.get_client(profile_key)
return defer.ensureDeferred(
self.block(client, [jid.JID(entity) for entity in entities])
@ -132,15 +125,9 @@ class XEP_0191:
item_elt["jid"] = entity.full()
await iq_elt.send()
def _unblock(
self,
entities: List[str],
profile_key: str = C.PROF_KEY_NONE
) -> None:
def _unblock(self, entities: List[str], profile_key: str = C.PROF_KEY_NONE) -> None:
client = self.host.get_client(profile_key)
return defer.ensureDeferred(
self.unblock(client, [jid.JID(e) for e in entities])
)
return defer.ensureDeferred(self.unblock(client, [jid.JID(e) for e in entities]))
async def unblock(self, client: SatXMPPEntity, entities: List[jid.JID]) -> None:
await self.host.check_feature(client, NS_BLOCKING)
@ -192,15 +179,10 @@ class XEP_0191_Handler(xmlstream.XMPPHandler):
def connectionInitialized(self):
self.xmlstream.addObserver(
IQ_BLOCK_PUSH,
self.plugin_parent.on_block_push,
client=self.parent
IQ_BLOCK_PUSH, self.plugin_parent.on_block_push, client=self.parent
)
self.xmlstream.addObserver(
IQ_UNBLOCK_PUSH,
self.plugin_parent.on_unblock_push,
client=self.parent
IQ_UNBLOCK_PUSH, self.plugin_parent.on_unblock_push, client=self.parent
)
def getDiscoInfo(self, requestor, service, nodeIdentifier=""):