我正在使用以下代码检查 Drive 的更改:
deltaDict = drive_service.changes().list(includeDeleted = True, startChangeId = driveRC.deltaCursor).execute()
if not str(driveRC.deltaCursor) == str(deltaDict['largestChangeId']):
print '*** Change Detected ***'
fileItems = deltaDict['items']
for item in fileItems:
isDeleted = item['deleted']
theFile = item['file']
fileID = theFile['id']
fileLabels = theFile['labels']
fileName = theFile['title']
isTrashed = fileLabels['trashed']
这在一段时间内运行良好。但是,目前,我看到了错误:
theFile = item['file']
KeyError: 'file'
但是查看文档在我看来它应该可以工作吗?谁能发现我错过了什么?提前感谢您的帮助。