From 5ceb6f8f3634f8fd45b99a44b77eb5f751e9dcfe Mon Sep 17 00:00:00 2001 From: Noam Meltzer Date: Wed, 2 Aug 2017 05:56:07 +0300 Subject: [PATCH] Docs fixes (#765) * Clean warnings during build_sphinx * fix documentation types --- docs/source/_static/.placeholder | 0 telegram/bot.py | 2 +- telegram/callbackquery.py | 2 +- telegram/ext/updater.py | 4 ++-- telegram/utils/request.py | 30 +++++++++++++++--------------- 5 files changed, 19 insertions(+), 19 deletions(-) create mode 100644 docs/source/_static/.placeholder diff --git a/docs/source/_static/.placeholder b/docs/source/_static/.placeholder new file mode 100644 index 000000000..e69de29bb diff --git a/telegram/bot.py b/telegram/bot.py index c78655457..9c1177f08 100644 --- a/telegram/bot.py +++ b/telegram/bot.py @@ -616,7 +616,7 @@ class Bot(TelegramObject): the Internet, or upload a new one using multipart/form-data. Lastly you can pass an existing :class:`telegram.Video` object to send. duration (:obj:`int`, optional): Duration of sent video in seconds. - width (Optional[int)): Video width. + width (:obj:`int`, optional): Video width. height (:obj:`int`, optional): Video height. caption (:obj:`str`, optional): Video caption (may also be used when resending videos by file_id), 0-200 characters. diff --git a/telegram/callbackquery.py b/telegram/callbackquery.py index 947d04503..8c28a52a2 100644 --- a/telegram/callbackquery.py +++ b/telegram/callbackquery.py @@ -31,7 +31,7 @@ class CallbackQuery(TelegramObject): Note: * In Python `from` is a reserved word, use `from_user` instead. - Exactly one of the fields :attr:`data` or :attr:`game_short_name` will be present. + * Exactly one of the fields :attr:`data` or :attr:`game_short_name` will be present. Attributes: id (:obj:`str`): Unique identifier for this query. diff --git a/telegram/ext/updater.py b/telegram/ext/updater.py index ffd2195d3..27d204b61 100644 --- a/telegram/ext/updater.py +++ b/telegram/ext/updater.py @@ -222,8 +222,8 @@ class Updater(object): key (:obj:`str`, optional): Path to the SSL key file. clean (:obj:`bool`, optional): Whether to clean any pending updates on Telegram servers before actually starting the webhook. Default is ``False``. - bootstrap_retries (Optional[int[): Whether the bootstrapping phase of the `Updater` - will retry on failures on the Telegram server. + bootstrap_retries (:obj:`int`, optional): Whether the bootstrapping phase of the + `Updater` will retry on failures on the Telegram server. * < 0 - retry indefinitely * 0 - no retries (default) diff --git a/telegram/utils/request.py b/telegram/utils/request.py index 73d4b12eb..f4654eb55 100644 --- a/telegram/utils/request.py +++ b/telegram/utils/request.py @@ -215,10 +215,10 @@ class Request(object): """Request an URL. Args: - url (str): The web location we want to retrieve. - timeout (Optional[int|float]): If this value is specified, use it as the read timeout - from the server (instead of the one specified during creation of the connection - pool). + url (:obj:`str`): The web location we want to retrieve. + timeout (:obj:`int` | :obj:`float`): If this value is specified, use it as the read + timeout from the server (instead of the one specified during creation of the + connection pool). Returns: A JSON object. @@ -235,11 +235,11 @@ class Request(object): def post(self, url, data, timeout=None): """Request an URL. Args: - url (str): The web location we want to retrieve. + url (:obj:`str`): The web location we want to retrieve. data (dict[str, str|int]): A dict of key/value pairs. Note: On py2.7 value is unicode. - timeout (Optional[int|float]): If this value is specified, use it as the read timeout - from the server (instead of the one specified during creation of the connection - pool). + timeout (:obj:`int` | :obj:`float`): If this value is specified, use it as the read + timeout from the server (instead of the one specified during creation of the + connection pool). Returns: A JSON object. @@ -269,10 +269,10 @@ class Request(object): """Retrieve the contents of a file by its URL. Args: - url (str): The web location we want to retrieve. - timeout (Optional[int|float]): If this value is specified, use it as the read timeout - from the server (instead of the one specified during creation of the connection - pool). + url (:obj:`str`): The web location we want to retrieve. + timeout (:obj:`int` | :obj:`float`): If this value is specified, use it as the read + timeout from the server (instead of the one specified during creation of the + connection pool). """ urlopen_kwargs = {} @@ -285,9 +285,9 @@ class Request(object): """Download a file by its URL. Args: url (str): The web location we want to retrieve. - timeout (Optional[int|float]): If this value is specified, use it as the read timeout - from the server (instead of the one specified during creation of the connection - pool). + timeout (:obj:`int` | :obj:`float`): If this value is specified, use it as the read + timeout from the server (instead of the one specified during creation of the + connection pool). filename: The filename within the path to download the file.