Skip to content

Commit 55285f9

Browse files
committed
Merge pull request #542 from dhermes/sphinx-document-all-public
Sphinx: document all public modules
2 parents 12ac983 + 104f572 commit 55285f9

20 files changed

+124
-88
lines changed

docs/datastore-api.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,16 @@ Connections
2323
:undoc-members:
2424
:show-inheritance:
2525

26+
Interacting with the API
27+
~~~~~~~~~~~~~~~~~~~~~~~~
28+
29+
.. automodule:: gcloud.datastore.api
30+
:members:
31+
:undoc-members:
32+
:show-inheritance:
33+
2634
Helper functions
2735
~~~~~~~~~~~~~~~~
2836

2937
.. automodule:: gcloud.datastore.helpers
30-
:members:
38+
:members:

docs/gcloud-api.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
.. toctree::
2+
:maxdepth: 1
3+
:hidden:
4+
5+
GCloud Package
6+
--------------
7+
8+
:mod:`gcloud`
9+
~~~~~~~~~~~~~
10+
11+
.. automodule:: gcloud.__init__
12+
:members:
13+
:undoc-members:
14+
:show-inheritance:
15+
16+
Connections
17+
~~~~~~~~~~~
18+
19+
.. automodule:: gcloud.connection
20+
:members:
21+
:undoc-members:
22+
:show-inheritance:
23+
24+
Credentials
25+
~~~~~~~~~~~
26+
27+
.. automodule:: gcloud.credentials
28+
:members:
29+
:undoc-members:
30+
:show-inheritance:

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
:maxdepth: 0
33
:hidden:
44

5+
gcloud-api
56
datastore-api
67
datastore-entities
78
datastore-keys

gcloud/credentials.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@ def get_credentials():
2626
which uses this method under the hood.
2727
2828
Checks environment in order of precedence:
29-
- Google App Engine (production and testing)
30-
- Environment variable GOOGLE_APPLICATION_CREDENTIALS pointing to
29+
30+
* Google App Engine (production and testing)
31+
* Environment variable GOOGLE_APPLICATION_CREDENTIALS pointing to
3132
a file with stored credentials information.
32-
- Stored "well known" file associated with ``gcloud`` command line tool.
33-
- Google Compute Engine production environment.
33+
* Stored "well known" file associated with ``gcloud`` command line tool.
34+
* Google Compute Engine production environment.
3435
3536
The file referred to in GOOGLE_APPLICATION_CREDENTIALS is expected to
3637
contain information about credentials that are ready to use. This means
File renamed without changes.

gcloud/datastore/batch.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Local(object):
2121

2222
from gcloud.datastore import _implicit_environ
2323
from gcloud.datastore import helpers
24-
from gcloud.datastore import datastore_v1_pb2 as datastore_pb
24+
from gcloud.datastore import _datastore_v1_pb2 as datastore_pb
2525

2626

