socializer/src/sessionmanager/vkSessionHandler.py

17 lines
555 B
Python
Raw Normal View History

2016-02-13 17:06:36 -06:00
#!/usr/bin/python
import keys
from vk import API, AuthSession, Session
class vkObject(object):
def __init__(self):
self.api_key = keys.keyring.get_api_key()
def login(self, user, password):
s = AuthSession(app_id=self.api_key, user_login=user, user_password=password, scope="wall, notify, friends, photos, audio, video, docs, notes, pages, status, groups, messages, notifications, stats")
self.client = API(s)
self.client.account.getProfileInfo()
def login_access_token(self, token):
s = Session(access_token=token)
self.client = API(s)