boilercalendar.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:BoilerPlate 作者: wyaron 项目源码 文件源码
def authenticate():
    global service
    global http_auth
    global calendar

    try:
        # read credentials
        credentials = ServiceAccountCredentials.from_json_keyfile_name(CREDENTIAL_FILE_PATH, scopes)

    # authorize and get the calendar service
    http_auth = credentials.authorize(Http())
    service = discovery.build('calendar', 'v3', http=http_auth)
    calendar = service.calendars().get(calendarId=CALENDAR_ID).execute()
    except:
    logging.getLogger('BoilerLogger').error('failed to authenticate to google calendar service, will retry...')
    init()


# get calendar events in a window sorted by start time
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号