Skip to content

Commit 2a2f3c2

Browse files
authored
Merge pull request #2579 from tswast/str-not-string
Replace types string with str.
2 parents 315cf97 + 2da69b4 commit 2a2f3c2

5 files changed

Lines changed: 70 additions & 70 deletions

File tree

packages/google-cloud-storage/google/cloud/storage/_helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class _PropertyMixin(object):
2828
- client
2929
- path
3030
31-
:type name: string
31+
:type name: str
3232
:param name: The name of the object.
3333
"""
3434

@@ -88,7 +88,7 @@ def _patch_property(self, name, value):
8888
It **will not** reload the properties from the server. The behavior is
8989
local only and syncing occurs via :meth:`patch`.
9090
91-
:type name: string
91+
:type name: str
9292
:param name: The field name to update.
9393
9494
:type value: object

packages/google-cloud-storage/google/cloud/storage/acl.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ class _ACLEntity(object):
8585
This is a helper class that you likely won't ever construct
8686
outside of using the factor methods on the :class:`ACL` object.
8787
88-
:type entity_type: string
88+
:type entity_type: str
8989
:param entity_type: The type of entity (ie, 'group' or 'user').
9090
91-
:type identifier: string
91+
:type identifier: str
9292
:param identifier: The ID or e-mail of the entity. For the special
9393
entity types (like 'allUsers') this is optional.
9494
"""
@@ -123,15 +123,15 @@ def get_roles(self):
123123
def grant(self, role):
124124
"""Add a role to the entity.
125125
126-
:type role: string
126+
:type role: str
127127
:param role: The role to add to the entity.
128128
"""
129129
self.roles.add(role)
130130

