Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/292.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何检索;“共享”;标记gdata.docs.service.DocsService()中的文件夹/文件_Python_Google App Engine_Gdata_Gdata Api - Fatal编程技术网

Python 如何检索;“共享”;标记gdata.docs.service.DocsService()中的文件夹/文件

Python 如何检索;“共享”;标记gdata.docs.service.DocsService()中的文件夹/文件,python,google-app-engine,gdata,gdata-api,Python,Google App Engine,Gdata,Gdata Api,这就是我如何从Google Drive帐户的根目录中检索文件和文件夹列表的方法 我还打印了角色和范围属性来观察差异 query = gdata.docs.service.DocumentQuery( categories=['folder|document'], params={'showfolders': 'true'} ) documents_feed = gd_client.Query(query.ToUri()) if documents_feed : for document_

这就是我如何从Google Drive帐户的根目录中检索文件和文件夹列表的方法

我还打印了
角色
范围
属性来观察差异

query = gdata.docs.service.DocumentQuery( categories=['folder|document'], params={'showfolders': 'true'} )
documents_feed = gd_client.Query(query.ToUri())
if documents_feed :
    for document_entry in documents_feed.entry:
        print document_entry.title.text + ' : ' + document_entry.resourceId.text
        print '<br>'
        acl_feed = gd_client.GetDocumentListAclFeed(document_entry.GetAclLink().href)
        for acl_entry in acl_feed.entry:
            print '%s - %s (%s)' % (acl_entry.role.value, acl_entry.scope.value, acl_entry.scope.type)
query=gdata.docs.service.DocumentQuery(categories=['folder | document'],params={'showfolders':'true'})
documents\u feed=gd\u client.Query(Query.ToUri())
如果文件不可用,请输入:
对于documents\u feed.entry中的document\u条目:
打印文档_entry.title.text+':'+文档_entry.resourceId.text
打印“
” acl_feed=gd_client.GetDocumentListAclFeed(document_entry.GetAclLink().href) 对于acl_feed.entry中的acl_条目: 打印“%s-%s(%s)”%(acl\u entry.role.value、acl\u entry.scope.value、acl\u entry.scope.type)
结果如下:

我假设,标记为“共享”的文件或文件夹将具有
scope.type=default
“网上公开”和“任何有链接的人”之间的区别在于
scope.value中的“reader”属性

虽然我可以循环查看提要条目以获得所有“共享”条目,但我认为我不希望这样做,而且在查询中进行过滤更有效

这件事我已经坚持了好几天了。有人能告诉我这个的正确参数是什么吗