Ejemplo n.º 1
0
def get_credentials():
    # To disable the local server feature, uncomment the following line:

    # If the Credentials don't exist or are invalid, run through the native client
    # flow. The Storage object will ensure that if successful the good
    # Credentials will get written back to a file.
    storage = Storage(CALENDAR_DATA)
    credentials = storage.get()
    if credentials is None or credentials.invalid:
        credentials = run(FLOW,storage)
    return credentials
Ejemplo n.º 2
0
def get_credentials():
    # To disable the local server feature, uncomment the following line:

    # If the Credentials don't exist or are invalid, run through the native client
    # flow. The Storage object will ensure that if successful the good
    # Credentials will get written back to a file.
    storage = Storage(CALENDAR_DATA)
    credentials = storage.get()
    if credentials is None or credentials.invalid:
        credentials = run(FLOW, storage)
    return credentials
Ejemplo n.º 3
0
def get_credentials():
    """
    Retrieves the locally stored credentials. If they are invalid/expired, get a new set using the refresh token and store them locally.
    """
    # If the Credentials don't exist or are invalid, run through the native client
    # flow. The Storage object will ensure that if successful the good
    # Credentials will get written back to a file.
    storage = Storage(CALENDAR_DATA)
    credentials = storage.get()
    if credentials is None or credentials.invalid:
        credentials = run(FLOW,storage)
    return credentials
Ejemplo n.º 4
0
def get_credentials():
    """
    Retrieves the locally stored credentials. If they are invalid/expired, get
    a new set using the refresh token and store them locally.
    """
    # If the Credentials don't exist or are invalid, run through the native
    # client flow. The Storage object will ensure that if successful the good
    # Credentials will get written back to a file.
    storage = Storage(CALENDAR_DATA)
    credentials = storage.get()
    if credentials is None or credentials.invalid:
        credentials = run(FLOW, storage)
    return credentials