fix merge conflict snakes

This commit is contained in:
Rahiel Kasim 2016-05-02 16:37:45 +02:00
commit 6e9f30ca6e
9 changed files with 27 additions and 9 deletions

View file

@ -1,3 +1,9 @@
**2016-05-01**
*Released 4.0.3*
- Add missing attribute ``location`` to ``InlineQuery``
**2016-04-29**
*Released 4.0.2*

View file

@ -110,7 +110,6 @@ answerCallbackQuery Yes
editMessageText Yes
editMessageCaption Yes
editMessageReplyMarkup Yes
answerCallbackQuery Yes
========================= ============
=============

View file

@ -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.

View file

@ -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',

View file

@ -83,7 +83,7 @@ from .bot import Bot
__author__ = 'devs@python-telegram-bot.org'
__version__ = '4.0.2'
__version__ = '4.0.3'
__all__ = ['Audio',
'Bot',
'Chat',

View file

@ -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:

View file

@ -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`]]):
"""

View file

@ -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)

View file

@ -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)