mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2026-02-10 09:06:21 +01:00
Making it pretty
This commit is contained in:
19
services/eveapi_manager.py
Normal file
19
services/eveapi_manager.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import evelink.api
|
||||
import evelink.char
|
||||
import evelink.eve
|
||||
|
||||
|
||||
class EveApiManager():
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
|
||||
def get_characters_from_api(self, api_id, api_key):
|
||||
api = evelink.api.API(api_key=(api_id, api_key))
|
||||
# Should get characters
|
||||
account = evelink.account.Account(api=api)
|
||||
chars = account.characters()
|
||||
|
||||
return chars
|
||||
|
||||
@@ -12,23 +12,23 @@ class JabberManager():
|
||||
print str(username)
|
||||
print str(password)
|
||||
api.add_user(self.__santatize_username(username), str(password))
|
||||
|
||||
|
||||
def delete_user(self, username):
|
||||
api = UserService(settings.OPENFIRE_ADDRESS, settings.OPENFIRE_SECRET_KEY)
|
||||
api.delete_user(username)
|
||||
|
||||
|
||||
def lock_user(self, username):
|
||||
api = UserService(settings.OPENFIRE_ADDRESS, settings.OPENFIRE_SECRET_KEY)
|
||||
api.lock_user(username)
|
||||
|
||||
|
||||
def unlock_user(self, username):
|
||||
api = UserService(settings.OPENFIRE_ADDRESS, settings.OPENFIRE_SECRET_KEY)
|
||||
api.unlock_user(username)
|
||||
|
||||
|
||||
def update_user_pass(self, username, password):
|
||||
api = UserService(settings.OPENFIRE_ADDRESS, settings.OPENFIRE_SECRET_KEY)
|
||||
api.update_user(username, password)
|
||||
|
||||
|
||||
def __santatize_username(self, username):
|
||||
sanatized = username.replace(" ","_")
|
||||
return sanatized.lower()
|
||||
Reference in New Issue
Block a user