Skip to content

Commit f4fc666

Browse files
Kevin LeyowKevin Leyow
authored andcommitted
Reverted summary lines and changed closing brackets for addibility.
1 parent b8a989f commit f4fc666

18 files changed

+239
-124
lines changed

gcloud/datastore/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ def get_connection(client_email, private_key_path):
7171

7272

7373
def get_dataset(dataset_id, client_email, private_key_path):
74-
"""Shortcut method to establish a connection to a particular
75-
dataset in the Cloud Datastore.
74+
"""Shortcut method to establish a connection to a particular dataset in the Cloud Datastore.
7675
7776
You'll generally use this as the first call to working with the API:
7877

gcloud/datastore/connection.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ def _request(self, dataset_id, method, data):
7272
"""
7373
headers = {
7474
'Content-Type': 'application/x-protobuf',
75-
'Content-Length': str(len(data)), }
75+
'Content-Length': str(len(data)),
76+
}
7677
headers, content = self.http.request(
7778
uri=self.build_api_url(dataset_id=dataset_id, method=method),
7879
method='POST', headers=headers, body=data)
@@ -98,7 +99,7 @@ def build_api_url(cls, dataset_id, method, base_url=None, api_version=None):
9899
99100
:type dataset_id: string
100101
:param dataset_id: The ID of the dataset to connect to.
101-
This is usually your project name in the cloud console.
102+
This is usually your project name in the cloud console.
102103
103104
:type method: string
104105
:param method: The API method to call (ie, runQuery, lookup, ...).
@@ -133,7 +134,7 @@ def dataset(self, *args, **kwargs):
133134
"""Factory method for Dataset objects.
134135
135136
:param args: All args and kwargs will be passed along to the
136-
:class:`gcloud.datastore.dataset.Dataset` initializer.
137+
:class:`gcloud.datastore.dataset.Dataset` initializer.
137138
138139
:rtype: :class:`gcloud.datastore.dataset.Dataset`
139140
:returns: A dataset object that will use this connection as its transport.

gcloud/datastore/dataset.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ def get_entities(self, keys):
9191

9292
entity_pbs = self.connection().lookup(
9393
dataset_id=self.id(),
94-
key_pbs=[k.to_protobuf() for k in keys])
94+
key_pbs=[k.to_protobuf() for k in keys]
95+
)
9596

9697
entities = []
9798
for entity_pb in entity_pbs:

gcloud/datastore/entity.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class Entity(dict):
4444
<Entity[{'kind': 'MyEntityKind'}] {}>
4545
4646
- :func:`gcloud.datastore.dataset.Dataset.get_entity`
47-
to retrive an existing entity.
47+
to retrive an existing entity.
4848
4949
>>> dataset.get_entity(key)
5050
<Entity[{'kind': 'EntityKind', id: 1234}] {'property': 'value'}>
@@ -71,8 +71,7 @@ def __init__(self, dataset=None, kind=None):
7171
self._key = None
7272

7373
def dataset(self):
74-
"""Get the :class:`gcloud.datastore.dataset.Dataset`
75-
in which this entity belonds.
74+
"""Get the :class:`gcloud.datastore.dataset.Dataset` in which this entity belongs.
7675
7776
.. note::
7877
This is based on the :class:`gcloud.datastore.key.Key` set on the entity.
@@ -120,14 +119,13 @@ def kind(self):
120119

121120
@classmethod
122121
def from_key(cls, key):
123-
"""Factory method for creating an entity based on the
124-
:class:`gcloud.datastore.key.Key`.
122+
"""Factory method for creating an entity based on the :class:`gcloud.datastore.key.Key`.
125123
126124
:type key: :class:`gcloud.datastore.key.Key`
127125
:param key: The key for the entity.
128126
129127
:returns: The :class:`Entity` derived from the
130-
:class:`gcloud.datastore.key.Key`.
128+
:class:`gcloud.datastore.key.Key`.
131129
"""
132130

133131
return cls().key(key)
@@ -139,10 +137,10 @@ def from_protobuf(cls, pb, dataset=None):
139137
The protobuf should be one returned from the Cloud Datastore Protobuf API.
140138
141139
:type key: :class:`gcloud.datastore.datastore_v1_pb2.Entity`
142-
:param key: The Protobuf representing the entity.
140+
:param key: The Protobuf representing the entity.
143141
144142
:returns: The :class:`Entity` derived from the
145-
:class:`gcloud.datastore.datastore_v1_pb2.Entity`.
143+
:class:`gcloud.datastore.datastore_v1_pb2.Entity`.
146144
"""
147145

148146
# This is here to avoid circular imports.

gcloud/datastore/query.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ class Query(object):
4646
'<=': datastore_pb.PropertyFilter.LESS_THAN_OR_EQUAL,
4747
'>': datastore_pb.PropertyFilter.GREATER_THAN,
4848
'>=': datastore_pb.PropertyFilter.GREATER_THAN_OR_EQUAL,
49-
'=': datastore_pb.PropertyFilter.EQUAL, }
49+
'=': datastore_pb.PropertyFilter.EQUAL,
50+
}
5051
"""Mapping of operator strings and their protobuf equivalents."""
5152

5253
def __init__(self, kind=None, dataset=None):
@@ -62,8 +63,7 @@ def _clone(self):
6263
return clone
6364

6465
def to_protobuf(self):
65-
"""Convert the :class:`Query` instance to a
66-
:class:`gcloud.datastore.datastore_v1_pb2.Query`.
66+
"""Convert the :class:`Query` instance to a :class:`gcloud.datastore.datastore_v1_pb2.Query`.
6767
6868
:rtype: :class:`gclouddatstore.datastore_v1_pb2.Query`
6969
:returns: A Query protobuf that can be sent to the protobuf API.

gcloud/datastore/test___init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ def test_it(self):
2828
self.assertEqual(client._called_with,
2929
{'service_account_name': CLIENT_EMAIL,
3030
'private_key': PRIVATE_KEY,
31-
'scope': SCOPE, })
31+
'scope': SCOPE,
32+
}
33+
)
3234

3335

3436
class Test_get_dataset(unittest2.TestCase):
@@ -61,4 +63,6 @@ def test_it(self):
6163
self.assertEqual(client._called_with,
6264
{'service_account_name': CLIENT_EMAIL,
6365
'private_key': PRIVATE_KEY,
64-
'scope': SCOPE, })
66+
'scope': SCOPE,
67+
}
68+
)

0 commit comments

Comments
 (0)