aboutsummaryrefslogtreecommitdiffstats
path: root/api.py
diff options
context:
space:
mode:
Diffstat (limited to 'api.py')
-rw-r--r--api.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/api.py b/api.py
index b14fa52..3372976 100644
--- a/api.py
+++ b/api.py
@@ -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: