This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mendeley import Mendeley | |
from mendeley.exception import MendeleyException | |
from mendeley.session import MendeleySession | |
# extending the MendeleySession class to do auto-token-refresh on | |
# token expiration. Mendeley access tokens expire after 1 hour. | |
class AutoRefreshMendeleySession(MendeleySession): | |
def __init__(self, mendeley, token, refresh_token): | |
super(AutoRefreshMendeleySession, self).__init__(mendeley, token) | |
# silly name to avoid namespace collision with oauth refresh_token() method |