def fetch(self):
self.build_service('tasks', 'v1')
timeMin = self.date_dt.isoformat() + 'Z'
timeMax = self.next_date_dt.isoformat() + 'Z'
gt_settings = self.user.get_svc_settings('g_tasks')
tasklist = gt_settings.get('taskList', {}).get("value")
if tasklist:
results = self.service.tasks().list(
tasklist=tasklist,
maxResults=self.limit,
completedMin=timeMin,
completedMax=timeMax).execute()
if results:
logging.debug(results)
items = [
Item(
svc=SERVICE.GTASKS,
title=r.get('title'),
id=r.get('id'),
type=SERVICE.TASK).json() for r in results.get(
'items',
[])]
return items
else:
raise ServiceError("No tasklist configured")
return []
评论列表
文章目录