From 82ee250295f02ac2db61a1bbe045ab7686b1892c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Sat, 19 Mar 2022 17:00:03 +0100 Subject: xep_0454: use staticmethods where possible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- slixmpp/plugins/xep_0454/__init__.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/slixmpp/plugins/xep_0454/__init__.py b/slixmpp/plugins/xep_0454/__init__.py index 99e9ff5f..cecde480 100644 --- a/slixmpp/plugins/xep_0454/__init__.py +++ b/slixmpp/plugins/xep_0454/__init__.py @@ -35,8 +35,8 @@ class XEP_0454(BasePlugin): description = 'XEP-0454: OMEMO Media Sharing' dependencies = {'xep_0363'} - @classmethod - def encrypt(cls, input_file: Optional[IO[bytes]] = None, filename: Optional[Path] = None) -> Tuple[bytes, str]: + @staticmethod + def encrypt(input_file: Optional[IO[bytes]] = None, filename: Optional[Path] = None) -> Tuple[bytes, str]: """ Encrypts file as specified in XEP-0454 for use in file sharing @@ -71,8 +71,8 @@ class XEP_0454(BasePlugin): fragment = aes_gcm_iv.hex() + aes_gcm_key.hex() return (payload, fragment) - @classmethod - def decrypt(cls, input_file: IO[bytes], fragment: str) -> bytes: + @staticmethod + def decrypt(input_file: IO[bytes], fragment: str) -> bytes: """ Decrypts file-like. @@ -111,8 +111,8 @@ class XEP_0454(BasePlugin): return plain - @classmethod - def format_url(cls, url: str, fragment: str) -> str: + @staticmethod + def format_url(url: str, fragment: str) -> str: """Helper to format a HTTPS URL to an AESGCM URI""" if not url.startswith('https://') or url.find('#') != -1: raise InvalidURL -- cgit v1.2.3