131131
def revoke(self, role):
132132
"""Remove a role from the entity.
133133
134-
:type role: string
134+
:type role: str
135135
:param role: The role to remove from the entity.
136136
"""
137137
if role in self.roles:
@@ -258,7 +258,7 @@ def has_entity(self, entity):
258258
:type entity: :class:`_ACLEntity`
259259
:param entity: The entity to check for existence in this ACL.
260260
261-
:rtype: boolean
261+
:rtype: bool
262262
:returns: True of the entity exists in the ACL.
263263
"""
264264
self._ensure_loaded()
@@ -298,11 +298,11 @@ def entity(self, entity_type, identifier=None):
298298
create a new one and add it to the list of known entities for
299299
this ACL.
300300
301-
:type entity_type: string
301+
:type entity_type: str
302302
:param entity_type: The type of entity to create
303303
(ie, ``user``, ``group``, etc)
304304
305-
:type identifier: string
305+
:type identifier: str
306306
:param identifier: The ID of the entity (if applicable).
307307
This can be either an ID or an e-mail address.
308308
@@ -319,7 +319,7 @@ def entity(self, entity_type, identifier=None):
319319
def user(self, identifier):
320320
"""Factory method for a user Entity.
321321
322-
:type identifier: string
322+
:type identifier: str
323323
:param identifier: An id or e-mail for this particular user.
324324
325325
:rtype: :class:`_ACLEntity`
@@ -330,7 +330,7 @@ def user(self, identifier):
330330
def group(self, identifier):
331331
"""Factory method for a group Entity.
332332
333-
:type identifier: string
333+
:type identifier: str
334334
:param identifier: An id or e-mail for this particular group.
335335
336336
:rtype: :class:`_ACLEntity`
@@ -341,7 +341,7 @@ def group(self, identifier):
341341
def domain(self, domain):
342342
"""Factory method for a domain Entity.
343343
344-
:type domain: string
344+
:type domain: str
345345
:param domain: The domain for this entity.
346346
347347
:rtype: :class:`_ACLEntity`
@@ -419,7 +419,7 @@ def _save(self, acl, predefined, client):
419419
:param acl: The ACL object to save. If left blank, this will save
420420
current entries.
421421
422-
:type predefined: string or None
422+
:type predefined: str or None
423423
:param predefined: An identifier for a predefined ACL. Must be one
424424
of the keys in :attr:`PREDEFINED_JSON_ACLS`
425425
If passed, `acl` must be None.
@@ -470,7 +470,7 @@ def save(self, acl=None, client=None):
470470
def save_predefined(self, predefined, client=None):
471471
"""Save this ACL for the current bucket using a predefined ACL.
472472
473-
:type predefined: string
473+
:type predefined: str
474474
:param predefined: An identifier for a predefined ACL. Must be one
475475
of the keys in :attr:`PREDEFINED_JSON_ACLS`
476476
or :attr:`PREDEFINED_XML_ACLS` (which will be

packages/google-cloud-storage/google/cloud/storage/blob.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
class Blob(_PropertyMixin):
5151
"""A wrapper around Cloud Storage's concept of an ``Object``.
5252
53-
:type name: string
53+
:type name: str
5454
:param name: The name of the blob. This corresponds to the
5555
unique path of the object in the bucket.
5656
@@ -109,13 +109,13 @@ def chunk_size(self, value):
109109
def path_helper(bucket_path, blob_name):
110110
"""Relative URL path for a blob.
111111
112-
:type bucket_path: string
112+
:type bucket_path: str
113113
:param bucket_path: The URL path for a bucket.
114114
115-
:type blob_name: string
115+
:type blob_name: str
116116
:param blob_name: The name of the blob.
117117
118-
:rtype: string
118+
:rtype: str
119119
:returns: The relative URL path for ``blob_name``.
120120
"""
121121
return bucket_path + '/o/' + quote(blob_name, safe='')
@@ -137,7 +137,7 @@ def __repr__(self):
137137
def path(self):
138138
"""Getter property for the URL path to this Blob.
139139
140-
:rtype: string
140+
:rtype: str
141141
:returns: The URL path to this Blob.
142142
"""
143143
if not self.name:
@@ -254,7 +254,7 @@ def exists(self, client=None):
254254
:param client: Optional. The client to use. If not passed, falls back
255255
to the ``client`` stored on the blob's bucket.
256256
257-
:rtype: boolean
257+
:rtype: bool
258258
:returns: True if the blob exists in Cloud Storage.
259259
"""
260260
client = self._require_client(client)
@@ -355,7 +355,7 @@ def download_to_file(self, file_obj, client=None):
355355
def download_to_filename(self, filename, client=None):
356356
"""Download the contents of this blob into a named file.
357357
358-
:type filename: string
358+
:type filename: str
359359
:param filename: A filename to be passed to ``open``.
360360
361361
:type client: :class:`~google.cloud.storage.client.Client` or
@@ -440,7 +440,7 @@ def upload_from_file(self, file_obj, rewind=False, size=None,
440440
:type file_obj: file
441441
:param file_obj: A file handle open for reading.
442442
443-
:type rewind: boolean
443+
:type rewind: bool
444444
:param rewind: If True, seek to the beginning of the file handle before
445445
writing the file to Cloud Storage.
446446
@@ -450,7 +450,7 @@ def upload_from_file(self, file_obj, rewind=False, size=None,
450450
:func:`os.fstat`. (If the file handle is not from the
451451
filesystem this won't be possible.)
452452
453-
:type content_type: string or ``NoneType``
453+
:type content_type: str or ``NoneType``
454454
:param content_type: Optional type of content being uploaded.
455455
456456
:type num_retries: integer
@@ -564,10 +564,10 @@ def upload_from_filename(self, filename, content_type=None, client=None):
564564
`lifecycle <https://cloud.google.com/storage/docs/lifecycle>`_
565565
API documents for details.
566566
567-
:type filename: string
567+
:type filename: str
568568
:param filename: The path to the file.
569569
570-
:type content_type: string or ``NoneType``
570+
:type content_type: str or ``NoneType``
571571
:param content_type: Optional type of content being uploaded.
572572
573573
:type client: :class:`~google.cloud.storage.client.Client` or
@@ -601,7 +601,7 @@ def upload_from_string(self, data, content_type='text/plain', client=None):
601601
:param data: The data to store in this blob. If the value is
602602
text, it will be encoded as UTF-8.
603603
604-
:type content_type: string
604+
:type content_type: str
605605
:param content_type: Optional type of content being uploaded. Defaults
606606
to ``'text/plain'``.
607607
@@ -709,7 +709,7 @@ def rewrite(self, source, token=None, client=None):
709709
710710
If the property is not set locally, returns ``None``.
711711
712-
:rtype: string or ``NoneType``
712+
:rtype: str or ``NoneType``
713713
"""
714714

715715
content_disposition = _scalar_property('contentDisposition')
@@ -720,7 +720,7 @@ def rewrite(self, source, token=None, client=None):
720720
721721
If the property is not set locally, returns ``None``.
722722
723-
:rtype: string or ``NoneType``
723+
:rtype: str or ``NoneType``
724724
"""
725725

726726
content_encoding = _scalar_property('contentEncoding')
@@ -731,7 +731,7 @@ def rewrite(self, source, token=None, client=None):
731731
732732
If the property is not set locally, returns ``None``.
733733
734-
:rtype: string or ``NoneType``
734+
:rtype: str or ``NoneType``
735735
"""
736736

737737
content_language = _scalar_property('contentLanguage')
@@ -742,7 +742,7 @@ def rewrite(self, source, token=None, client=None):
742742
743743
If the property is not set locally, returns ``None``.
744744
745-
:rtype: string or ``NoneType``
745+
:rtype: str or ``NoneType``
746746
"""
747747

748748
content_type = _scalar_property('contentType')
@@ -753,7 +753,7 @@ def rewrite(self, source, token=None, client=None):
753753
754754
If the property is not set locally, returns ``None``.
755755
756-
:rtype: string or ``NoneType``
756+
:rtype: str or ``NoneType``
757757
"""
758758

759759
crc32c = _scalar_property('crc32c')
@@ -764,7 +764,7 @@ def rewrite(self, source, token=None, client=None):
764764
765765
If the property is not set locally, returns ``None``.
766766
767-
:rtype: string or ``NoneType``
767+
:rtype: str or ``NoneType``
768768
"""
769769

770770
@property
@@ -789,7 +789,7 @@ def etag(self):
789789
See: http://tools.ietf.org/html/rfc2616#section-3.11 and
790790
https://cloud.google.com/storage/docs/json_api/v1/objects
791791
792-
:rtype: string or ``NoneType``
792+
:rtype: str or ``NoneType``
793793
:returns: The blob etag or ``None`` if the property is not set locally.
794794
"""
795795
return self._properties.get('etag')
@@ -814,7 +814,7 @@ def id(self):
814814
815815
See: https://cloud.google.com/storage/docs/json_api/v1/objects
816816
817-
:rtype: string or ``NoneType``
817+
:rtype: str or ``NoneType``
818818
:returns: The ID of the blob or ``None`` if the property is not
819819
set locally.
820820
"""
@@ -828,7 +828,7 @@ def id(self):
828828
829829
If the property is not set locally, returns ``None``.
830830
831-
:rtype: string or ``NoneType``
831+
:rtype: str or ``NoneType``
832832
"""
833833

834834
@property
@@ -837,7 +837,7 @@ def media_link(self):
837837
838838
See: https://cloud.google.com/storage/docs/json_api/v1/objects
839839
840-
:rtype: string or ``NoneType``
840+
:rtype: str or ``NoneType``
841841
:returns: The media link for the blob or ``None`` if the property is
842842
not set locally.
843843
"""
@@ -898,7 +898,7 @@ def self_link(self):
898898
899899
See: https://cloud.google.com/storage/docs/json_api/v1/objects
900900
901-
:rtype: string or ``NoneType``
901+
:rtype: str or ``NoneType``
902902
:returns: The self link for the blob or ``None`` if the property is
903903
not set locally.
904904
"""
@@ -924,7 +924,7 @@ def storage_class(self):
924924
925925
See: https://cloud.google.com/storage/docs/storage-classes
926926
927-
:rtype: string or ``NoneType``
927+
:rtype: str or ``NoneType``
928928
:returns: If set, one of "MULTI_REGIONAL", "REGIONAL",
929929
"NEARLINE", "COLDLINE", "STANDARD", or
930930
"DURABLE_REDUCED_AVAILABILITY", else ``None``.

0 commit comments

Comments
 (0)