Снова всем привет. Таки я достучался до всей этой хрени и даже авторизовался, но, блин, у меня проблемы связанные с расхождением в документации.
Цитата("Google")
from apiclient.discovery import build
service = build('api_name', 'api_version', ...)
collection = service.stamps()
or
nested_collection = service.featured().stamps()
АЗАЗАЗАЗАЗАААЗЗЗЗЗ....
Но, ассемблер их дери:
gc = build('calendar', 'v3', http=http_auth)
collection = gc.stamps()
Цитата("Консоль")
AttributeError: 'Resource' object has no attribute 'stamps'
А все почему - потому что:
$ python
>>> help()
help> apiclient.discovery.Resource
apiclient.discovery.Resource = class Resource(__builtin__.object)
| A class for interacting with a resource.
|
| Methods defined here:
|
| __getstate__(self)
| Trim the state down to something that can be pickled.
|
| Uses the fact that the instance variable _dynamic_attrs holds attrs that
| will be wiped and restored on pickle serialization.
|
| __init__(self, http, baseUrl, model, requestBuilder, developerKey, resourceDesc, rootDesc, schema)
| Build a Resource from the API description.
|
| Args:
| http: httplib2.Http, Object to make http requests with.
| baseUrl: string, base URL for the API. All requests are relative to this
| URI.
| model: apiclient.Model, converts to and from the wire format.
| requestBuilder: class or callable that instantiates an
| apiclient.HttpRequest object.
| developerKey: string, key obtained from
| https://code.google.com/apis/console
| resourceDesc: object, section of deserialized discovery document that
| describes a resource. Note that the top level discovery document
| is considered a resource.
| rootDesc: object, the entire deserialized discovery document.
| schema: object, mapping of schema names to schema descriptions.
|
| __setstate__(self, state)
| Reconstitute the state of the object from being pickled.
|
| Uses the fact that the instance variable _dynamic_attrs holds attrs that
| will be wiped and restored on pickle serialization.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
И у него тупо нет этих методов/атрибутов.
Как с этим бороться?
Решил сделать интроспекцию по модулю ... о мой мозг....
Еще раз всем спасибо за помощь.