Skip to content

Commit 5efa5f1

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

8 files changed

Lines changed: 21 additions & 25 deletions

File tree

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/entity.py

Lines changed: 5 additions & 7 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,7 +137,7 @@ 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
145143
:class:`gcloud.datastore.datastore_v1_pb2.Entity`.

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/storage/acl.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,7 @@ def save(self):
379379

380380

381381
class DefaultObjectACL(BucketACL):
382-
"""A subclass of BucketACL representing the
383-
default object ACL for a bucket."""
382+
"""A subclass of BucketACL representing the default object ACL for a bucket."""
384383

385384
def save(self):
386385
"""Save this ACL as the default object ACL for the current bucket."""

gcloud/storage/bucket.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ def get_all_keys(self):
102102
return list(self)
103103

104104
def new_key(self, key):
105-
"""Given a path name (or a Key), return a :class:`gcloud.storage.key.Key`
106-
object.
105+
"""Given a path name (or a Key), return a :class:`gcloud.storage.key.Key` object.
107106
108107
This is really useful when you're not sure
109108
if you have a Key object or a string path name.

gcloud/storage/iterator.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ def __init__(self, connection):
146146
super(BucketIterator, self).__init__(connection=connection, path='/b')
147147

148148
def get_items_from_response(self, response):
149-
"""Factory method which yields :class:`gcloud.storage.bucket.Bucket`
150-
items from a response.
149+
"""Factory method which yields :class:`gcloud.storage.bucket.Bucket` items from a response.
151150
152151
:type response: dict
153152
:param response: The JSON API response for a page of buckets.
@@ -175,8 +174,7 @@ def __init__(self, bucket):
175174
connection=bucket.connection, path=bucket.path + '/o')
176175

177176
def get_items_from_response(self, response):
178-
"""Factory method which yields :class:`gcloud.storage.key.Key`
179-
items from a response.
177+
"""Factory method which yields :class:`gcloud.storage.key.Key` items from a response.
180178
181179
:type response: dict
182180
:param response: The JSON API response for a page of keys.

gcloud/storage/key.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ def set_contents_from_file(self, fh, rewind=False, size=None,
208208
# Set up a resumable upload session.
209209
headers = {
210210
'X-Upload-Content-Type': content_type or 'application/unknown',
211-
'X-Upload-Content-Length': total_bytes}
211+
'X-Upload-Content-Length': total_bytes
212+
}
212213

213214
upload_url = self.connection.build_api_url(
214215
path=self.bucket.path + '/o',
@@ -231,7 +232,8 @@ def set_contents_from_file(self, fh, rewind=False, size=None,
231232
end = bytes_uploaded + chunk_size - 1
232233

233234
headers = {
234-
'Content-Range': 'bytes %d-%d/%d' % (start, end, total_bytes), }
235+
'Content-Range': 'bytes %d-%d/%d' % (start, end, total_bytes),
236+
}
235237

236238
response, content = self.connection.make_request(
237239
content_type='text/plain',

0 commit comments

Comments
 (0)