From 5a2d185ed2aedc7e66222ab560db39f267a66fbe Mon Sep 17 00:00:00 2001 From: Bill Prin Date: Thu, 18 Aug 2016 14:34:22 -0700 Subject: [PATCH] Fix Numerous Spelling, Style, English Issues - Dozes of typos and misspellings - Dozens of missing incorrect punctuation - Unused variables The library is also wildly inconsistent on its usage of % vs the format function for string interpolation. I would like to fix that as well but not sure what the standard is, I recommend the format function. --- gcloud/bigquery/_helpers.py | 6 +++--- gcloud/bigquery/dataset.py | 16 ++++++++-------- gcloud/bigquery/job.py | 8 ++++---- gcloud/bigquery/query.py | 4 ++-- gcloud/bigquery/schema.py | 8 ++++---- gcloud/bigquery/table.py | 22 +++++++++++----------- gcloud/datastore/batch.py | 2 +- gcloud/datastore/client.py | 2 +- gcloud/datastore/connection.py | 5 +++-- gcloud/datastore/entity.py | 4 ++-- gcloud/datastore/helpers.py | 2 +- gcloud/datastore/key.py | 1 - gcloud/datastore/query.py | 2 +- gcloud/dns/changes.py | 18 +++++++++--------- gcloud/dns/client.py | 4 ++-- gcloud/dns/resource_record_set.py | 8 ++++---- gcloud/iterator.py | 4 ++-- gcloud/logging/connection.py | 2 +- gcloud/logging/logger.py | 4 ++-- gcloud/pubsub/connection.py | 2 +- gcloud/pubsub/message.py | 4 ++-- gcloud/pubsub/subscription.py | 8 ++++---- gcloud/resource_manager/client.py | 2 +- gcloud/storage/batch.py | 4 ++-- gcloud/storage/blob.py | 2 +- gcloud/streaming/exceptions.py | 10 +++++----- gcloud/streaming/http_wrapper.py | 8 ++++---- gcloud/streaming/stream_slice.py | 4 ++-- 28 files changed, 83 insertions(+), 83 deletions(-) diff --git a/gcloud/bigquery/_helpers.py b/gcloud/bigquery/_helpers.py index afb4d94682b5..d149ecb181d0 100644 --- a/gcloud/bigquery/_helpers.py +++ b/gcloud/bigquery/_helpers.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Shared elper functions for BigQuery API classes.""" +"""Shared helper functions for BigQuery API classes.""" from gcloud._helpers import _datetime_from_microseconds @@ -149,13 +149,13 @@ def _validate(self, value): class _EnumProperty(_ConfigurationProperty): - """Psedo-enumeration class. + """Pseudo-enumeration class. Subclasses must define ``ALLOWED`` as a class-level constant: it must be a sequence of strings. :type name: string - :param name: name of the property + :param name: name of the property. """ def _validate(self, value): """Check that ``value`` is one of the allowed values. diff --git a/gcloud/bigquery/dataset.py b/gcloud/bigquery/dataset.py index a8f7e18f4631..36ce1475c2a4 100644 --- a/gcloud/bigquery/dataset.py +++ b/gcloud/bigquery/dataset.py @@ -336,10 +336,10 @@ def _parse_access_grants(access): type is ``view``. :type access: list of mappings - :param access: each mapping represents a single access grant + :param access: each mapping represents a single access grant. :rtype: list of :class:`AccessGrant` - :returns: a list of parsed grants + :returns: a list of parsed grants. :raises: :class:`ValueError` if a grant in ``access`` has more keys than ``role`` and one additional key. """ @@ -358,7 +358,7 @@ def _set_properties(self, api_response): """Update properties from resource in body of ``api_response`` :type api_response: httplib2.Response - :param api_response: response returned from an API call + :param api_response: response returned from an API call. """ self._properties.clear() cleaned = api_response.copy() @@ -408,7 +408,7 @@ def _build_resource(self): return resource def create(self, client=None): - """API call: create the dataset via a PUT request + """API call: create the dataset via a PUT request. See: https://cloud.google.com/bigquery/docs/reference/v2/tables/insert @@ -447,7 +447,7 @@ def exists(self, client=None): return True def reload(self, client=None): - """API call: refresh dataset properties via a GET request + """API call: refresh dataset properties via a GET request. See https://cloud.google.com/bigquery/docs/reference/v2/datasets/get @@ -463,7 +463,7 @@ def reload(self, client=None): self._set_properties(api_response) def patch(self, client=None, **kw): - """API call: update individual dataset properties via a PATCH request + """API call: update individual dataset properties via a PATCH request. See https://cloud.google.com/bigquery/docs/reference/v2/datasets/patch @@ -501,7 +501,7 @@ def patch(self, client=None, **kw): self._set_properties(api_response) def update(self, client=None): - """API call: update dataset properties via a PUT request + """API call: update dataset properties via a PUT request. See https://cloud.google.com/bigquery/docs/reference/v2/datasets/update @@ -516,7 +516,7 @@ def update(self, client=None): self._set_properties(api_response) def delete(self, client=None): - """API call: delete the dataset via a DELETE request + """API call: delete the dataset via a DELETE request. See: https://cloud.google.com/bigquery/docs/reference/v2/tables/delete diff --git a/gcloud/bigquery/job.py b/gcloud/bigquery/job.py index baff58441ff3..40bf52f73455 100644 --- a/gcloud/bigquery/job.py +++ b/gcloud/bigquery/job.py @@ -33,7 +33,7 @@ class UDFResource(object): :param udf_type: the type of the resource ('inlineCode' or 'resourceUri') :type value: str - :param value: the inline code or resource URI + :param value: the inline code or resource URI. See https://cloud.google.com/bigquery/user-defined-functions#api @@ -51,7 +51,7 @@ def __eq__(self, other): def _build_udf_resources(resources): """ :type resources: sequence of :class:`UDFResource` - :param resources: fields to be appended + :param resources: fields to be appended. :rtype: mapping :returns: a mapping describing userDefinedFunctionResources for the query. @@ -69,13 +69,13 @@ class UDFResourcesProperty(object): Also used by :class:`~gcloud.bigquery.query.Query`. """ def __get__(self, instance, owner): - """Descriptor protocal: accesstor""" + """Descriptor protocol: accessor""" if instance is None: return self return list(instance._udf_resources) def __set__(self, instance, value): - """Descriptor protocal: mutator""" + """Descriptor protocol: mutator""" if not all(isinstance(u, UDFResource) for u in value): raise ValueError("udf items must be UDFResource") instance._udf_resources = tuple(value) diff --git a/gcloud/bigquery/query.py b/gcloud/bigquery/query.py index 4536e6570489..e436255253a7 100644 --- a/gcloud/bigquery/query.py +++ b/gcloud/bigquery/query.py @@ -169,7 +169,7 @@ def page_token(self): @property def total_rows(self): - """Total number of rows returned by the query + """Total number of rows returned by the query. See: https://cloud.google.com/bigquery/docs/reference/v2/jobs/query#totalRows @@ -181,7 +181,7 @@ def total_rows(self): @property def total_bytes_processed(self): - """Total number of bytes processed by the query + """Total number of bytes processed by the query. See: https://cloud.google.com/bigquery/docs/reference/v2/jobs/query#totalBytesProcessed diff --git a/gcloud/bigquery/schema.py b/gcloud/bigquery/schema.py index e813d688a7ca..15db5f8bcc1b 100644 --- a/gcloud/bigquery/schema.py +++ b/gcloud/bigquery/schema.py @@ -19,18 +19,18 @@ class SchemaField(object): """Describe a single field within a table schema. :type name: str - :param name: the name of the field + :param name: the name of the field. :type field_type: str :param field_type: the type of the field (one of 'STRING', 'INTEGER', - 'FLOAT', 'BOOLEAN', 'TIMESTAMP' or 'RECORD') + 'FLOAT', 'BOOLEAN', 'TIMESTAMP' or 'RECORD'). :type mode: str :param mode: the type of the field (one of 'NULLABLE', 'REQUIRED', - or 'REPEATED') + or 'REPEATED'). :type description: str - :param description: optional description for the field + :param description: optional description for the field. :type fields: list of :class:`SchemaField`, or None :param fields: subfields (requires ``field_type`` of 'RECORD'). diff --git a/gcloud/bigquery/table.py b/gcloud/bigquery/table.py index fa69a3a101ce..edd351f75340 100644 --- a/gcloud/bigquery/table.py +++ b/gcloud/bigquery/table.py @@ -813,43 +813,43 @@ def upload_from_file(self, :type allow_jagged_rows: boolean :param allow_jagged_rows: job configuration option; see - :meth:`gcloud.bigquery.job.LoadJob` + :meth:`gcloud.bigquery.job.LoadJob`. :type allow_quoted_newlines: boolean :param allow_quoted_newlines: job configuration option; see - :meth:`gcloud.bigquery.job.LoadJob` + :meth:`gcloud.bigquery.job.LoadJob`. :type create_disposition: str :param create_disposition: job configuration option; see - :meth:`gcloud.bigquery.job.LoadJob` + :meth:`gcloud.bigquery.job.LoadJob`. :type encoding: str :param encoding: job configuration option; see - :meth:`gcloud.bigquery.job.LoadJob` + :meth:`gcloud.bigquery.job.LoadJob`. :type field_delimiter: str :param field_delimiter: job configuration option; see - :meth:`gcloud.bigquery.job.LoadJob` + :meth:`gcloud.bigquery.job.LoadJob`. :type ignore_unknown_values: boolean :param ignore_unknown_values: job configuration option; see - :meth:`gcloud.bigquery.job.LoadJob` + :meth:`gcloud.bigquery.job.LoadJob`. :type max_bad_records: integer :param max_bad_records: job configuration option; see - :meth:`gcloud.bigquery.job.LoadJob` + :meth:`gcloud.bigquery.job.LoadJob`. :type quote_character: str :param quote_character: job configuration option; see - :meth:`gcloud.bigquery.job.LoadJob` + :meth:`gcloud.bigquery.job.LoadJob`. :type skip_leading_rows: integer :param skip_leading_rows: job configuration option; see - :meth:`gcloud.bigquery.job.LoadJob` + :meth:`gcloud.bigquery.job.LoadJob`. :type write_disposition: str :param write_disposition: job configuration option; see - :meth:`gcloud.bigquery.job.LoadJob` + :meth:`gcloud.bigquery.job.LoadJob`. :type client: :class:`gcloud.storage.client.Client` or ``NoneType`` :param client: Optional. The client to use. If not passed, falls back @@ -857,7 +857,7 @@ def upload_from_file(self, :rtype: :class:`gcloud.bigquery.jobs.LoadTableFromStorageJob` :returns: the job instance used to load the data (e.g., for - querying status) + querying status). :raises: :class:`ValueError` if ``size`` is not passed in and can not be determined, or if the ``file_obj`` can be detected to be a file opened in text mode. diff --git a/gcloud/datastore/batch.py b/gcloud/datastore/batch.py index 5d4fc01b1442..141bb54bc247 100644 --- a/gcloud/datastore/batch.py +++ b/gcloud/datastore/batch.py @@ -28,7 +28,7 @@ class Batch(object): """An abstraction representing a collected group of updates / deletes. - Used to build up a bulk mutuation. + Used to build up a bulk mutation. For example, the following snippet of code will put the two ``save`` operations and the ``delete`` operation into the same mutation, and send diff --git a/gcloud/datastore/client.py b/gcloud/datastore/client.py index 42e858d3e6f7..2293ef46a5e6 100644 --- a/gcloud/datastore/client.py +++ b/gcloud/datastore/client.py @@ -372,7 +372,7 @@ def delete_multi(self, keys): """Delete keys from the Cloud Datastore. :type keys: list of :class:`gcloud.datastore.key.Key` - :param keys: The keys to be deleted from the datastore. + :param keys: The keys to be deleted from the Datastore. """ if not keys: return diff --git a/gcloud/datastore/connection.py b/gcloud/datastore/connection.py index 6df414acd930..70b05042a9eb 100644 --- a/gcloud/datastore/connection.py +++ b/gcloud/datastore/connection.py @@ -359,7 +359,8 @@ class Connection(connection_module.Connection): """A connection to the Google Cloud Datastore via the Protobuf API. This class should understand only the basic types (and protobufs) - in method arguments, however should be capable of returning advanced types. + in method arguments, however it should be capable of returning advanced + types. :type credentials: :class:`oauth2client.client.OAuth2Credentials` :param credentials: The OAuth2 Credentials to use for this connection. @@ -559,7 +560,7 @@ def begin_transaction(self, project): return response.transaction def commit(self, project, request, transaction_id): - """Commit mutations in context of current transation (if any). + """Commit mutations in context of current transaction (if any). Maps the ``DatastoreService.Commit`` protobuf RPC. diff --git a/gcloud/datastore/entity.py b/gcloud/datastore/entity.py index 7021d3d7e7f5..249d57bc079a 100644 --- a/gcloud/datastore/entity.py +++ b/gcloud/datastore/entity.py @@ -88,7 +88,7 @@ def __init__(self, key=None, exclude_from_indexes=()): def __eq__(self, other): """Compare two entities for equality. - Entities compare equal if their keys compare equal, and their + Entities compare equal if their keys compare equal and their properties compare equal. :rtype: boolean @@ -105,7 +105,7 @@ def __eq__(self, other): def __ne__(self, other): """Compare two entities for inequality. - Entities compare equal if their keys compare equal, and their + Entities compare equal if their keys compare equal and their properties compare equal. :rtype: boolean diff --git a/gcloud/datastore/helpers.py b/gcloud/datastore/helpers.py index e13f7a51b039..ff6df78f2ddc 100644 --- a/gcloud/datastore/helpers.py +++ b/gcloud/datastore/helpers.py @@ -68,7 +68,7 @@ def _get_meaning(value_pb, is_list=False): else: # We know len(value_pb.array_value.values) > 0. # If the meaning is not unique, just return all of them. meaning = all_meanings - elif value_pb.meaning: # Simple field (int32) + elif value_pb.meaning: # Simple field (int32). meaning = value_pb.meaning return meaning diff --git a/gcloud/datastore/key.py b/gcloud/datastore/key.py index a1356dca1481..bfa7d67ad2a2 100644 --- a/gcloud/datastore/key.py +++ b/gcloud/datastore/key.py @@ -219,7 +219,6 @@ def completed_key(self, id_or_name): if not self.is_partial: raise ValueError('Only a partial key can be completed.') - id_or_name_key = None if isinstance(id_or_name, six.string_types): id_or_name_key = 'name' elif isinstance(id_or_name, six.integer_types): diff --git a/gcloud/datastore/query.py b/gcloud/datastore/query.py index 2b2a7928221a..75652bb56dbf 100644 --- a/gcloud/datastore/query.py +++ b/gcloud/datastore/query.py @@ -29,7 +29,7 @@ class Query(object): stored in the Cloud Datastore. :type client: :class:`gcloud.datastore.client.Client` - :param client: The client used to connect to datastore. + :param client: The client used to connect to Datastore. :type kind: string :param kind: The kind to query. diff --git a/gcloud/dns/changes.py b/gcloud/dns/changes.py index 58ab3bfe8bf2..eef7efe59e5c 100644 --- a/gcloud/dns/changes.py +++ b/gcloud/dns/changes.py @@ -43,7 +43,7 @@ def from_api_repr(cls, resource, zone): """Factory: construct a change set given its API representation :type resource: dict - :param resource: change set representation returned from the API + :param resource: change set representation returned from the API. :type zone: :class:`gcloud.dns.zone.ManagedZone` :param zone: A zone which holds zero or more change sets. @@ -59,7 +59,7 @@ def _set_properties(self, resource): """Helper method for :meth:`from_api_repr`, :meth:`create`, etc. :type resource: dict - :param resource: change set representation returned from the API + :param resource: change set representation returned from the API. """ resource = resource.copy() self._additions = tuple([ @@ -126,7 +126,7 @@ def additions(self): :rtype: sequence of :class:`gcloud.dns.resource_record_set.ResourceRecordSet`. - :returns: record sets appended via :meth:`add_record_set` + :returns: record sets appended via :meth:`add_record_set`. """ return self._additions @@ -136,7 +136,7 @@ def deletions(self): :rtype: sequence of :class:`gcloud.dns.resource_record_set.ResourceRecordSet`. - :returns: record sets appended via :meth:`delete_record_set` + :returns: record sets appended via :meth:`delete_record_set`. """ return self._deletions @@ -145,7 +145,7 @@ def add_record_set(self, record_set): :type record_set: :class:`gcloud.dns.resource_record_set.ResourceRecordSet` - :param record_set: the record set to append + :param record_set: the record set to append. :raises: ``ValueError`` if ``record_set`` is not of the required type. """ @@ -158,7 +158,7 @@ def delete_record_set(self, record_set): :type record_set: :class:`gcloud.dns.resource_record_set.ResourceRecordSet` - :param record_set: the record set to append + :param record_set: the record set to append. :raises: ``ValueError`` if ``record_set`` is not of the required type. """ @@ -202,7 +202,7 @@ def _build_resource(self): } def create(self, client=None): - """API call: create the change set via a POST request + """API call: create the change set via a POST request. See: https://cloud.google.com/dns/api/v1/changes/create @@ -221,7 +221,7 @@ def create(self, client=None): self._set_properties(api_response) def exists(self, client=None): - """API call: test for the existence of the change set via a GET request + """API call: test for the existence of the change set via a GET request. See https://cloud.google.com/dns/api/v1/changes/get @@ -243,7 +243,7 @@ def exists(self, client=None): return True def reload(self, client=None): - """API call: refresh zone properties via a GET request + """API call: refresh zone properties via a GET request. See https://cloud.google.com/dns/api/v1/changes/get diff --git a/gcloud/dns/client.py b/gcloud/dns/client.py index c69d54a5e8e4..57f6041641e5 100644 --- a/gcloud/dns/client.py +++ b/gcloud/dns/client.py @@ -44,7 +44,7 @@ class Client(JSONClient): _connection_class = Connection def quotas(self): - """Return DNS quots for the project associated with this client. + """Return DNS quotas for the project associated with this client. See: https://cloud.google.com/dns/api/v1/projects/get @@ -110,7 +110,7 @@ def zone(self, name, dns_name=None, description=None): defaults to the value of 'dns_name'. :rtype: :class:`gcloud.dns.zone.ManagedZone` - :returns: a new ``ManagedZone`` instance + :returns: a new ``ManagedZone`` instance. """ return ManagedZone(name, dns_name, client=self, description=description) diff --git a/gcloud/dns/resource_record_set.py b/gcloud/dns/resource_record_set.py index dbd95b3b17c5..8d6e3cfbdf9c 100644 --- a/gcloud/dns/resource_record_set.py +++ b/gcloud/dns/resource_record_set.py @@ -24,16 +24,16 @@ class ResourceRecordSet(object): https://cloud.google.com/dns/api/v1/resourceRecordSets :type name: string - :param name: the name of the record set + :param name: the name of the record set. :type record_type: string - :param record_type: the RR type of the zone + :param record_type: the RR type of the zone. :type ttl: integer - :param ttl: TTL (in seconds) for caching the record sets + :param ttl: TTL (in seconds) for caching the record sets. :type rrdatas: list of string - :param rrdatas: one or more lines containing the resource data + :param rrdatas: one or more lines containing the resource data. :type zone: :class:`gcloud.dns.zone.ManagedZone` :param zone: A zone which holds one or more record sets. diff --git a/gcloud/iterator.py b/gcloud/iterator.py index 14fdd905f300..ba62b6e47192 100644 --- a/gcloud/iterator.py +++ b/gcloud/iterator.py @@ -125,7 +125,7 @@ def reset(self): self.next_page_token = None def get_items_from_response(self, response): - """Factory method called while iterating. This should be overriden. + """Factory method called while iterating. This should be overridden. This method should be overridden by a subclass. It should accept the API response of a request for the next page of items, @@ -161,7 +161,7 @@ class MethodIterator(object): API call; if ``None``, applies no limit. :type kw: dict - :param kw: optional keyword argments to be passed to ``method``. + :param kw: optional keyword arguments to be passed to ``method``. """ def __init__(self, method, page_token=None, page_size=None, max_calls=None, **kw): diff --git a/gcloud/logging/connection.py b/gcloud/logging/connection.py index 6cad3f5ed03f..846d8ae5412e 100644 --- a/gcloud/logging/connection.py +++ b/gcloud/logging/connection.py @@ -435,7 +435,7 @@ def metric_delete(self, project, metric_name): :param project: ID of the project containing the metric. :type metric_name: string - :param metric_name: the name of the metric + :param metric_name: the name of the metric. """ target = '/projects/%s/metrics/%s' % (project, metric_name) self._connection.api_request(method='DELETE', path=target) diff --git a/gcloud/logging/logger.py b/gcloud/logging/logger.py index 0c781c73c9d4..049b77484ed5 100644 --- a/gcloud/logging/logger.py +++ b/gcloud/logging/logger.py @@ -213,7 +213,7 @@ def log_struct(self, info, client=None, labels=None, insert_id=None, :type http_request: dict or :class:`NoneType` :param http_request: (optional) info about HTTP request associated with - the entry + the entry. """ client = self._require_client(client) entry_resource = self._make_entry_resource( @@ -246,7 +246,7 @@ def log_proto(self, message, client=None, labels=None, insert_id=None, :type http_request: dict or :class:`NoneType` :param http_request: (optional) info about HTTP request associated with - the entry + the entry. """ client = self._require_client(client) entry_resource = self._make_entry_resource( diff --git a/gcloud/pubsub/connection.py b/gcloud/pubsub/connection.py index c41608abf5a1..292d99cdbf53 100644 --- a/gcloud/pubsub/connection.py +++ b/gcloud/pubsub/connection.py @@ -21,7 +21,7 @@ class Connection(base_connection.JSONConnection): - """A connection to Google Cloud Pubsub via the JSON REST API. + """A connection to Google Cloud Pub/Sub via the JSON REST API. :type credentials: :class:`oauth2client.client.OAuth2Credentials` :param credentials: (Optional) The OAuth2 Credentials to use for this diff --git a/gcloud/pubsub/message.py b/gcloud/pubsub/message.py index 3ed97a33e095..abac699567ae 100644 --- a/gcloud/pubsub/message.py +++ b/gcloud/pubsub/message.py @@ -26,7 +26,7 @@ class Message(object): https://cloud.google.com/pubsub/reference/rest/v1/PubsubMessage :type data: bytes - :param data: the payload of the message + :param data: the payload of the message. :type message_id: string :param message_id: An ID assigned to the message by the API. @@ -44,7 +44,7 @@ def __init__(self, data, message_id, attributes=None): @property def attributes(self): - """Lazily-constructed attribute dictionary""" + """Lazily-constructed attribute dictionary.""" if self._attributes is None: self._attributes = {} return self._attributes diff --git a/gcloud/pubsub/subscription.py b/gcloud/pubsub/subscription.py index 83493d529295..9d520a502628 100644 --- a/gcloud/pubsub/subscription.py +++ b/gcloud/pubsub/subscription.py @@ -27,7 +27,7 @@ class Subscription(object): https://cloud.google.com/pubsub/reference/rest/v1/projects.subscriptions :type name: string - :param name: the name of the subscription + :param name: the name of the subscription. :type topic: :class:`gcloud.pubsub.topic.Topic` or ``NoneType`` :param topic: the topic to which the subscription belongs; if ``None``, @@ -74,7 +74,7 @@ def from_api_repr(cls, resource, client, topics=None): """Factory: construct a topic given its API representation :type resource: dict - :param resource: topic resource representation returned from the API + :param resource: topic resource representation returned from the API. :type client: :class:`gcloud.pubsub.client.Client` :param client: Client which holds credentials and project @@ -449,7 +449,7 @@ class AutoAck(dict): Mapping, tracks messages still-to-be-acknowledged. When used as a context manager, acknowledges all messages still in the - mapping on `__exit__`. When processing the pulled messsages, application + mapping on `__exit__`. When processing the pulled messages, application code MUST delete messages from the :class:`AutoAck` mapping which are not successfully processed, e.g.: @@ -463,7 +463,7 @@ class AutoAck(dict): del ack[ack_id] :type subscription: :class:`Subscription` - :param subscription: subcription to be pulled. + :param subscription: subscription to be pulled. :type return_immediately: boolean :param return_immediately: passed through to :meth:`Subscription.pull` diff --git a/gcloud/resource_manager/client.py b/gcloud/resource_manager/client.py index 74844019babc..a2e881a1924d 100644 --- a/gcloud/resource_manager/client.py +++ b/gcloud/resource_manager/client.py @@ -49,7 +49,7 @@ class Client(BaseClient): _connection_class = Connection def new_project(self, project_id, name=None, labels=None): - """Creates a :class:`.Project` bound to the current client. + """Create a :class:`.Project` bound to the current client. Use :meth:`Project.reload() \ ` to retrieve diff --git a/gcloud/storage/batch.py b/gcloud/storage/batch.py index 569ea3e5f2de..d4b56720e24b 100644 --- a/gcloud/storage/batch.py +++ b/gcloud/storage/batch.py @@ -232,7 +232,7 @@ def _finish_futures(self, responses): raise make_exception(*exception_args) def finish(self): - """Submit a single `multipart/mixed` request w/ deferred requests. + """Submit a single `multipart/mixed` request with deferred requests. :rtype: list of tuples :returns: one ``(headers, payload)`` tuple per deferred request. @@ -271,7 +271,7 @@ def _generate_faux_mime_message(parser, response, content): Helper for _unpack_batch_response. """ - # We coerce to bytes to get consitent concat across + # We coerce to bytes to get consistent concat across # Py2 and Py3. Percent formatting is insufficient since # it includes the b in Py3. if not isinstance(content, six.binary_type): diff --git a/gcloud/storage/blob.py b/gcloud/storage/blob.py index c852c5e7c816..aeb7af704df3 100644 --- a/gcloud/storage/blob.py +++ b/gcloud/storage/blob.py @@ -929,7 +929,7 @@ def __init__(self, bucket_name, object_name): def _set_encryption_headers(key, headers): - """Builds customer encyrption key headers + """Builds customer encryption key headers :type key: str or bytes :param key: 32 byte key to build request key and hash. diff --git a/gcloud/streaming/exceptions.py b/gcloud/streaming/exceptions.py index b7a7c4fe4586..780686fe23f3 100644 --- a/gcloud/streaming/exceptions.py +++ b/gcloud/streaming/exceptions.py @@ -89,16 +89,16 @@ class RetryAfterError(HttpError): """The response contained a retry-after header. :type response: dict - :param response: headers from the response which returned the error + :param response: headers from the response which returned the error. :type content: bytes - :param content: payload of the response which returned the error + :param content: payload of the response which returned the error. :type url: string - :param url: URL of the response which returned the error + :param url: URL of the response which returned the error. :type retry_after: integer - :param retry_after: seconds to wait before retrying + :param retry_after: seconds to wait before retrying. """ def __init__(self, response, content, url, retry_after): super(RetryAfterError, self).__init__(response, content, url) @@ -109,7 +109,7 @@ def from_response(cls, http_response): """Factory: construct an exception from a response. :type http_response: :class:`gcloud.streaming.http_wrapper.Response` - :param http_response: the response which returned the error + :param http_response: the response which returned the error. :rtype: :class:`RetryAfterError` :returns: The error created from the response. diff --git a/gcloud/streaming/http_wrapper.py b/gcloud/streaming/http_wrapper.py index 1ba8971071da..82d64b0455a9 100644 --- a/gcloud/streaming/http_wrapper.py +++ b/gcloud/streaming/http_wrapper.py @@ -72,7 +72,7 @@ class _ExceptionRetryArgs( :param http: instance used to perform requests. :type http_request: :class:`Request` - :param http_request: the request whose response was a retriable error + :param http_request: the request whose response was a retriable error. :type exc: :class:`Exception` subclass :param exc: the exception being raised. @@ -387,7 +387,7 @@ def make_api_request(http, http_request, """Send an HTTP request via the given http, performing error/retry handling. :type http: :class:`httplib2.Http` - :param http: an instance which impelements the `Http` API. + :param http: an instance which implements the `Http` API. :type http_request: :class:`Request` :param http_request: the request to send. @@ -410,7 +410,7 @@ def make_api_request(http, http_request, :param wo_retry_func: Function to make HTTP request without retries. :rtype: :class:`Response` - :returns: an object representing the server's response + :returns: an object representing the server's response. :raises: :exc:`gcloud.streaming.exceptions.RequestError` if no response could be parsed. @@ -442,7 +442,7 @@ def _register_http_factory(factory): """Register a custom HTTP factory. :type factory: callable taking keyword arguments, returning an Http - instance (or an instance implementing the same API); + instance (or an instance implementing the same API). :param factory: the new factory (it may return ``None`` to defer to a later factory or the default). """ diff --git a/gcloud/streaming/stream_slice.py b/gcloud/streaming/stream_slice.py index 5bdfa9449231..67f3cc9b2699 100644 --- a/gcloud/streaming/stream_slice.py +++ b/gcloud/streaming/stream_slice.py @@ -21,10 +21,10 @@ class StreamSlice(object): """Provides a slice-like object for streams. :type stream: readable file-like object - :param stream: the stream to be buffered + :param stream: the stream to be buffered. :type max_bytes: integer - :param max_bytes: maximum number of bytes to return in the slice + :param max_bytes: maximum number of bytes to return in the slice. """ def __init__(self, stream, max_bytes): self._stream = stream