From 5c2893111a2d4018d60454b3a6848b1bc6653991 Mon Sep 17 00:00:00 2001 From: Jacob Bom Date: Sun, 18 Jun 2017 12:35:00 +0200 Subject: [PATCH 1/3] Move a lot of files --- telegram/__init__.py | 108 +++++++++--------- telegram/files/__init__.py | 0 telegram/{ => files}/audio.py | 0 telegram/{ => files}/contact.py | 0 telegram/{ => files}/document.py | 0 telegram/{ => files}/file.py | 0 telegram/{ => files}/inputfile.py | 0 telegram/{ => files}/location.py | 0 telegram/{ => files}/photosize.py | 0 telegram/{ => files}/sticker.py | 0 telegram/{ => files}/venue.py | 0 telegram/{ => files}/video.py | 0 telegram/{ => files}/videonote.py | 0 telegram/{ => files}/voice.py | 0 telegram/games/__init__.py | 0 telegram/{ => games}/animation.py | 0 telegram/{ => games}/callbackgame.py | 0 telegram/{ => games}/game.py | 0 telegram/{ => games}/gamehighscore.py | 0 telegram/inline/__init__.py | 0 telegram/{ => inline}/inlinekeyboardbutton.py | 0 telegram/{ => inline}/inlinekeyboardmarkup.py | 0 telegram/{ => inline}/inlinequery.py | 0 telegram/{ => inline}/inlinequeryresult.py | 0 .../{ => inline}/inlinequeryresultarticle.py | 0 .../{ => inline}/inlinequeryresultaudio.py | 0 .../inlinequeryresultcachedaudio.py | 0 .../inlinequeryresultcacheddocument.py | 0 .../inlinequeryresultcachedgif.py | 0 .../inlinequeryresultcachedmpeg4gif.py | 0 .../inlinequeryresultcachedphoto.py | 0 .../inlinequeryresultcachedsticker.py | 0 .../inlinequeryresultcachedvideo.py | 0 .../inlinequeryresultcachedvoice.py | 0 .../{ => inline}/inlinequeryresultcontact.py | 0 .../{ => inline}/inlinequeryresultdocument.py | 0 .../{ => inline}/inlinequeryresultgame.py | 0 telegram/{ => inline}/inlinequeryresultgif.py | 0 .../{ => inline}/inlinequeryresultlocation.py | 0 .../{ => inline}/inlinequeryresultmpeg4gif.py | 0 .../{ => inline}/inlinequeryresultphoto.py | 0 .../{ => inline}/inlinequeryresultvenue.py | 0 .../{ => inline}/inlinequeryresultvideo.py | 0 .../{ => inline}/inlinequeryresultvoice.py | 0 .../inputcontactmessagecontent.py | 0 .../inputlocationmessagecontent.py | 0 telegram/{ => inline}/inputmessagecontent.py | 0 .../{ => inline}/inputtextmessagecontent.py | 0 .../{ => inline}/inputvenuemessagecontent.py | 0 telegram/payment/__init__.py | 0 telegram/{ => payment}/invoice.py | 0 telegram/{ => payment}/labeledprice.py | 0 telegram/{ => payment}/orderinfo.py | 0 telegram/{ => payment}/precheckoutquery.py | 0 telegram/{ => payment}/shippingaddress.py | 0 telegram/{ => payment}/shippingoption.py | 0 telegram/{ => payment}/shippingquery.py | 0 telegram/{ => payment}/successfulpayment.py | 0 58 files changed, 52 insertions(+), 56 deletions(-) create mode 100644 telegram/files/__init__.py rename telegram/{ => files}/audio.py (100%) rename telegram/{ => files}/contact.py (100%) rename telegram/{ => files}/document.py (100%) rename telegram/{ => files}/file.py (100%) rename telegram/{ => files}/inputfile.py (100%) rename telegram/{ => files}/location.py (100%) rename telegram/{ => files}/photosize.py (100%) rename telegram/{ => files}/sticker.py (100%) rename telegram/{ => files}/venue.py (100%) rename telegram/{ => files}/video.py (100%) rename telegram/{ => files}/videonote.py (100%) rename telegram/{ => files}/voice.py (100%) create mode 100644 telegram/games/__init__.py rename telegram/{ => games}/animation.py (100%) rename telegram/{ => games}/callbackgame.py (100%) rename telegram/{ => games}/game.py (100%) rename telegram/{ => games}/gamehighscore.py (100%) create mode 100644 telegram/inline/__init__.py rename telegram/{ => inline}/inlinekeyboardbutton.py (100%) rename telegram/{ => inline}/inlinekeyboardmarkup.py (100%) rename telegram/{ => inline}/inlinequery.py (100%) rename telegram/{ => inline}/inlinequeryresult.py (100%) rename telegram/{ => inline}/inlinequeryresultarticle.py (100%) rename telegram/{ => inline}/inlinequeryresultaudio.py (100%) rename telegram/{ => inline}/inlinequeryresultcachedaudio.py (100%) rename telegram/{ => inline}/inlinequeryresultcacheddocument.py (100%) rename telegram/{ => inline}/inlinequeryresultcachedgif.py (100%) rename telegram/{ => inline}/inlinequeryresultcachedmpeg4gif.py (100%) rename telegram/{ => inline}/inlinequeryresultcachedphoto.py (100%) rename telegram/{ => inline}/inlinequeryresultcachedsticker.py (100%) rename telegram/{ => inline}/inlinequeryresultcachedvideo.py (100%) rename telegram/{ => inline}/inlinequeryresultcachedvoice.py (100%) rename telegram/{ => inline}/inlinequeryresultcontact.py (100%) rename telegram/{ => inline}/inlinequeryresultdocument.py (100%) rename telegram/{ => inline}/inlinequeryresultgame.py (100%) rename telegram/{ => inline}/inlinequeryresultgif.py (100%) rename telegram/{ => inline}/inlinequeryresultlocation.py (100%) rename telegram/{ => inline}/inlinequeryresultmpeg4gif.py (100%) rename telegram/{ => inline}/inlinequeryresultphoto.py (100%) rename telegram/{ => inline}/inlinequeryresultvenue.py (100%) rename telegram/{ => inline}/inlinequeryresultvideo.py (100%) rename telegram/{ => inline}/inlinequeryresultvoice.py (100%) rename telegram/{ => inline}/inputcontactmessagecontent.py (100%) rename telegram/{ => inline}/inputlocationmessagecontent.py (100%) rename telegram/{ => inline}/inputmessagecontent.py (100%) rename telegram/{ => inline}/inputtextmessagecontent.py (100%) rename telegram/{ => inline}/inputvenuemessagecontent.py (100%) create mode 100644 telegram/payment/__init__.py rename telegram/{ => payment}/invoice.py (100%) rename telegram/{ => payment}/labeledprice.py (100%) rename telegram/{ => payment}/orderinfo.py (100%) rename telegram/{ => payment}/precheckoutquery.py (100%) rename telegram/{ => payment}/shippingaddress.py (100%) rename telegram/{ => payment}/shippingoption.py (100%) rename telegram/{ => payment}/shippingquery.py (100%) rename telegram/{ => payment}/successfulpayment.py (100%) diff --git a/telegram/__init__.py b/telegram/__init__.py index 388cd851a..10c90cc7a 100644 --- a/telegram/__init__.py +++ b/telegram/__init__.py @@ -18,23 +18,19 @@ # along with this program. If not, see [http://www.gnu.org/licenses/]. """A library that provides a Python interface to the Telegram Bot API""" -from sys import version_info -import sys -import os - from .base import TelegramObject from .user import User from .chat import Chat from .chatmember import ChatMember -from .photosize import PhotoSize -from .audio import Audio -from .voice import Voice -from .document import Document -from .sticker import Sticker -from .video import Video -from .contact import Contact -from .location import Location -from .venue import Venue +from .files.photosize import PhotoSize +from .files.audio import Audio +from .files.voice import Voice +from .files.document import Document +from .files.sticker import Sticker +from .files.video import Video +from .files.contact import Contact +from .files.location import Location +from .files.venue import Venue from .chataction import ChatAction from .userprofilephotos import UserProfilePhotos from .keyboardbutton import KeyboardButton @@ -43,56 +39,56 @@ from .replykeyboardmarkup import ReplyKeyboardMarkup from .replykeyboardremove import ReplyKeyboardRemove, ReplyKeyboardHide from .forcereply import ForceReply from .error import TelegramError -from .inputfile import InputFile -from .file import File +from .files.inputfile import InputFile +from .files.file import File from .emoji import Emoji from .parsemode import ParseMode from .messageentity import MessageEntity -from .animation import Animation -from .game import Game -from .shippingaddress import ShippingAddress -from .orderinfo import OrderInfo -from .successfulpayment import SuccessfulPayment -from .invoice import Invoice +from .games.animation import Animation +from .games.game import Game +from .payment.shippingaddress import ShippingAddress +from .payment.orderinfo import OrderInfo +from .payment.successfulpayment import SuccessfulPayment +from .payment.invoice import Invoice from .message import Message -from .inputmessagecontent import InputMessageContent from .callbackquery import CallbackQuery from .choseninlineresult import ChosenInlineResult -from .inlinekeyboardbutton import InlineKeyboardButton -from .inlinekeyboardmarkup import InlineKeyboardMarkup -from .inlinequery import InlineQuery -from .inlinequeryresult import InlineQueryResult -from .inlinequeryresultarticle import InlineQueryResultArticle -from .inlinequeryresultaudio import InlineQueryResultAudio -from .inlinequeryresultcachedaudio import InlineQueryResultCachedAudio -from .inlinequeryresultcacheddocument import InlineQueryResultCachedDocument -from .inlinequeryresultcachedgif import InlineQueryResultCachedGif -from .inlinequeryresultcachedmpeg4gif import InlineQueryResultCachedMpeg4Gif -from .inlinequeryresultcachedphoto import InlineQueryResultCachedPhoto -from .inlinequeryresultcachedsticker import InlineQueryResultCachedSticker -from .inlinequeryresultcachedvideo import InlineQueryResultCachedVideo -from .inlinequeryresultcachedvoice import InlineQueryResultCachedVoice -from .inlinequeryresultcontact import InlineQueryResultContact -from .inlinequeryresultdocument import InlineQueryResultDocument -from .inlinequeryresultgif import InlineQueryResultGif -from .inlinequeryresultlocation import InlineQueryResultLocation -from .inlinequeryresultmpeg4gif import InlineQueryResultMpeg4Gif -from .inlinequeryresultphoto import InlineQueryResultPhoto -from .inlinequeryresultvenue import InlineQueryResultVenue -from .inlinequeryresultvideo import InlineQueryResultVideo -from .inlinequeryresultvoice import InlineQueryResultVoice -from .inlinequeryresultgame import InlineQueryResultGame -from .inputtextmessagecontent import InputTextMessageContent -from .inputlocationmessagecontent import InputLocationMessageContent -from .inputvenuemessagecontent import InputVenueMessageContent -from .inputcontactmessagecontent import InputContactMessageContent -from .labeledprice import LabeledPrice -from .shippingoption import ShippingOption -from .precheckoutquery import PreCheckoutQuery -from .shippingquery import ShippingQuery +from .inline.inlinekeyboardbutton import InlineKeyboardButton +from .inline.inlinekeyboardmarkup import InlineKeyboardMarkup +from .inline.inputmessagecontent import InputMessageContent +from .inline.inlinequery import InlineQuery +from .inline.inlinequeryresult import InlineQueryResult +from .inline.inlinequeryresultarticle import InlineQueryResultArticle +from .inline.inlinequeryresultaudio import InlineQueryResultAudio +from .inline.inlinequeryresultcachedaudio import InlineQueryResultCachedAudio +from .inline.inlinequeryresultcacheddocument import InlineQueryResultCachedDocument +from .inline.inlinequeryresultcachedgif import InlineQueryResultCachedGif +from .inline.inlinequeryresultcachedmpeg4gif import InlineQueryResultCachedMpeg4Gif +from .inline.inlinequeryresultcachedphoto import InlineQueryResultCachedPhoto +from .inline.inlinequeryresultcachedsticker import InlineQueryResultCachedSticker +from .inline.inlinequeryresultcachedvideo import InlineQueryResultCachedVideo +from .inline.inlinequeryresultcachedvoice import InlineQueryResultCachedVoice +from .inline.inlinequeryresultcontact import InlineQueryResultContact +from .inline.inlinequeryresultdocument import InlineQueryResultDocument +from .inline.inlinequeryresultgif import InlineQueryResultGif +from .inline.inlinequeryresultlocation import InlineQueryResultLocation +from .inline.inlinequeryresultmpeg4gif import InlineQueryResultMpeg4Gif +from .inline.inlinequeryresultphoto import InlineQueryResultPhoto +from .inline.inlinequeryresultvenue import InlineQueryResultVenue +from .inline.inlinequeryresultvideo import InlineQueryResultVideo +from .inline.inlinequeryresultvoice import InlineQueryResultVoice +from .inline.inlinequeryresultgame import InlineQueryResultGame +from .inline.inputtextmessagecontent import InputTextMessageContent +from .inline.inputlocationmessagecontent import InputLocationMessageContent +from .inline.inputvenuemessagecontent import InputVenueMessageContent +from .inline.inputcontactmessagecontent import InputContactMessageContent +from .payment.labeledprice import LabeledPrice +from .payment.shippingoption import ShippingOption +from .payment.precheckoutquery import PreCheckoutQuery +from .payment.shippingquery import ShippingQuery from .webhookinfo import WebhookInfo -from .gamehighscore import GameHighScore -from .videonote import VideoNote +from .games.gamehighscore import GameHighScore +from .files.videonote import VideoNote from .update import Update from .bot import Bot from .constants import (MAX_MESSAGE_LENGTH, MAX_CAPTION_LENGTH, SUPPORTED_WEBHOOK_PORTS, diff --git a/telegram/files/__init__.py b/telegram/files/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/telegram/audio.py b/telegram/files/audio.py similarity index 100% rename from telegram/audio.py rename to telegram/files/audio.py diff --git a/telegram/contact.py b/telegram/files/contact.py similarity index 100% rename from telegram/contact.py rename to telegram/files/contact.py diff --git a/telegram/document.py b/telegram/files/document.py similarity index 100% rename from telegram/document.py rename to telegram/files/document.py diff --git a/telegram/file.py b/telegram/files/file.py similarity index 100% rename from telegram/file.py rename to telegram/files/file.py diff --git a/telegram/inputfile.py b/telegram/files/inputfile.py similarity index 100% rename from telegram/inputfile.py rename to telegram/files/inputfile.py diff --git a/telegram/location.py b/telegram/files/location.py similarity index 100% rename from telegram/location.py rename to telegram/files/location.py diff --git a/telegram/photosize.py b/telegram/files/photosize.py similarity index 100% rename from telegram/photosize.py rename to telegram/files/photosize.py diff --git a/telegram/sticker.py b/telegram/files/sticker.py similarity index 100% rename from telegram/sticker.py rename to telegram/files/sticker.py diff --git a/telegram/venue.py b/telegram/files/venue.py similarity index 100% rename from telegram/venue.py rename to telegram/files/venue.py diff --git a/telegram/video.py b/telegram/files/video.py similarity index 100% rename from telegram/video.py rename to telegram/files/video.py diff --git a/telegram/videonote.py b/telegram/files/videonote.py similarity index 100% rename from telegram/videonote.py rename to telegram/files/videonote.py diff --git a/telegram/voice.py b/telegram/files/voice.py similarity index 100% rename from telegram/voice.py rename to telegram/files/voice.py diff --git a/telegram/games/__init__.py b/telegram/games/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/telegram/animation.py b/telegram/games/animation.py similarity index 100% rename from telegram/animation.py rename to telegram/games/animation.py diff --git a/telegram/callbackgame.py b/telegram/games/callbackgame.py similarity index 100% rename from telegram/callbackgame.py rename to telegram/games/callbackgame.py diff --git a/telegram/game.py b/telegram/games/game.py similarity index 100% rename from telegram/game.py rename to telegram/games/game.py diff --git a/telegram/gamehighscore.py b/telegram/games/gamehighscore.py similarity index 100% rename from telegram/gamehighscore.py rename to telegram/games/gamehighscore.py diff --git a/telegram/inline/__init__.py b/telegram/inline/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/telegram/inlinekeyboardbutton.py b/telegram/inline/inlinekeyboardbutton.py similarity index 100% rename from telegram/inlinekeyboardbutton.py rename to telegram/inline/inlinekeyboardbutton.py diff --git a/telegram/inlinekeyboardmarkup.py b/telegram/inline/inlinekeyboardmarkup.py similarity index 100% rename from telegram/inlinekeyboardmarkup.py rename to telegram/inline/inlinekeyboardmarkup.py diff --git a/telegram/inlinequery.py b/telegram/inline/inlinequery.py similarity index 100% rename from telegram/inlinequery.py rename to telegram/inline/inlinequery.py diff --git a/telegram/inlinequeryresult.py b/telegram/inline/inlinequeryresult.py similarity index 100% rename from telegram/inlinequeryresult.py rename to telegram/inline/inlinequeryresult.py diff --git a/telegram/inlinequeryresultarticle.py b/telegram/inline/inlinequeryresultarticle.py similarity index 100% rename from telegram/inlinequeryresultarticle.py rename to telegram/inline/inlinequeryresultarticle.py diff --git a/telegram/inlinequeryresultaudio.py b/telegram/inline/inlinequeryresultaudio.py similarity index 100% rename from telegram/inlinequeryresultaudio.py rename to telegram/inline/inlinequeryresultaudio.py diff --git a/telegram/inlinequeryresultcachedaudio.py b/telegram/inline/inlinequeryresultcachedaudio.py similarity index 100% rename from telegram/inlinequeryresultcachedaudio.py rename to telegram/inline/inlinequeryresultcachedaudio.py diff --git a/telegram/inlinequeryresultcacheddocument.py b/telegram/inline/inlinequeryresultcacheddocument.py similarity index 100% rename from telegram/inlinequeryresultcacheddocument.py rename to telegram/inline/inlinequeryresultcacheddocument.py diff --git a/telegram/inlinequeryresultcachedgif.py b/telegram/inline/inlinequeryresultcachedgif.py similarity index 100% rename from telegram/inlinequeryresultcachedgif.py rename to telegram/inline/inlinequeryresultcachedgif.py diff --git a/telegram/inlinequeryresultcachedmpeg4gif.py b/telegram/inline/inlinequeryresultcachedmpeg4gif.py similarity index 100% rename from telegram/inlinequeryresultcachedmpeg4gif.py rename to telegram/inline/inlinequeryresultcachedmpeg4gif.py diff --git a/telegram/inlinequeryresultcachedphoto.py b/telegram/inline/inlinequeryresultcachedphoto.py similarity index 100% rename from telegram/inlinequeryresultcachedphoto.py rename to telegram/inline/inlinequeryresultcachedphoto.py diff --git a/telegram/inlinequeryresultcachedsticker.py b/telegram/inline/inlinequeryresultcachedsticker.py similarity index 100% rename from telegram/inlinequeryresultcachedsticker.py rename to telegram/inline/inlinequeryresultcachedsticker.py diff --git a/telegram/inlinequeryresultcachedvideo.py b/telegram/inline/inlinequeryresultcachedvideo.py similarity index 100% rename from telegram/inlinequeryresultcachedvideo.py rename to telegram/inline/inlinequeryresultcachedvideo.py diff --git a/telegram/inlinequeryresultcachedvoice.py b/telegram/inline/inlinequeryresultcachedvoice.py similarity index 100% rename from telegram/inlinequeryresultcachedvoice.py rename to telegram/inline/inlinequeryresultcachedvoice.py diff --git a/telegram/inlinequeryresultcontact.py b/telegram/inline/inlinequeryresultcontact.py similarity index 100% rename from telegram/inlinequeryresultcontact.py rename to telegram/inline/inlinequeryresultcontact.py diff --git a/telegram/inlinequeryresultdocument.py b/telegram/inline/inlinequeryresultdocument.py similarity index 100% rename from telegram/inlinequeryresultdocument.py rename to telegram/inline/inlinequeryresultdocument.py diff --git a/telegram/inlinequeryresultgame.py b/telegram/inline/inlinequeryresultgame.py similarity index 100% rename from telegram/inlinequeryresultgame.py rename to telegram/inline/inlinequeryresultgame.py diff --git a/telegram/inlinequeryresultgif.py b/telegram/inline/inlinequeryresultgif.py similarity index 100% rename from telegram/inlinequeryresultgif.py rename to telegram/inline/inlinequeryresultgif.py diff --git a/telegram/inlinequeryresultlocation.py b/telegram/inline/inlinequeryresultlocation.py similarity index 100% rename from telegram/inlinequeryresultlocation.py rename to telegram/inline/inlinequeryresultlocation.py diff --git a/telegram/inlinequeryresultmpeg4gif.py b/telegram/inline/inlinequeryresultmpeg4gif.py similarity index 100% rename from telegram/inlinequeryresultmpeg4gif.py rename to telegram/inline/inlinequeryresultmpeg4gif.py diff --git a/telegram/inlinequeryresultphoto.py b/telegram/inline/inlinequeryresultphoto.py similarity index 100% rename from telegram/inlinequeryresultphoto.py rename to telegram/inline/inlinequeryresultphoto.py diff --git a/telegram/inlinequeryresultvenue.py b/telegram/inline/inlinequeryresultvenue.py similarity index 100% rename from telegram/inlinequeryresultvenue.py rename to telegram/inline/inlinequeryresultvenue.py diff --git a/telegram/inlinequeryresultvideo.py b/telegram/inline/inlinequeryresultvideo.py similarity index 100% rename from telegram/inlinequeryresultvideo.py rename to telegram/inline/inlinequeryresultvideo.py diff --git a/telegram/inlinequeryresultvoice.py b/telegram/inline/inlinequeryresultvoice.py similarity index 100% rename from telegram/inlinequeryresultvoice.py rename to telegram/inline/inlinequeryresultvoice.py diff --git a/telegram/inputcontactmessagecontent.py b/telegram/inline/inputcontactmessagecontent.py similarity index 100% rename from telegram/inputcontactmessagecontent.py rename to telegram/inline/inputcontactmessagecontent.py diff --git a/telegram/inputlocationmessagecontent.py b/telegram/inline/inputlocationmessagecontent.py similarity index 100% rename from telegram/inputlocationmessagecontent.py rename to telegram/inline/inputlocationmessagecontent.py diff --git a/telegram/inputmessagecontent.py b/telegram/inline/inputmessagecontent.py similarity index 100% rename from telegram/inputmessagecontent.py rename to telegram/inline/inputmessagecontent.py diff --git a/telegram/inputtextmessagecontent.py b/telegram/inline/inputtextmessagecontent.py similarity index 100% rename from telegram/inputtextmessagecontent.py rename to telegram/inline/inputtextmessagecontent.py diff --git a/telegram/inputvenuemessagecontent.py b/telegram/inline/inputvenuemessagecontent.py similarity index 100% rename from telegram/inputvenuemessagecontent.py rename to telegram/inline/inputvenuemessagecontent.py diff --git a/telegram/payment/__init__.py b/telegram/payment/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/telegram/invoice.py b/telegram/payment/invoice.py similarity index 100% rename from telegram/invoice.py rename to telegram/payment/invoice.py diff --git a/telegram/labeledprice.py b/telegram/payment/labeledprice.py similarity index 100% rename from telegram/labeledprice.py rename to telegram/payment/labeledprice.py diff --git a/telegram/orderinfo.py b/telegram/payment/orderinfo.py similarity index 100% rename from telegram/orderinfo.py rename to telegram/payment/orderinfo.py diff --git a/telegram/precheckoutquery.py b/telegram/payment/precheckoutquery.py similarity index 100% rename from telegram/precheckoutquery.py rename to telegram/payment/precheckoutquery.py diff --git a/telegram/shippingaddress.py b/telegram/payment/shippingaddress.py similarity index 100% rename from telegram/shippingaddress.py rename to telegram/payment/shippingaddress.py diff --git a/telegram/shippingoption.py b/telegram/payment/shippingoption.py similarity index 100% rename from telegram/shippingoption.py rename to telegram/payment/shippingoption.py diff --git a/telegram/shippingquery.py b/telegram/payment/shippingquery.py similarity index 100% rename from telegram/shippingquery.py rename to telegram/payment/shippingquery.py diff --git a/telegram/successfulpayment.py b/telegram/payment/successfulpayment.py similarity index 100% rename from telegram/successfulpayment.py rename to telegram/payment/successfulpayment.py From 4b53ed1c65d2b8f5951f0f7e3cde0fc27391312c Mon Sep 17 00:00:00 2001 From: Jacob Bom Date: Tue, 20 Jun 2017 22:41:02 +0200 Subject: [PATCH 2/3] Fix videonote import --- telegram/__init__.py | 2 +- telegram/message.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/telegram/__init__.py b/telegram/__init__.py index 10c90cc7a..4f93b8660 100644 --- a/telegram/__init__.py +++ b/telegram/__init__.py @@ -31,6 +31,7 @@ from .files.video import Video from .files.contact import Contact from .files.location import Location from .files.venue import Venue +from .files.videonote import VideoNote from .chataction import ChatAction from .userprofilephotos import UserProfilePhotos from .keyboardbutton import KeyboardButton @@ -88,7 +89,6 @@ from .payment.precheckoutquery import PreCheckoutQuery from .payment.shippingquery import ShippingQuery from .webhookinfo import WebhookInfo from .games.gamehighscore import GameHighScore -from .files.videonote import VideoNote from .update import Update from .bot import Bot from .constants import (MAX_MESSAGE_LENGTH, MAX_CAPTION_LENGTH, SUPPORTED_WEBHOOK_PORTS, diff --git a/telegram/message.py b/telegram/message.py index 73273e39b..c9cb8643e 100644 --- a/telegram/message.py +++ b/telegram/message.py @@ -23,10 +23,10 @@ from datetime import datetime from time import mktime from telegram import (Audio, Contact, Document, Chat, Location, PhotoSize, Sticker, TelegramObject, - User, Video, Voice, Venue, MessageEntity, Game, Invoice, SuccessfulPayment) + User, Video, Voice, Venue, MessageEntity, Game, Invoice, SuccessfulPayment, + VideoNote) from telegram.utils.deprecate import warn_deprecate_obj from telegram.utils.helpers import escape_html, escape_markdown -from telegram.videonote import VideoNote class Message(TelegramObject): From 512ca2643fef17a2685ae5b1b8b7f7e3b9ab3562 Mon Sep 17 00:00:00 2001 From: Jacob Bom Date: Thu, 22 Jun 2017 15:40:43 +0200 Subject: [PATCH 3/3] Fix weird import in phototest --- tests/test_photo.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/test_photo.py b/tests/test_photo.py index 81c9e88a9..a70abb77a 100644 --- a/tests/test_photo.py +++ b/tests/test_photo.py @@ -127,16 +127,15 @@ class PhotoTest(BaseTest, unittest.TestCase): @flaky(3, 1) @timeout(10) def test_send_photo_bytesio_jpg_file(self): - from telegram.inputfile import InputFile # raw image bytes raw_bytes = BytesIO(open(self.photo_bytes_jpg_no_standard, 'rb').read()) - inputfile = InputFile({"photo": raw_bytes}) + inputfile = telegram.InputFile({"photo": raw_bytes}) self.assertEqual(inputfile.mimetype, 'application/octet-stream') # raw image bytes with name info raw_bytes = BytesIO(open(self.photo_bytes_jpg_no_standard, 'rb').read()) raw_bytes.name = self.photo_bytes_jpg_no_standard - inputfile = InputFile({"photo": raw_bytes}) + inputfile = telegram.InputFile({"photo": raw_bytes}) self.assertEqual(inputfile.mimetype, 'image/jpeg') # send raw photo