Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
docs(storage): fix indent in code blocks (#171)
Fixes #170
  • Loading branch information
HemangChothani committed Jun 15, 2020
1 parent 5e60991 commit 62d1543
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions google/cloud/storage/__init__.py
Expand Up @@ -19,6 +19,7 @@
.. literalinclude:: snippets.py
:start-after: [START storage_get_started]
:end-before: [END storage_get_started]
:dedent: 4
The main concepts with this API are:
Expand Down
5 changes: 5 additions & 0 deletions google/cloud/storage/acl.py
Expand Up @@ -21,6 +21,7 @@
.. literalinclude:: snippets.py
:start-after: [START client_bucket_acl]
:end-before: [END client_bucket_acl]
:dedent: 4
Adding and removing permissions can be done with the following methods
Expand Down Expand Up @@ -52,13 +53,15 @@
.. literalinclude:: snippets.py
:start-after: [START acl_user_settings]
:end-before: [END acl_user_settings]
:dedent: 4
After that, you can save any changes you make with the
:func:`google.cloud.storage.acl.ACL.save` method:
.. literalinclude:: snippets.py
:start-after: [START acl_save]
:end-before: [END acl_save]
:dedent: 4
You can alternatively save any existing :class:`google.cloud.storage.acl.ACL`
object (whether it was created by a factory method or not) from a
Expand All @@ -67,13 +70,15 @@
.. literalinclude:: snippets.py
:start-after: [START acl_save_bucket]
:end-before: [END acl_save_bucket]
:dedent: 4
To get the list of ``entity`` and ``role`` for each unique pair, the
:class:`ACL` class is iterable:
.. literalinclude:: snippets.py
:start-after: [START acl_print]
:end-before: [END acl_print]
:dedent: 4
This list of tuples can be used as the ``entity`` and ``role`` fields
when sending metadata for ACLs to the API.
Expand Down
8 changes: 8 additions & 0 deletions google/cloud/storage/bucket.py
Expand Up @@ -968,6 +968,7 @@ def get_blob(
.. literalinclude:: snippets.py
:start-after: [START get_blob]
:end-before: [END get_blob]
:dedent: 4
If :attr:`user_project` is set, bills the API request to that project.
Expand Down Expand Up @@ -1381,6 +1382,7 @@ def delete_blob(
.. literalinclude:: snippets.py
:start-after: [START delete_blob]
:end-before: [END delete_blob]
:dedent: 4
If :attr:`user_project` is set, bills the API request to that project.
Expand Down Expand Up @@ -1431,6 +1433,7 @@ def delete_blob(
.. literalinclude:: snippets.py
:start-after: [START delete_blobs]
:end-before: [END delete_blobs]
:dedent: 4
"""
client = self._require_client(client)
Expand Down Expand Up @@ -2105,6 +2108,7 @@ def add_lifecycle_delete_rule(self, **kw):
.. literalinclude:: snippets.py
:start-after: [START add_lifecycle_delete_rule]
:end-before: [END add_lifecycle_delete_rule]
:dedent: 4
:type kw: dict
:params kw: arguments passed to :class:`LifecycleRuleConditions`.
Expand All @@ -2122,6 +2126,7 @@ def add_lifecycle_set_storage_class_rule(self, storage_class, **kw):
.. literalinclude:: snippets.py
:start-after: [START add_lifecycle_set_storage_class_rule]
:end-before: [END add_lifecycle_set_storage_class_rule]
:dedent: 4
:type storage_class: str, one of :attr:`STORAGE_CLASSES`.
:param storage_class: new storage class to assign to matching items.
Expand Down Expand Up @@ -2465,12 +2470,14 @@ def configure_website(self, main_page_suffix=None, not_found_page=None):
.. literalinclude:: snippets.py
:start-after: [START configure_website]
:end-before: [END configure_website]
:dedent: 4
You probably should also make the whole bucket public:
.. literalinclude:: snippets.py
:start-after: [START make_public]
:end-before: [END make_public]
:dedent: 4
This says: "Make the bucket public, and all the stuff already in
the bucket, and anything else I add to the bucket. Just make it
Expand Down Expand Up @@ -2804,6 +2811,7 @@ def generate_upload_policy(self, conditions, expiration=None, client=None):
.. literalinclude:: snippets.py
:start-after: [START policy_document]
:end-before: [END policy_document]
:dedent: 4
.. _policy documents:
https://cloud.google.com/storage/docs/xml-api\
Expand Down
4 changes: 4 additions & 0 deletions google/cloud/storage/client.py
Expand Up @@ -329,6 +329,7 @@ def get_bucket(
.. literalinclude:: snippets.py
:start-after: [START get_bucket]
:end-before: [END get_bucket]
:dedent: 4
Get a bucket using a resource.
Expand Down Expand Up @@ -367,6 +368,7 @@ def lookup_bucket(
.. literalinclude:: snippets.py
:start-after: [START lookup_bucket]
:end-before: [END lookup_bucket]
:dedent: 4
:type bucket_name: str
:param bucket_name: The name of the bucket to get.
Expand Down Expand Up @@ -461,6 +463,7 @@ def create_bucket(
.. literalinclude:: snippets.py
:start-after: [START create_bucket]
:end-before: [END create_bucket]
:dedent: 4
Create a bucket using a resource.
Expand Down Expand Up @@ -702,6 +705,7 @@ def list_buckets(
.. literalinclude:: snippets.py
:start-after: [START list_buckets]
:end-before: [END list_buckets]
:dedent: 4
This implements "storage.buckets.list".
Expand Down

0 comments on commit 62d1543

Please sign in to comment.