mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-03-14 19:48:57 +01:00
merge master into inlinebots
This commit is contained in:
commit
5c2458bfd8
33 changed files with 43 additions and 46 deletions
6
Makefile
6
Makefile
|
@ -7,11 +7,14 @@ clean:
|
|||
find . -name '*.pyo' -exec rm -f {} \;
|
||||
find . -name '*~' -exec rm -f {} \;
|
||||
|
||||
pep257:
|
||||
pep257 telegram
|
||||
|
||||
pep8:
|
||||
flake8 telegram
|
||||
|
||||
lint:
|
||||
pylint -E telegram
|
||||
pylint -E telegram --disable=no-name-in-module,import-error
|
||||
|
||||
test:
|
||||
nosetests
|
||||
|
@ -22,6 +25,7 @@ install:
|
|||
help:
|
||||
@echo "Available targets:"
|
||||
@echo "- clean Clean up the source directory"
|
||||
@echo "- pep257 Check docstring style with pep257"
|
||||
@echo "- pep8 Check style with flake8"
|
||||
@echo "- lint Check style with pylint"
|
||||
@echo "- test Run tests"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
flake8
|
||||
nose
|
||||
pep257
|
||||
pylint
|
||||
unittest2
|
||||
unittest2
|
||||
|
|
|
@ -19,9 +19,6 @@
|
|||
|
||||
"""A library that provides a Python interface to the Telegram Bot API"""
|
||||
|
||||
__author__ = 'devs@python-telegram-bot.org'
|
||||
__version__ = '3.3b1'
|
||||
|
||||
from .base import TelegramObject
|
||||
from .user import User
|
||||
from .chat import Chat
|
||||
|
@ -56,7 +53,9 @@ from .dispatcher import Dispatcher
|
|||
from .jobqueue import JobQueue
|
||||
from .updater import Updater
|
||||
|
||||
__all__ = ['Bot', 'Updater', 'Dispatcher', 'Emoji', 'TelegramError',
|
||||
__author__ = 'devs@python-telegram-bot.org'
|
||||
__version__ = '3.3b1'
|
||||
__all__ = ('Bot', 'Updater', 'Dispatcher', 'Emoji', 'TelegramError',
|
||||
'InputFile', 'ReplyMarkup', 'ForceReply', 'ReplyKeyboardHide',
|
||||
'ReplyKeyboardMarkup', 'UserProfilePhotos', 'ChatAction',
|
||||
'Location', 'Contact', 'Video', 'Sticker', 'Document', 'File',
|
||||
|
@ -64,4 +63,4 @@ __all__ = ['Bot', 'Updater', 'Dispatcher', 'Emoji', 'TelegramError',
|
|||
'User', 'TelegramObject', 'NullHandler', 'Voice', 'JobQueue',
|
||||
'InlineQuery', 'ChosenInlineResult', 'InlineQueryResultArticle',
|
||||
'InlineQueryResultGif', 'InlineQueryResultPhoto',
|
||||
'InlineQueryResultMpeg4Gif', 'InlineQueryResultVideo']
|
||||
'InlineQueryResultMpeg4Gif', 'InlineQueryResultVideo')
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
# You should have received a copy of the GNU Lesser Public License
|
||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
|
||||
"""This module contains a object that represents a Telegram Audio"""
|
||||
"""This module contains a object that represents a Telegram Audio."""
|
||||
|
||||
from telegram import TelegramObject
|
||||
|
||||
|
|
|
@ -17,14 +17,14 @@
|
|||
# You should have received a copy of the GNU Lesser Public License
|
||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
|
||||
"""Base class for Telegram Objects"""
|
||||
"""Base class for Telegram Objects."""
|
||||
|
||||
import json
|
||||
from abc import ABCMeta
|
||||
|
||||
|
||||
class TelegramObject(object):
|
||||
"""Base class for most telegram objects"""
|
||||
"""Base class for most telegram objects."""
|
||||
|
||||
__metaclass__ = ABCMeta
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
# You should have received a copy of the GNU Lesser Public License
|
||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
|
||||
"""This module contains a object that represents a Telegram Bot"""
|
||||
"""This module contains a object that represents a Telegram Bot."""
|
||||
|
||||
import functools
|
||||
import logging
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
# You should have received a copy of the GNU Lesser Public License
|
||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
|
||||
"""This module contains a object that represents a Telegram Chat"""
|
||||
"""This module contains a object that represents a Telegram Chat."""
|
||||
|
||||
from telegram import TelegramObject
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
# You should have received a copy of the GNU Lesser Public License
|
||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
|
||||
"""This module contains a object that represents a Telegram ChatAction"""
|
||||
"""This module contains a object that represents a Telegram ChatAction."""
|
||||
|
||||
|
||||
class ChatAction(object):
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
# You should have received a copy of the GNU Lesser Public License
|
||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
|
||||
"""This module contains a object that represents a Telegram Contact"""
|
||||
"""This module contains a object that represents a Telegram Contact."""
|
||||
|
||||
from telegram import TelegramObject
|
||||
|
||||
|
|
|
@ -17,10 +17,8 @@
|
|||
# You should have received a copy of the GNU Lesser Public License
|
||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
|
||||
"""This module contains the Dispatcher class."""
|
||||
|
||||
"""
|
||||
This module contains the Dispatcher class.
|
||||
"""
|
||||
import logging
|
||||
from functools import wraps
|
||||
from inspect import getargspec
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
# You should have received a copy of the GNU Lesser Public License
|
||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
|
||||
"""This module contains a object that represents a Telegram Document"""
|
||||
"""This module contains a object that represents a Telegram Document."""
|
||||
|
||||
from telegram import PhotoSize, TelegramObject
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
# You should have received a copy of the GNU Lesser Public License
|
||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
|
||||
"""This module contains a object that represents an Emoji"""
|
||||
"""This module contains a object that represents an Emoji."""
|
||||
|
||||
from future.utils import bytes_to_native_str as n
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
# You should have received a copy of the GNU Lesser Public License
|
||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
|
||||
"""This module contains a object that represents a Telegram Error"""
|
||||
"""This module contains a object that represents a Telegram Error."""
|
||||
|
||||
|
||||
def _lstrip_str(in_s, lstr):
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
# You should have received a copy of the GNU Lesser Public License
|
||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
|
||||
"""This module contains a object that represents a Telegram File"""
|
||||
"""This module contains a object that represents a Telegram File."""
|
||||
|
||||
from os.path import basename
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
# You should have received a copy of the GNU Lesser Public License
|
||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
|
||||
"""This module contains a object that represents a Telegram ForceReply"""
|
||||
"""This module contains a object that represents a Telegram ForceReply."""
|
||||
|
||||
from telegram import ReplyMarkup
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
# You should have received a copy of the GNU Lesser Public License
|
||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
|
||||
"""This module contains a object that represents a Telegram InputFile"""
|
||||
"""This module contains a object that represents a Telegram InputFile."""
|
||||
|
||||
try:
|
||||
from email.generator import _make_boundary as choose_boundary
|
||||
|
|
|
@ -17,9 +17,7 @@
|
|||
# You should have received a copy of the GNU Lesser Public License
|
||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
|
||||
"""
|
||||
This module contains the class JobQueue
|
||||
"""
|
||||
"""This module contains the class JobQueue."""
|
||||
|
||||
import logging
|
||||
import time
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
# You should have received a copy of the GNU Lesser Public License
|
||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
|
||||
"""This module contains a object that represents a Telegram Location"""
|
||||
"""This module contains a object that represents a Telegram Location."""
|
||||
|
||||
from telegram import TelegramObject
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
# You should have received a copy of the GNU Lesser Public License
|
||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
|
||||
"""This module contains a object that represents a Telegram Message"""
|
||||
"""This module contains a object that represents a Telegram Message."""
|
||||
|
||||
from datetime import datetime
|
||||
from time import mktime
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
# You should have received a copy of the GNU Lesser Public License
|
||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
|
||||
"""This module contains a object that represents a logging NullHandler"""
|
||||
"""This module contains a object that represents a logging NullHandler."""
|
||||
|
||||
import logging
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
|
||||
"""This module contains a object that represents a Telegram
|
||||
Message Parse Modes"""
|
||||
Message Parse Modes."""
|
||||
|
||||
|
||||
class ParseMode(object):
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
# You should have received a copy of the GNU Lesser Public License
|
||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
|
||||
"""This module contains a object that represents a Telegram PhotoSize"""
|
||||
"""This module contains a object that represents a Telegram PhotoSize."""
|
||||
|
||||
from telegram import TelegramObject
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
|
||||
"""This module contains a object that represents a Telegram
|
||||
ReplyKeyboardHide"""
|
||||
ReplyKeyboardHide."""
|
||||
|
||||
from telegram import ReplyMarkup
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
|
||||
"""This module contains a object that represents a Telegram
|
||||
ReplyKeyboardMarkup"""
|
||||
ReplyKeyboardMarkup."""
|
||||
|
||||
from telegram import ReplyMarkup
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
# You should have received a copy of the GNU Lesser Public License
|
||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
|
||||
"""Base class for Telegram ReplyMarkup Objects"""
|
||||
"""Base class for Telegram ReplyMarkup Objects."""
|
||||
|
||||
from telegram import TelegramObject
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
# You should have received a copy of the GNU Lesser Public License
|
||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
|
||||
"""This module contains a object that represents a Telegram Sticker"""
|
||||
"""This module contains a object that represents a Telegram Sticker."""
|
||||
|
||||
from telegram import PhotoSize, TelegramObject
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
# You should have received a copy of the GNU Lesser Public License
|
||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
|
||||
"""This module contains a object that represents a Telegram Update"""
|
||||
"""This module contains a object that represents a Telegram Update."""
|
||||
|
||||
from telegram import Message, TelegramObject, InlineQuery, ChosenInlineResult
|
||||
|
||||
|
|
|
@ -18,10 +18,9 @@
|
|||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
|
||||
|
||||
"""
|
||||
This module contains the class Updater, which tries to make creating Telegram
|
||||
Bots intuitive!
|
||||
"""
|
||||
"""This module contains the class Updater, which tries to make creating
|
||||
Telegram bots intuitive."""
|
||||
|
||||
import logging
|
||||
import os
|
||||
import ssl
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
# You should have received a copy of the GNU Lesser Public License
|
||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
|
||||
"""This module contains a object that represents a Telegram User"""
|
||||
"""This module contains a object that represents a Telegram User."""
|
||||
|
||||
from telegram import TelegramObject
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
|
||||
"""This module contains a object that represents a Telegram
|
||||
UserProfilePhotos"""
|
||||
UserProfilePhotos."""
|
||||
|
||||
from telegram import PhotoSize, TelegramObject
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
# You should have received a copy of the GNU Lesser Public License
|
||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
|
||||
"""This module contains a object that represents a Telegram Video"""
|
||||
"""This module contains a object that represents a Telegram Video."""
|
||||
|
||||
from telegram import PhotoSize, TelegramObject
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
# You should have received a copy of the GNU Lesser Public License
|
||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
|
||||
"""This module contains a object that represents a Telegram Voice"""
|
||||
"""This module contains a object that represents a Telegram Voice."""
|
||||
|
||||
from telegram import TelegramObject
|
||||
|
||||
|
|
|
@ -138,13 +138,11 @@ class PhotoTest(BaseTest, unittest.TestCase):
|
|||
self.assertTrue(isinstance(thumb, telegram.PhotoSize))
|
||||
self.assertEqual(thumb.width, self.thumb['width'])
|
||||
self.assertEqual(thumb.height, self.thumb['height'])
|
||||
self.assertEqual(thumb.file_size, self.thumb['file_size'])
|
||||
|
||||
self.assertEqual(photo.file_id, self.photo_file_id)
|
||||
self.assertTrue(isinstance(photo, telegram.PhotoSize))
|
||||
self.assertEqual(photo.width, self.width)
|
||||
self.assertEqual(photo.height, self.height)
|
||||
self.assertEqual(photo.file_size, self.file_size)
|
||||
|
||||
def test_photo_de_json(self):
|
||||
"""Test Photo.de_json() method"""
|
||||
|
|
Loading…
Add table
Reference in a new issue