Skip to content

Commit

Permalink
Resolving all sphinx warnings and parse errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
dhermes committed Oct 1, 2014
1 parent daef27d commit b6644a1
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
=======================
Expand Down
30 changes: 17 additions & 13 deletions gcloud/datastore/key.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.')
Expand All @@ -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)

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gcloud/datastore/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b6644a1

Please sign in to comment.