aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorLorenz Diener <[email protected]>2017-11-24 15:25:38 +0100
committerLorenz Diener <[email protected]>2017-11-24 15:25:38 +0100
commit9e97fce2d6f350c45603f200d5cda0962b63cb86 (patch)
tree25ed6bb3e5323b1d52ee6c15676af0a91f6baf3c /docs
parente220e7cc60839ee1e3b27781b3b1cb609e593f85 (diff)
downloadmastodon.py-9e97fce2d6f350c45603f200d5cda0962b63cb86.tar.gz
Break streaming entirely, update docs
Diffstat (limited to 'docs')
-rw-r--r--docs/index.rst38
1 files changed, 28 insertions, 10 deletions
diff --git a/docs/index.rst b/docs/index.rst
index 63a8594..a8181b1 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -112,23 +112,23 @@ Error handling
112When Mastodon.py encounters an error, it will raise an exception, generally with 112When Mastodon.py encounters an error, it will raise an exception, generally with
113some text included to tell you what went wrong. 113some text included to tell you what went wrong.
114 114
115The base class that all mastodon exceptions inherit from is the MastodonError 115The base class that all mastodon exceptions inherit from is `MastodonError`.
116class. If you are only interested in the fact an error was raised somewhere in 116If you are only interested in the fact an error was raised somewhere in
117Mastodon.py, and not the details, this is the exception you can catch. 117Mastodon.py, and not the details, this is the exception you can catch.
118 118
119MastodonIllegalArgumentError is generally a programming problem - you asked the 119`MastodonIllegalArgumentError` is generally a programming problem - you asked the
120API to do something obviously invalid (i.e. specify a privacy scope that does 120API to do something obviously invalid (i.e. specify a privacy scope that does
121not exist). 121not exist).
122 122
123MastodonFileNotFoundError and MastodonNetworkError are IO errors - could be you 123`MastodonFileNotFoundError` and `MastodonNetworkError` are IO errors - could be you
124specified a wrong URL, could be the internet is down or your hard drive is 124specified a wrong URL, could be the internet is down or your hard drive is
125dying. They inherit from MastodonIOError, for easy catching. 125dying. They inherit from MastodonIOError, for easy catching.
126 126
127MastodonAPIError is an error returned from the Mastodon instance - the server 127`MastodonAPIError` is an error returned from the Mastodon instance - the server
128has decided it can't fullfill your request (i.e. you requested info on a user that 128has decided it can't fullfill your request (i.e. you requested info on a user that
129does not exist). 129does not exist).
130 130
131MastodonRatelimitError is raised when you hit an API rate limit. You should try 131`MastodonRatelimitError` is raised when you hit an API rate limit. You should try
132again after a while (see the rate limiting section above). 132again after a while (see the rate limiting section above).
133 133
134Return values 134Return values
@@ -538,10 +538,28 @@ If async is True, the listener will listen on another thread and these methods
538will return a handle corresponding to the open connection. The 538will return a handle corresponding to the open connection. The
539connection may be closed at any time by calling its close() method. 539connection may be closed at any time by calling its close() method.
540 540
541.. automethod:: Mastodon.user_stream 541The streaming functions take instances of `StreamListener` as a parameter.
542.. automethod:: Mastodon.public_stream 542A `CallbackStreamListener` class that allows you to specify function callbacks
543.. automethod:: Mastodon.local_stream 543directly is included for convenience.
544.. automethod:: Mastodon.hashtag_stream 544
545.. automethod:: Mastodon.stream_user
546.. automethod:: Mastodon.stream_public
547.. automethod:: Mastodon.stream_local
548.. automethod:: Mastodon.stream_hashtag
549
550StreamListener
551~~~~~~~~~~~~~~
552
553.. autoclass:: StreamListener
554.. automethod:: StreamListener.on_update
555.. automethod:: StreamListener.on_notification
556.. automethod:: StreamListener.on_delete
557.. automethod:: StreamListener.handle_heartbeat
558
559CallbackStreamListener
560~~~~~~~~~~~~~~~~~~~~~~
561
562.. autoclass:: CallbackStreamListener
545 563
546.. _Mastodon: https://github.com/tootsuite/mastodon 564.. _Mastodon: https://github.com/tootsuite/mastodon
547.. _Mastodon flagship instance: http://mastodon.social/ 565.. _Mastodon flagship instance: http://mastodon.social/
Powered by cgit v1.2.3 (git 2.41.0)