diff options
Diffstat (limited to 'api.py')
-rw-r--r-- | api.py | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -9,6 +9,7 @@ class EjabberdApi: """ class to interact with the ejabberd rest/ xmlrpc api """ + def __init__(self, url, login=None, api: str = "rpc"): # api variables self._login = login @@ -25,7 +26,7 @@ class EjabberdApi: @property def _auth(self) -> (str, None): if self._login is not None: - return f"{self._login['user']}@{self._login['server']}", self._login['password'] + return f"{self._login['user']}@{self._login['server']}", self._login["password"] return None def _rest(self, command: str, data) -> dict: @@ -34,7 +35,7 @@ class EjabberdApi: self.session.auth = self._auth # post - r = self.session.post('/'.join([self._url, command]), json=data) + r = self.session.post("/".join([self._url, command]), json=data) # proceed if response is ok if r.ok: @@ -52,6 +53,6 @@ class EjabberdApi: return fn(self._login, data) return fn(data) - except: + except: # noqa: E722 # this needs to be more specific return {} |