From cf4987d601a4ccfedbf10f05f25a9365fc46f9b9 Mon Sep 17 00:00:00 2001 From: MarkEEaton Date: Tue, 14 Aug 2018 13:04:21 -0400 Subject: [PATCH 1/3] Revise README.rst for clarity --- README.rst | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/README.rst b/README.rst index 97919e0..779af96 100644 --- a/README.rst +++ b/README.rst @@ -1,20 +1,23 @@ Mastodon.py =========== +Register your app! This only needs to be done once. + .. code-block:: python from mastodon import Mastodon - # Register app - only once! - ''' Mastodon.create_app( 'pytooterapp', api_base_url = 'https://mastodon.social', to_file = 'pytooter_clientcred.secret' ) - ''' - # Log in - either every time, or use persisted - ''' +Then login. This can be done every time, or use persisted. + +.. code-block:: python + + from mastodon import Mastodon + mastodon = Mastodon( client_id = 'pytooter_clientcred.secret', api_base_url = 'https://mastodon.social' @@ -24,9 +27,13 @@ Mastodon.py 'incrediblygoodpassword', to_file = 'pytooter_usercred.secret' ) - ''' - # Create actual API instance +To post, create an actual API instance. + +.. code-block:: python + + from mastodon import Mastodon + mastodon = Mastodon( access_token = 'pytooter_usercred.secret', api_base_url = 'https://mastodon.social' From 84b1bc72496570f87f6d0ec52a8f8aa5f54addbe Mon Sep 17 00:00:00 2001 From: MarkEEaton Date: Tue, 14 Aug 2018 13:25:24 -0400 Subject: [PATCH 2/3] Keep the ''' and explain why they are there This commit takes into account the discussion from https://github.com/halcy/Mastodon.py/pull/125 --- README.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 779af96..39923b9 100644 --- a/README.rst +++ b/README.rst @@ -1,16 +1,18 @@ Mastodon.py =========== -Register your app! This only needs to be done once. +Register your app! This only needs to be done once. Uncomment the code and substitute in your information. .. code-block:: python from mastodon import Mastodon + ''' Mastodon.create_app( 'pytooterapp', api_base_url = 'https://mastodon.social', to_file = 'pytooter_clientcred.secret' ) + ''' Then login. This can be done every time, or use persisted. From dc4b3ffc03c3724c09862bb114736786a0679032 Mon Sep 17 00:00:00 2001 From: MarkEEaton Date: Fri, 17 Aug 2018 09:09:25 -0400 Subject: [PATCH 3/3] Update index.rst to reflect README.rst --- docs/index.rst | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 0cff37e..808e563 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -2,12 +2,13 @@ Mastodon.py =========== .. py:module:: mastodon .. py:class: Mastodon + +Register your app! This only needs to be done once. Uncomment the code and substitute in your information. .. code-block:: python from mastodon import Mastodon - # Register app - only once! ''' Mastodon.create_app( 'pytooterapp', @@ -16,8 +17,12 @@ Mastodon.py ) ''' - # Log in - either every time, or use persisted - ''' +Then login. This can be done every time, or use persisted. + +.. code-block:: python + + from mastodon import Mastodon + mastodon = Mastodon( client_id = 'pytooter_clientcred.secret', api_base_url = 'https://mastodon.social' @@ -27,14 +32,18 @@ Mastodon.py 'incrediblygoodpassword', to_file = 'pytooter_usercred.secret' ) - ''' - # Create actual API instance +To post, create an actual API instance. + +.. code-block:: python + + from mastodon import Mastodon + mastodon = Mastodon( access_token = 'pytooter_usercred.secret', api_base_url = 'https://mastodon.social' ) - mastodon.toot('Tooting from python using #mastodonpy !') + mastodon.toot('Tooting from python using #mastodonpy !') `Mastodon`_ is an ActivityPub and OStatus based twitter-like federated social network node. It has an API that allows you to interact with its