services.py 文件源码

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

项目:cloud-memory 作者: onejgordon 项目源码 文件源码
def fetch(self):
        logging.debug("Fetching google calendar data")
        self.build_service('calendar', 'v3')
        timeMin = self.date_dt.isoformat() + 'Z'
        timeMax = self.next_date_dt.isoformat() + 'Z'
        results = self.service.events().list(calendarId='primary',
                                             maxResults=self.limit,
                                             timeMin=timeMin,
                                             timeMax=timeMax).execute()
        if results:
            items = [
                Item(
                    svc=SERVICE.GCAL,
                    title=r.get('summary'),
                    details=r.get('description'),
                    id=r.get('id'),
                    type=SERVICE.EVENT).json() for r in results.get(
                    'items',
                    [])]
            return items
        return []
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号