Skip to content

Commit

Permalink
Fix URLs, commands, etc. in samples README
Browse files Browse the repository at this point in the history
  • Loading branch information
plamut committed Jul 10, 2020
1 parent 5d0f039 commit 2588fa7
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 37 deletions.
54 changes: 24 additions & 30 deletions samples/snippets/README.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@

.. This file is automatically generated. Do not edit this file directly.
Google Cloud Pub/Sub Python Samples
===============================================================================

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=pubsub/cloud-client/README.rst
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/python-pubsub&page=editor&open_in_editor=samples/snippets/README.rst


This directory contains samples for Google Cloud Pub/Sub. `Google Cloud Pub/Sub`_ is a fully-managed real-time messaging service that allows you to send and receive messages between independent applications.
Expand All @@ -16,11 +15,13 @@ This directory contains samples for Google Cloud Pub/Sub. `Google Cloud Pub/Sub`
.. _Google Cloud Pub/Sub: https://cloud.google.com/pubsub/docs





Setup
-------------------------------------------------------------------------------



Authentication
++++++++++++++

Expand All @@ -31,17 +32,14 @@ credentials for applications.
.. _Authentication Getting Started Guide:
https://cloud.google.com/docs/authentication/getting-started




Install Dependencies
++++++++++++++++++++

#. Clone python-docs-samples and change directory to the sample directory you want to use.

.. code-block:: bash
$ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git
$ git clone https://github.com/googleapis/python-pubsub.git
#. Install `pip`_ and `virtualenv`_ if you do not already have them. You may want to refer to the `Python Development Environment Setup Guide`_ for Google Cloud Platform for instructions.

Expand All @@ -64,20 +62,30 @@ Install Dependencies
.. _pip: https://pip.pypa.io/
.. _virtualenv: https://virtualenv.pypa.io/

Samples
-------------------------------------------------------------------------------

Quickstart (Publisher)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com//googleapis/python-pubsub&page=editor&open_in_editor=samples/snippets/quickstart/pub.py,samples/snippets/README.rst



Samples
-------------------------------------------------------------------------------

To run this sample:

.. code-block:: bash
Quickstart
$ python quickstart/pub.py
Quickstart (Subscriber)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=pubsub/cloud-client/quickstart.py,pubsub/cloud-client/README.rst
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com//googleapis/python-pubsub&page=editor&open_in_editor=samples/snippets/quickstart/sub.py,samples/snippets/README.rst



Expand All @@ -86,16 +94,14 @@ To run this sample:

.. code-block:: bash
$ python quickstart.py
$ python quickstart/sub.py
Publisher
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=pubsub/cloud-client/publisher.py,pubsub/cloud-client/README.rst
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com//googleapis/python-pubsub&page=editor&open_in_editor=samples/snippets/publisher.py,samples/snippets/README.rst



Expand All @@ -106,7 +112,6 @@ To run this sample:
$ python publisher.py
usage: publisher.py [-h]
project_id
{list,create,delete,publish,publish-with-custom-attributes,publish-with-error-handler,publish-with-batch-settings,publish-with-retry-settings}
Expand Down Expand Up @@ -142,13 +147,11 @@ To run this sample:
Subscribers
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=pubsub/cloud-client/subscriber.py,pubsub/cloud-client/README.rst
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com//googleapis/python-pubsub&page=editor&open_in_editor=samples/snippets/subscriber.py,samples/snippets/README.rst



Expand All @@ -159,7 +162,6 @@ To run this sample:
$ python subscriber.py
usage: subscriber.py [-h]
project_id
{list-in-topic,list-in-project,create,create-with-dead-letter-policy,create-push,delete,update-push,update-dead-letter-policy,remove-dead-letter-policy,receive,receive-custom-attributes,receive-flow-control,receive-synchronously,receive-synchronously-with-lease,listen-for-errors,receive-messages-with-delivery-attempts}
Expand Down Expand Up @@ -207,13 +209,11 @@ To run this sample:
Identity and Access Management
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=pubsub/cloud-client/iam.py,pubsub/cloud-client/README.rst
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com//googleapis/python-pubsub&page=editor&open_in_editor=samples/snippets/iam.py,samples/snippets/README.rst



Expand All @@ -224,7 +224,6 @@ To run this sample:
$ python iam.py
usage: iam.py [-h]
project
{get-topic-policy,get-subscription-policy,set-topic-policy,set-subscription-policy,check-topic-permissions,check-subscription-permissions}
Expand Down Expand Up @@ -259,10 +258,6 @@ To run this sample:
The client library
-------------------------------------------------------------------------------

Expand All @@ -278,5 +273,4 @@ to `browse the source`_ and `report issues`_.
https://github.com/GoogleCloudPlatform/google-cloud-python/issues



.. _Google Cloud SDK: https://cloud.google.com/sdk/
.. _Google Cloud SDK: https://cloud.google.com/sdk/
8 changes: 5 additions & 3 deletions samples/snippets/README.rst.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ setup:
- install_deps

samples:
- name: Quickstart
file: quickstart.py
- name: Quickstart (Publisher)
file: quickstart/pub.py
- name: Quickstart (Subscriber)
file: quickstart/sub.py
- name: Publisher
file: publisher.py
show_help: true
Expand All @@ -27,4 +29,4 @@ samples:

cloud_client_library: true

folder: pubsub/cloud-client
folder: samples/snippets
4 changes: 2 additions & 2 deletions scripts/readme-gen/templates/README.tmpl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
===============================================================================

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor={{folder}}/README.rst
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/python-pubsub&page=editor&open_in_editor={{folder}}/README.rst


This directory contains samples for {{product.name}}. {{product.description}}
Expand Down Expand Up @@ -46,7 +46,7 @@ Samples

{% if not sample.hide_cloudshell_button %}
.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor={{folder}}/{{sample.file}},{{folder}}/README.rst
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com//googleapis/python-pubsub&page=editor&open_in_editor={{folder}}/{{sample.file}},{{folder}}/README.rst
{% endif %}


Expand Down
4 changes: 2 additions & 2 deletions scripts/readme-gen/templates/install_deps.tmpl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ Install Dependencies

.. code-block:: bash
$ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git
$ git clone https://github.com/googleapis/python-pubsub.git
#. Install `pip`_ and `virtualenv`_ if you do not already have them. You may want to refer to the `Python Development Environment Setup Guide`_ for Google Cloud Platform for instructions.

.. _Python Development Environment Setup Guide:
https://cloud.google.com/python/setup

#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+.
#. Create a virtualenv. Samples are compatible with Python 3.6+.

.. code-block:: bash
Expand Down

0 comments on commit 2588fa7

Please sign in to comment.