我目前正試圖構建一個與谷歌的API的交互腳本,但我不斷收到屬性錯誤:AttributeError的:「DocsClient」對象有沒有屬性「GetDocumentListFeed」
Traceback (most recent call last):
File "service_catalog_automation.py", line 18, in <module>
feed = client.GetDocumentListFeed()
AttributeError: 'DocsClient' object has no attribute 'GetDocumentListFeed'
這是我的代碼「M欲以代碼
import gdata.gauth
import gdata.docs.client
import sys
def sys_print(text):
sys.stdout.write(str(text))
sys.stdout.flush()
CONSUMER_KEY = 'domain.com'
CONSUMER_SECRET = 'abcde1234'
requestor_id = '[email protected]'
client = gdata.docs.client.DocsClient(source='my-script-v1')
client.auth_token = gdata.gauth.TwoLeggedOAuthHmacToken(
CONSUMER_KEY, CONSUMER_SECRET, requestor_id)
# Retrieve user's list of Google Docs
feed = client.GetDocumentListFeed()
for entry in feed.entry:
sys_print(entry.title.text)
sys_print('\n')
我已經被拉client.getDocumentListFeed()部分從它們的示例代碼here和甚至嘗試使用下2LeggedOAuth部here其樣本代碼最低限度的方法。 (我也從這個例子試圖GetDocList()使用相同的錯誤)
我已經下載了谷歌的GData-python的客戶端到Linux虛擬機的主目錄,並通過運行python setup.py install
安裝並運行測試蟒蛇all_tests.py
有沒有錯誤。
任何幫助將大大apperciated
,他們」重新分配他們的客戶端對象作爲'gdata.docs.service.DocsService()'的返回。這似乎意味着'gd_client'的類型是'DocsService',而不是'DocsClient' –