From b6644a1a13c3037ed890be19331c73f9d24a15ed Mon Sep 17 00:00:00 2001 From: Danny Hermes Date: Wed, 1 Oct 2014 16:32:02 -0700 Subject: [PATCH] Resolving all sphinx warnings and parse errors. --- docs/conf.py | 2 +- docs/index.rst | 8 +++++++- gcloud/datastore/key.py | 30 +++++++++++++++++------------- gcloud/datastore/query.py | 2 +- 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index c781df3fdb52f..c99448c52f5b2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -69,7 +69,7 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -exclude_patterns = ['_build'] +exclude_patterns = ['_build', '_components/*'] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None diff --git a/docs/index.rst b/docs/index.rst index aa382ee8abab7..9bcd92c6058ef 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -3,9 +3,15 @@ .. toctree:: :hidden: + common-api datastore-api + datastore-getting-started + datastore-quickstart + getting-started storage-api - common-api + storage-getting-started + storage-quickstart + Google Cloud Python API ======================= diff --git a/gcloud/datastore/key.py b/gcloud/datastore/key.py index fc01acd17a66c..40cd81de05133 100644 --- a/gcloud/datastore/key.py +++ b/gcloud/datastore/key.py @@ -8,6 +8,8 @@ class Key(object): """ An immutable representation of a datastore Key. + + .. automethod:: __init__ """ def __init__(self, dataset=None, namespace=None, path=None): @@ -52,7 +54,7 @@ def from_protobuf(cls, pb, dataset=None): :type dataset: :class:`gcloud.datastore.dataset.Dataset` :param dataset: A dataset instance. If not passed, defaults to an - instance whose ID is derived from pb. + instance whose ID is derived from pb. :rtype: :class:`gcloud.datastore.key.Key` :returns: a new `Key` instance @@ -116,17 +118,18 @@ def to_protobuf(self): def from_path(cls, *args, **kwargs): """Factory method for creating a key based on a path. - :type args: :class:`tuple - :param args: sequence of even length, where the first of each - pair is a string representing the 'kind' of the path element, and the - second of the pair is either a string (for the path element's name) - or an integer (for its id). + :type args: :class:`tuple` + :param args: sequence of even length, where the first of each pair is a + string representing the 'kind' of the path element, and the + second of the pair is either a string (for the path + element's name) or an integer (for its id). :type kwargs: :class:`dict` - :param kwargs: Other named parameters which can be passed to `__init__()`. + :param kwargs: Other named parameters which can be passed to + :func:`Key.__init__`. :rtype: :class:`gcloud.datastore.key.Key` - :returns: a new `Key` instance + :returns: a new :class:`Key` instance """ if len(args) % 2: raise ValueError('Must pass an even number of args.') @@ -150,7 +153,7 @@ def is_partial(self): :rtype: :class:`bool` :returns: True if the last element of the key's path does not have an 'id' - or a 'name'. + or a 'name'. """ return (self.id_or_name() is None) @@ -194,11 +197,11 @@ def path(self, path=None): :type path: sequence of dicts :param path: Each dict must have keys 'kind' (a string) and optionally - 'name' (a string) or 'id' (an integer). + 'name' (a string) or 'id' (an integer). :rtype: :class:`Key` (for setter); or :class:`str` (for getter) :returns: a new key, cloned from self., with the given path (setter); - or self's path (getter). + or self's path (getter). """ if path: clone = self._clone() @@ -263,7 +266,7 @@ def id_or_name(self): :rtype: :class:`int` (if 'id' is set); or :class:`str` (the 'name') :returns: True if the last element of the key's path has either an 'id' - or a 'name'. + or a 'name'. """ return self.id() or self.name() @@ -272,7 +275,8 @@ def parent(self): # pragma NO COVER :rtype: :class:`gcloud.datastore.key.Key` :returns: a new `Key` instance, whose path consists of all but the last - element of self's path. If self has only one path element, return None. + element of self's path. If self has only one path element, + return None. """ if len(self._path) <= 1: return None diff --git a/gcloud/datastore/query.py b/gcloud/datastore/query.py index 4b67333b3cbec..bf8b5a00e816c 100644 --- a/gcloud/datastore/query.py +++ b/gcloud/datastore/query.py @@ -148,7 +148,7 @@ def ancestor(self, ancestor): >>> query = dataset.query('Person') >>> filtered_query = query.ancestor(['Person', '1']) - Each call to ``.ancestor()`` returns a cloned :class:`Query:, + Each call to ``.ancestor()`` returns a cloned :class:`Query`, however a query may only have one ancestor at a time. :type ancestor: :class:`gcloud.datastore.key.Key` or list