From 4b0be65a76066f3788e8df77930e0e01f170f141 Mon Sep 17 00:00:00 2001 From: Djaler Date: Sun, 1 May 2016 15:25:07 +0300 Subject: [PATCH 1/7] Fix Bot.getUpdates() docstring --- telegram/bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telegram/bot.py b/telegram/bot.py index 4b32eaea9..f9b710de4 100644 --- a/telegram/bot.py +++ b/telegram/bot.py @@ -1293,7 +1293,7 @@ class Bot(TelegramObject): long for data to be transmitted from and to the Telegram servers. Returns: - list[:class:`telegram.Message`]: A list of :class:`telegram.Update` + list[:class:`telegram.Update`]: A list of :class:`telegram.Update` objects are returned. Raises: From 0e0611767a2c0edd7b3d9bd4ef61373fafe38730 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannes=20H=C3=B6ke?= Date: Sun, 1 May 2016 20:08:34 +0200 Subject: [PATCH 2/7] add location attribute #272 --- telegram/inlinequery.py | 10 +++++++++- tests/test_inlinequery.py | 7 ++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/telegram/inlinequery.py b/telegram/inlinequery.py index 1bd9c44c8..2a9c883bf 100644 --- a/telegram/inlinequery.py +++ b/telegram/inlinequery.py @@ -19,7 +19,7 @@ """This module contains a object that represents a Telegram InlineQuery""" -from telegram import TelegramObject, User +from telegram import TelegramObject, User, Location class InlineQuery(TelegramObject): @@ -39,6 +39,10 @@ class InlineQuery(TelegramObject): from_user (:class:`telegram.User`): query (str): offset (str): + **kwargs: Arbitrary keyword arguments. + + Keyword Args: + location (optional[:class:`telegram.Location`]): """ def __init__(self, @@ -53,6 +57,9 @@ class InlineQuery(TelegramObject): self.query = query self.offset = offset + # Optional + self.location = kwargs.get('location') + @staticmethod def de_json(data): """ @@ -68,6 +75,7 @@ class InlineQuery(TelegramObject): return None data['from_user'] = User.de_json(data.get('from')) + data['location'] = Location.de_json(data.get('location')) return InlineQuery(**data) diff --git a/tests/test_inlinequery.py b/tests/test_inlinequery.py index 41af69756..4c59f86cf 100644 --- a/tests/test_inlinequery.py +++ b/tests/test_inlinequery.py @@ -37,17 +37,20 @@ class InlineQueryTest(BaseTest, unittest.TestCase): def setUp(self): user = telegram.User(1, 'First name') + location = telegram.Location(8.8, 53.1) self.id = 'id' self.from_user = user self.query = 'query text' self.offset = 'offset' + self.location = location self.json_dict = { 'id': self.id, 'from': self.from_user.to_dict(), 'query': self.query, - 'offset': self.offset + 'offset': self.offset, + 'location': self.location.to_dict() } def test_inlinequery_de_json(self): @@ -56,6 +59,8 @@ class InlineQueryTest(BaseTest, unittest.TestCase): self.assertEqual(inlinequery.id, self.id) self.assertDictEqual(inlinequery.from_user.to_dict(), self.from_user.to_dict()) + self.assertDictEqual(inlinequery.location.to_dict(), + self.location.to_dict()) self.assertEqual(inlinequery.query, self.query) self.assertEqual(inlinequery.offset, self.offset) From b5570ddfa5d0fa8e4bd7d4a67e4505ccb4dfaa6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannes=20H=C3=B6ke?= Date: Sun, 1 May 2016 22:13:24 +0200 Subject: [PATCH 3/7] update CHANGES.rst --- CHANGES.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 810c199f5..97ef55b6d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,9 @@ +**2016-05-01** + +*Released 4.0.3* + +- Add missing attribute ``location`` to ``InlineQuery`` + **2016-04-29** *Released 4.0.2* From 10a98211f8c8ef70ef509ec4975735750a698316 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannes=20H=C3=B6ke?= Date: Sun, 1 May 2016 22:13:27 +0200 Subject: [PATCH 4/7] bump version to 4.0.3 --- docs/source/conf.py | 2 +- setup.py | 2 +- telegram/__init__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index b4f592329..3443d9c7e 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -60,7 +60,7 @@ author = u'Leandro Toledo' # The short X.Y version. version = '4.0' # The full version, including alpha/beta/rc tags. -release = '4.0.2' +release = '4.0.3' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/setup.py b/setup.py index c1af1c9c3..312791c45 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ def requirements(): setup( name='python-telegram-bot', - version='4.0.2', + version='4.0.3', author='Leandro Toledo', author_email='devs@python-telegram-bot.org', license='LGPLv3', diff --git a/telegram/__init__.py b/telegram/__init__.py index ec11842c0..393b5a0af 100644 --- a/telegram/__init__.py +++ b/telegram/__init__.py @@ -81,7 +81,7 @@ from .bot import Bot __author__ = 'devs@python-telegram-bot.org' -__version__ = '4.0.2' +__version__ = '4.0.3' __all__ = ['Audio', 'Bot', 'Chat', From 335813a11a0f23c6489b4fd99491152e06f12896 Mon Sep 17 00:00:00 2001 From: Ekaterina Krivich Date: Mon, 2 May 2016 00:28:09 +0300 Subject: [PATCH 5/7] Update README.rst answerCallbackQuery mentioned twice --- README.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/README.rst b/README.rst index 617c79e44..0c8a548a4 100644 --- a/README.rst +++ b/README.rst @@ -110,7 +110,6 @@ answerCallbackQuery Yes editMessageText Yes editMessageCaption Yes editMessageReplyMarkup Yes -answerCallbackQuery Yes ========================= ============ ============= From d4f7b7165c4f749100755372d37d831cd0e582af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannes=20H=C3=B6ke?= Date: Mon, 2 May 2016 10:35:08 +0200 Subject: [PATCH 6/7] flake8: set max line length to 99 --- setup.cfg | 3 +++ 1 file changed, 3 insertions(+) diff --git a/setup.cfg b/setup.cfg index 0df889971..83200fc3a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -8,3 +8,6 @@ all_files = 1 [upload_sphinx] upload-dir = docs/build/html + +[flake8] +max-line-length = 99 \ No newline at end of file From 252cafb04ca0c2c77b96699fe85e8e41c17b948e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannes=20H=C3=B6ke?= Date: Mon, 2 May 2016 14:19:06 +0200 Subject: [PATCH 7/7] fix docs for inlinekeyboardmarkup #277 --- telegram/inlinekeyboardmarkup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telegram/inlinekeyboardmarkup.py b/telegram/inlinekeyboardmarkup.py index c54b61ba3..08e0fa116 100644 --- a/telegram/inlinekeyboardmarkup.py +++ b/telegram/inlinekeyboardmarkup.py @@ -27,10 +27,10 @@ class InlineKeyboardMarkup(ReplyMarkup): """This object represents a Telegram InlineKeyboardMarkup. Attributes: - inline_keyboard (List[List[:class:`telegram.InlineKeyboardMarkup`]]): + inline_keyboard (List[List[:class:`telegram.InlineKeyboardButton`]]): Args: - inline_keyboard (List[List[:class:`telegram.InlineKeyboardMarkup`]]): + inline_keyboard (List[List[:class:`telegram.InlineKeyboardButton`]]): """