2727
class _Batches(Local):
@@ -164,7 +164,7 @@ def mutation(self):
164164
This getter returns the Mutation protobuf that
165165
has been built-up so far.
166166
167-
:rtype: :class:`gcloud.datastore.datastore_v1_pb2.Mutation`
167+
:rtype: :class:`gcloud.datastore._datastore_v1_pb2.Mutation`
168168
:returns: The Mutation protobuf to be sent in the commit request.
169169
"""
170170
return self._mutation
@@ -286,7 +286,7 @@ def _assign_entity_to_mutation(mutation_pb, entity, auto_id_entities):
286286
287287
Helper method for ``Batch.put``.
288288
289-
:type mutation_pb: :class:`gcloud.datastore.datastore_v1_pb2.Mutation`
289+
:type mutation_pb: :class:`gcloud.datastore._datastore_v1_pb2.Mutation`
290290
:param mutation_pb; the Mutation protobuf for the batch / transaction.
291291
292292
:type entity: :class:`gcloud.datastore.entity.Entity`

gcloud/datastore/connection.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import six
1818

1919
from gcloud import connection
20-
from gcloud.datastore import datastore_v1_pb2 as datastore_pb
20+
from gcloud.datastore import _datastore_v1_pb2 as datastore_pb
2121
from gcloud.datastore import helpers
2222

2323

@@ -132,8 +132,8 @@ def lookup(self, dataset_id, key_pbs,
132132
Maps the ``DatastoreService.Lookup`` protobuf RPC.
133133
134134
This method deals only with protobufs
135-
(:class:`gcloud.datastore.datastore_v1_pb2.Key` and
136-
:class:`gcloud.datastore.datastore_v1_pb2.Entity`) and is used
135+
(:class:`gcloud.datastore._datastore_v1_pb2.Key` and
136+
:class:`gcloud.datastore._datastore_v1_pb2.Entity`) and is used
137137
under the hood in :func:`gcloud.datastore.get`:
138138
139139
>>> from gcloud import datastore
@@ -150,7 +150,7 @@ def lookup(self, dataset_id, key_pbs,
150150
:type dataset_id: string
151151
:param dataset_id: The ID of the dataset to look up the keys.
152152
153-
:type key_pbs: list of :class:`gcloud.datastore.datastore_v1_pb2.Key`
153+
:type key_pbs: list of :class:`gcloud.datastore._datastore_v1_pb2.Key`
154154
(or a single Key)
155155
:param key_pbs: The key (or keys) to retrieve from the datastore.
156156
@@ -174,7 +174,7 @@ def lookup(self, dataset_id, key_pbs,
174174
the given transaction. Incompatible with
175175
``eventual==True``.
176176
177-
:rtype: list of :class:`gcloud.datastore.datastore_v1_pb2.Entity`
177+
:rtype: list of :class:`gcloud.datastore._datastore_v1_pb2.Entity`
178178
(or a single Entity)
179179
:returns: The entities corresponding to the keys provided.
180180
If a single key was provided and no results matched,
@@ -257,7 +257,7 @@ def run_query(self, dataset_id, query_pb, namespace=None,
257257
:type dataset_id: string
258258
:param dataset_id: The ID of the dataset over which to run the query.
259259
260-
:type query_pb: :class:`gcloud.datastore.datastore_v1_pb2.Query`
260+
:type query_pb: :class:`gcloud.datastore._datastore_v1_pb2.Query`
261261
:param query_pb: The Protobuf representing the query to run.
262262
263263
:type namespace: string
@@ -302,7 +302,7 @@ def begin_transaction(self, dataset_id, serializable=False):
302302
transaction should be SERIALIZABLE (True) or
303303
SNAPSHOT (False).
304304
305-
:rtype: :class:`.datastore_v1_pb2.BeginTransactionResponse`
305+
:rtype: :class:`._datastore_v1_pb2.BeginTransactionResponse`
306306
:returns': the result protobuf for the begin transaction request.
307307
"""
308308
request = datastore_pb.BeginTransactionRequest()
@@ -327,15 +327,15 @@ def commit(self, dataset_id, mutation_pb, transaction_id=None):
327327
:type dataset_id: string
328328
:param dataset_id: The ID dataset to which the transaction applies.
329329
330-
:type mutation_pb: :class:`gcloud.datastore.datastore_v1_pb2.Mutation`.
330+
:type mutation_pb: :class:`datastore_pb.Mutation`.
331331
:param mutation_pb: The protobuf for the mutations being saved.
332332
333333
:type transaction_id: string
334334
:param transaction_id: The transaction ID returned from
335335
:meth:`begin_transaction`. If not passed, the
336336
commit will be non-transactional.
337337
338-
:rtype: :class:`gcloud.datastore.datastore_v1_pb2.MutationResult`.
338+
:rtype: :class:`gcloud.datastore._datastore_v1_pb2.MutationResult`.
339339
:returns': the result protobuf for the mutation.
340340
"""
341341
request = datastore_pb.CommitRequest()
@@ -379,10 +379,10 @@ def allocate_ids(self, dataset_id, key_pbs):
379379
:param dataset_id: The ID of the dataset to which the transaction
380380
belongs.
381381
382-
:type key_pbs: list of :class:`gcloud.datastore.datastore_v1_pb2.Key`
382+
:type key_pbs: list of :class:`gcloud.datastore._datastore_v1_pb2.Key`
383383
:param key_pbs: The keys for which the backend should allocate IDs.
384384
385-
:rtype: list of :class:`gcloud.datastore.datastore_v1_pb2.Key`
385+
:rtype: list of :class:`gcloud.datastore._datastore_v1_pb2.Key`
386386
:returns: An equal number of keys, with IDs filled in by the backend.
387387
"""
388388
request = datastore_pb.AllocateIdsRequest()

gcloud/datastore/helpers.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import pytz
2626
import six
2727

28-
from gcloud.datastore import datastore_v1_pb2 as datastore_pb
28+
from gcloud.datastore import _datastore_v1_pb2 as datastore_pb
2929
from gcloud.datastore.entity import Entity
3030
from gcloud.datastore.key import Key
3131

