cq: Format with black and isort

This commit is contained in:
Philipp Hörist
2025-01-25 19:15:37 +01:00
parent e6e71d82bf
commit 841b1fb25e
44 changed files with 1641 additions and 1660 deletions

View File

@@ -1,13 +1,12 @@
from __future__ import annotations
def parse_uid(uid: str, compat=False) -> str:
if uid.startswith('xmpp:'):
if uid.startswith("xmpp:"):
return uid[5:]
# Compat with uids of form "Name <xmpp:my@jid.com>"
if compat and '<xmpp:' in uid and uid.endswith('>'):
return uid[:-1].split('<xmpp:', maxsplit=1)[1]
if compat and "<xmpp:" in uid and uid.endswith(">"):
return uid[:-1].split("<xmpp:", maxsplit=1)[1]
raise ValueError('Uknown UID format: %s' % uid)
raise ValueError("Uknown UID format: %s" % uid)