fix docstrings for sphinx

This commit is contained in:
Jannes Höke 2015-12-16 16:18:48 +01:00
parent 6e158042e1
commit e0233a59a0
2 changed files with 17 additions and 9 deletions

View file

@ -61,22 +61,29 @@ def run_async(func):
class Dispatcher:
"""
This class dispatches all kinds of updates to its registered handlers.
A handler is a function that usually takes the following parameters
A handler is a function that usually takes the following parameters:
bot: The telegram.Bot instance that received the message
update: The update that should be handled by the handler
bot:
The telegram.Bot instance that received the message
update:
The update that should be handled by the handler
Error handlers take an additional parameter:
error: The TelegramError instance that was raised during processing the
Error handlers take an additional parameter
error:
The TelegramError instance that was raised during processing the
update
All handlers, except error handlers, can also request more information by
appending one or more of the following arguments in their argument list for
convenience:
update_queue: The Queue instance which contains all new updates and is
convenience
update_queue:
The Queue instance which contains all new updates and is
processed by the Dispatcher. Be careful with this - you might
create an infinite loop.
args: If the update is an instance str or telegram.Update, this will be
args:
If the update is an instance str or telegram.Update, this will be
a list that contains the content of the message split on spaces,
except the first word (usually the command).
Example: '/add item1 item2 item3' -> ['item1', 'item2', 'item3']

View file

@ -249,7 +249,8 @@ class Updater:
Args:
stop_signals: Iterable containing signals from the signal module
that should be subscribed to. Updater.stop() will be called on
receiving one of those signals.
receiving one of those signals. Defaults to (SIGINT, SIGTERM,
SIGABRT)
"""
for sig in stop_signals:
signal(sig, self.signal_handler)