mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-01-09 19:49:39 +01:00
Merge pull request #674 from python-telegram-bot/restructure-internal
Move a lot of files
This commit is contained in:
commit
56949bcad6
60 changed files with 56 additions and 61 deletions
|
@ -18,23 +18,20 @@
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
"""A library that provides a Python interface to the Telegram Bot API"""
|
"""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 .base import TelegramObject
|
||||||
from .user import User
|
from .user import User
|
||||||
from .chat import Chat
|
from .chat import Chat
|
||||||
from .chatmember import ChatMember
|
from .chatmember import ChatMember
|
||||||
from .photosize import PhotoSize
|
from .files.photosize import PhotoSize
|
||||||
from .audio import Audio
|
from .files.audio import Audio
|
||||||
from .voice import Voice
|
from .files.voice import Voice
|
||||||
from .document import Document
|
from .files.document import Document
|
||||||
from .sticker import Sticker
|
from .files.sticker import Sticker
|
||||||
from .video import Video
|
from .files.video import Video
|
||||||
from .contact import Contact
|
from .files.contact import Contact
|
||||||
from .location import Location
|
from .files.location import Location
|
||||||
from .venue import Venue
|
from .files.venue import Venue
|
||||||
|
from .files.videonote import VideoNote
|
||||||
from .chataction import ChatAction
|
from .chataction import ChatAction
|
||||||
from .userprofilephotos import UserProfilePhotos
|
from .userprofilephotos import UserProfilePhotos
|
||||||
from .keyboardbutton import KeyboardButton
|
from .keyboardbutton import KeyboardButton
|
||||||
|
@ -43,56 +40,55 @@ from .replykeyboardmarkup import ReplyKeyboardMarkup
|
||||||
from .replykeyboardremove import ReplyKeyboardRemove, ReplyKeyboardHide
|
from .replykeyboardremove import ReplyKeyboardRemove, ReplyKeyboardHide
|
||||||
from .forcereply import ForceReply
|
from .forcereply import ForceReply
|
||||||
from .error import TelegramError
|
from .error import TelegramError
|
||||||
from .inputfile import InputFile
|
from .files.inputfile import InputFile
|
||||||
from .file import File
|
from .files.file import File
|
||||||
from .emoji import Emoji
|
from .emoji import Emoji
|
||||||
from .parsemode import ParseMode
|
from .parsemode import ParseMode
|
||||||
from .messageentity import MessageEntity
|
from .messageentity import MessageEntity
|
||||||
from .animation import Animation
|
from .games.animation import Animation
|
||||||
from .game import Game
|
from .games.game import Game
|
||||||
from .shippingaddress import ShippingAddress
|
from .payment.shippingaddress import ShippingAddress
|
||||||
from .orderinfo import OrderInfo
|
from .payment.orderinfo import OrderInfo
|
||||||
from .successfulpayment import SuccessfulPayment
|
from .payment.successfulpayment import SuccessfulPayment
|
||||||
from .invoice import Invoice
|
from .payment.invoice import Invoice
|
||||||
from .message import Message
|
from .message import Message
|
||||||
from .inputmessagecontent import InputMessageContent
|
|
||||||
from .callbackquery import CallbackQuery
|
from .callbackquery import CallbackQuery
|
||||||
from .choseninlineresult import ChosenInlineResult
|
from .choseninlineresult import ChosenInlineResult
|
||||||
from .inlinekeyboardbutton import InlineKeyboardButton
|
from .inline.inlinekeyboardbutton import InlineKeyboardButton
|
||||||
from .inlinekeyboardmarkup import InlineKeyboardMarkup
|
from .inline.inlinekeyboardmarkup import InlineKeyboardMarkup
|
||||||
from .inlinequery import InlineQuery
|
from .inline.inputmessagecontent import InputMessageContent
|
||||||
from .inlinequeryresult import InlineQueryResult
|
from .inline.inlinequery import InlineQuery
|
||||||
from .inlinequeryresultarticle import InlineQueryResultArticle
|
from .inline.inlinequeryresult import InlineQueryResult
|
||||||
from .inlinequeryresultaudio import InlineQueryResultAudio
|
from .inline.inlinequeryresultarticle import InlineQueryResultArticle
|
||||||
from .inlinequeryresultcachedaudio import InlineQueryResultCachedAudio
|
from .inline.inlinequeryresultaudio import InlineQueryResultAudio
|
||||||
from .inlinequeryresultcacheddocument import InlineQueryResultCachedDocument
|
from .inline.inlinequeryresultcachedaudio import InlineQueryResultCachedAudio
|
||||||
from .inlinequeryresultcachedgif import InlineQueryResultCachedGif
|
from .inline.inlinequeryresultcacheddocument import InlineQueryResultCachedDocument
|
||||||
from .inlinequeryresultcachedmpeg4gif import InlineQueryResultCachedMpeg4Gif
|
from .inline.inlinequeryresultcachedgif import InlineQueryResultCachedGif
|
||||||
from .inlinequeryresultcachedphoto import InlineQueryResultCachedPhoto
|
from .inline.inlinequeryresultcachedmpeg4gif import InlineQueryResultCachedMpeg4Gif
|
||||||
from .inlinequeryresultcachedsticker import InlineQueryResultCachedSticker
|
from .inline.inlinequeryresultcachedphoto import InlineQueryResultCachedPhoto
|
||||||
from .inlinequeryresultcachedvideo import InlineQueryResultCachedVideo
|
from .inline.inlinequeryresultcachedsticker import InlineQueryResultCachedSticker
|
||||||
from .inlinequeryresultcachedvoice import InlineQueryResultCachedVoice
|
from .inline.inlinequeryresultcachedvideo import InlineQueryResultCachedVideo
|
||||||
from .inlinequeryresultcontact import InlineQueryResultContact
|
from .inline.inlinequeryresultcachedvoice import InlineQueryResultCachedVoice
|
||||||
from .inlinequeryresultdocument import InlineQueryResultDocument
|
from .inline.inlinequeryresultcontact import InlineQueryResultContact
|
||||||
from .inlinequeryresultgif import InlineQueryResultGif
|
from .inline.inlinequeryresultdocument import InlineQueryResultDocument
|
||||||
from .inlinequeryresultlocation import InlineQueryResultLocation
|
from .inline.inlinequeryresultgif import InlineQueryResultGif
|
||||||
from .inlinequeryresultmpeg4gif import InlineQueryResultMpeg4Gif
|
from .inline.inlinequeryresultlocation import InlineQueryResultLocation
|
||||||
from .inlinequeryresultphoto import InlineQueryResultPhoto
|
from .inline.inlinequeryresultmpeg4gif import InlineQueryResultMpeg4Gif
|
||||||
from .inlinequeryresultvenue import InlineQueryResultVenue
|
from .inline.inlinequeryresultphoto import InlineQueryResultPhoto
|
||||||
from .inlinequeryresultvideo import InlineQueryResultVideo
|
from .inline.inlinequeryresultvenue import InlineQueryResultVenue
|
||||||
from .inlinequeryresultvoice import InlineQueryResultVoice
|
from .inline.inlinequeryresultvideo import InlineQueryResultVideo
|
||||||
from .inlinequeryresultgame import InlineQueryResultGame
|
from .inline.inlinequeryresultvoice import InlineQueryResultVoice
|
||||||
from .inputtextmessagecontent import InputTextMessageContent
|
from .inline.inlinequeryresultgame import InlineQueryResultGame
|
||||||
from .inputlocationmessagecontent import InputLocationMessageContent
|
from .inline.inputtextmessagecontent import InputTextMessageContent
|
||||||
from .inputvenuemessagecontent import InputVenueMessageContent
|
from .inline.inputlocationmessagecontent import InputLocationMessageContent
|
||||||
from .inputcontactmessagecontent import InputContactMessageContent
|
from .inline.inputvenuemessagecontent import InputVenueMessageContent
|
||||||
from .labeledprice import LabeledPrice
|
from .inline.inputcontactmessagecontent import InputContactMessageContent
|
||||||
from .shippingoption import ShippingOption
|
from .payment.labeledprice import LabeledPrice
|
||||||
from .precheckoutquery import PreCheckoutQuery
|
from .payment.shippingoption import ShippingOption
|
||||||
from .shippingquery import ShippingQuery
|
from .payment.precheckoutquery import PreCheckoutQuery
|
||||||
|
from .payment.shippingquery import ShippingQuery
|
||||||
from .webhookinfo import WebhookInfo
|
from .webhookinfo import WebhookInfo
|
||||||
from .gamehighscore import GameHighScore
|
from .games.gamehighscore import GameHighScore
|
||||||
from .videonote import VideoNote
|
|
||||||
from .update import Update
|
from .update import Update
|
||||||
from .bot import Bot
|
from .bot import Bot
|
||||||
from .constants import (MAX_MESSAGE_LENGTH, MAX_CAPTION_LENGTH, SUPPORTED_WEBHOOK_PORTS,
|
from .constants import (MAX_MESSAGE_LENGTH, MAX_CAPTION_LENGTH, SUPPORTED_WEBHOOK_PORTS,
|
||||||
|
|
0
telegram/files/__init__.py
Normal file
0
telegram/files/__init__.py
Normal file
0
telegram/games/__init__.py
Normal file
0
telegram/games/__init__.py
Normal file
0
telegram/inline/__init__.py
Normal file
0
telegram/inline/__init__.py
Normal file
|
@ -23,10 +23,10 @@ from datetime import datetime
|
||||||
from time import mktime
|
from time import mktime
|
||||||
|
|
||||||
from telegram import (Audio, Contact, Document, Chat, Location, PhotoSize, Sticker, TelegramObject,
|
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.deprecate import warn_deprecate_obj
|
||||||
from telegram.utils.helpers import escape_html, escape_markdown
|
from telegram.utils.helpers import escape_html, escape_markdown
|
||||||
from telegram.videonote import VideoNote
|
|
||||||
|
|
||||||
|
|
||||||
class Message(TelegramObject):
|
class Message(TelegramObject):
|
||||||
|
|
0
telegram/payment/__init__.py
Normal file
0
telegram/payment/__init__.py
Normal file
|
@ -127,16 +127,15 @@ class PhotoTest(BaseTest, unittest.TestCase):
|
||||||
@flaky(3, 1)
|
@flaky(3, 1)
|
||||||
@timeout(10)
|
@timeout(10)
|
||||||
def test_send_photo_bytesio_jpg_file(self):
|
def test_send_photo_bytesio_jpg_file(self):
|
||||||
from telegram.inputfile import InputFile
|
|
||||||
# raw image bytes
|
# raw image bytes
|
||||||
raw_bytes = BytesIO(open(self.photo_bytes_jpg_no_standard, 'rb').read())
|
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')
|
self.assertEqual(inputfile.mimetype, 'application/octet-stream')
|
||||||
|
|
||||||
# raw image bytes with name info
|
# raw image bytes with name info
|
||||||
raw_bytes = BytesIO(open(self.photo_bytes_jpg_no_standard, 'rb').read())
|
raw_bytes = BytesIO(open(self.photo_bytes_jpg_no_standard, 'rb').read())
|
||||||
raw_bytes.name = self.photo_bytes_jpg_no_standard
|
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')
|
self.assertEqual(inputfile.mimetype, 'image/jpeg')
|
||||||
|
|
||||||
# send raw photo
|
# send raw photo
|
||||||
|
|
Loading…
Reference in a new issue