@@ -38,7 +38,7 @@ def entity_from_protobuf(pb):
3838
The protobuf should be one returned from the Cloud Datastore
3939
Protobuf API.
4040
41-
:type pb: :class:`gcloud.datastore.datastore_v1_pb2.Entity`
41+
:type pb: :class:`gcloud.datastore._datastore_v1_pb2.Entity`
4242
:param pb: The Protobuf representing the entity.
4343
4444
:rtype: :class:`gcloud.datastore.entity.Entity`
@@ -60,7 +60,7 @@ def key_from_protobuf(pb):
6060
The protobuf should be one returned from the Cloud Datastore
6161
Protobuf API.
6262
63-
:type pb: :class:`gcloud.datastore.datastore_v1_pb2.Key`
63+
:type pb: :class:`gcloud.datastore._datastore_v1_pb2.Key`
6464
:param pb: The Protobuf representing the key.
6565
6666
:rtype: :class:`gcloud.datastore.key.Key`
@@ -161,7 +161,7 @@ def _get_value_from_value_pb(value_pb):
161161
Some work is done to coerce the return value into a more useful type
162162
(particularly in the case of a timestamp value, or a key value).
163163
164-
:type value_pb: :class:`gcloud.datastore.datastore_v1_pb2.Value`
164+
:type value_pb: :class:`gcloud.datastore._datastore_v1_pb2.Value`
165165
:param value_pb: The Value Protobuf.
166166
167167
:returns: The value provided by the Protobuf.
@@ -210,7 +210,7 @@ def _get_value_from_property_pb(property_pb):
210210
Some work is done to coerce the return value into a more useful type
211211
(particularly in the case of a timestamp value, or a key value).
212212
213-
:type property_pb: :class:`gcloud.datastore.datastore_v1_pb2.Property`
213+
:type property_pb: :class:`gcloud.datastore._datastore_v1_pb2.Property`
214214
:param property_pb: The Property Protobuf.
215215
216216
:returns: The value provided by the Protobuf.
@@ -227,7 +227,7 @@ def _set_protobuf_value(value_pb, val):
227227
Some value types (entities, keys, lists) cannot be directly
228228
assigned; this function handles them correctly.
229229
230-
:type value_pb: :class:`gcloud.datastore.datastore_v1_pb2.Value`
230+
:type value_pb: :class:`gcloud.datastore._datastore_v1_pb2.Value`
231231
:param value_pb: The value protobuf to which the value is being assigned.
232232
233233
:type val: `datetime.datetime`, boolean, float, integer, string,
@@ -264,10 +264,10 @@ def _set_protobuf_value(value_pb, val):
264264
def _prepare_key_for_request(key_pb):
265265
"""Add protobuf keys to a request object.
266266
267-
:type key_pb: :class:`gcloud.datastore.datastore_v1_pb2.Key`
267+
:type key_pb: :class:`gcloud.datastore._datastore_v1_pb2.Key`
268268
:param key_pb: A key to be added to a request.
269269
270-
:rtype: :class:`gcloud.datastore.datastore_v1_pb2.Key`
270+
:rtype: :class:`gcloud.datastore._datastore_v1_pb2.Key`
271271
:returns: A key which will be added to a request. It will be the
272272
original if nothing needs to be changed.
273273
"""
@@ -294,7 +294,7 @@ def _add_keys_to_request(request_field_pb, key_pbs):
294294
:type request_field_pb: `RepeatedCompositeFieldContainer`
295295
:param request_field_pb: A repeated proto field that contains keys.
296296
297-
:type key_pbs: list of :class:`gcloud.datastore.datastore_v1_pb2.Key`
297+
:type key_pbs: list of :class:`gcloud.datastore._datastore_v1_pb2.Key`
298298
:param key_pbs: The keys to add to a request.
299299
"""
300300
for key_pb in key_pbs:

gcloud/datastore/key.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import six
2020

2121
from gcloud.datastore import _implicit_environ
22-
from gcloud.datastore import datastore_v1_pb2 as datastore_pb
22+
from gcloud.datastore import _datastore_v1_pb2 as datastore_pb
2323

2424

2525
class Key(object):
@@ -197,7 +197,7 @@ def completed_key(self, id_or_name):
197197
def to_protobuf(self):
198198
"""Return a protobuf corresponding to the key.
199199
200-
:rtype: :class:`gcloud.datastore.datastore_v1_pb2.Key`
200+
:rtype: :class:`gcloud.datastore._datastore_v1_pb2.Key`
201201
:returns: The protobuf representing the key.
202202
"""
203203
key = datastore_pb.Key()

gcloud/datastore/query.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import base64
1818

1919
from gcloud.datastore import _implicit_environ
20-
from gcloud.datastore import datastore_v1_pb2 as datastore_pb
20+
from gcloud.datastore import _datastore_v1_pb2 as datastore_pb
2121
from gcloud.datastore import helpers
2222
from gcloud.datastore.key import Key
2323
from gcloud.datastore.transaction import Transaction
@@ -432,7 +432,7 @@ def _pb_from_query(query):
432432
:type query: :class:`Query`
433433
:param query: The source query.
434434
435-
:rtype: :class:`gcloud.datastore.datastore_v1_pb2.Query`
435+
:rtype: :class:`gcloud.datastore._datastore_v1_pb2.Query`
436436
:returns: A protobuf that can be sent to the protobuf API. N.b. that
437437
it does not contain "in-flight" fields for ongoing query
438438
executions (cursors, offset, limit).

0 commit comments

Comments
 (0)