Make methods directory structure simple

This commit is contained in:
Dan 2018-06-23 10:34:20 +02:00
parent 6c976a3708
commit 8074ef1368
27 changed files with 64 additions and 187 deletions

View File

@ -16,12 +16,16 @@
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from .callback_query import CallbackQuery
from .inline import Inline
from .answer_callback_query import AnswerCallbackQuery
from .get_inline_bot_results import GetInlineBotResults
from .request_callback_answer import RequestCallbackAnswer
from .send_inline_bot_result import SendInlineBotResult
class Bots(
CallbackQuery,
Inline
AnswerCallbackQuery,
GetInlineBotResults,
RequestCallbackAnswer,
SendInlineBotResult
):
pass

View File

@ -17,7 +17,7 @@
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from pyrogram.api import functions
from ....ext import BaseClient
from pyrogram.client.ext import BaseClient
class AnswerCallbackQuery(BaseClient):

View File

@ -1,25 +0,0 @@
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrogram is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from .answer_callback_query import AnswerCallbackQuery
class CallbackQuery(
AnswerCallbackQuery
):
pass

View File

@ -18,7 +18,7 @@
from pyrogram.api import functions, types
from pyrogram.api.errors import UnknownError
from ....ext import BaseClient
from pyrogram.client.ext import BaseClient
class GetInlineBotResults(BaseClient):

View File

@ -1,27 +0,0 @@
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrogram is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from .get_inline_bot_results import GetInlineBotResults
from .send_inline_bot_result import SendInlineBotResult
class Inline(
SendInlineBotResult,
GetInlineBotResults
):
pass

View File

@ -17,7 +17,7 @@
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from pyrogram.api import functions
from ....ext import BaseClient
from pyrogram.client.ext import BaseClient
class SendInlineBotResult(BaseClient):

View File

@ -16,22 +16,50 @@
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from .action import Action
from .delete_messages import DeleteMessages
from .edit_message_caption import EditMessageCaption
from .edit_message_reply_markup import EditMessageReplyMarkup
from .edit_message_text import EditMessageText
from .forward_messages import ForwardMessages
from .get_history import GetHistory
from .get_messages import GetMessages
from .media import Media
from .send_audio import SendAudio
from .send_chat_action import SendChatAction
from .send_contact import SendContact
from .send_document import SendDocument
from .send_gif import SendGIF
from .send_location import SendLocation
from .send_media_group import SendMediaGroup
from .send_message import SendMessage
from .update import Update
from .send_photo import SendPhoto
from .send_sticker import SendSticker
from .send_venue import SendVenue
from .send_video import SendVideo
from .send_video_note import SendVideoNote
from .send_voice import SendVoice
class Messages(
DeleteMessages,
EditMessageCaption,
EditMessageReplyMarkup,
EditMessageText,
ForwardMessages,
GetHistory,
GetMessages,
Action,
Media,
Update,
ForwardMessages,
SendMessage
SendAudio,
SendChatAction,
SendContact,
SendDocument,
SendGIF,
SendLocation,
SendMediaGroup,
SendMessage,
SendPhoto,
SendSticker,
SendVenue,
SendVideo,
SendVideoNote,
SendVoice
):
pass

View File

@ -1,25 +0,0 @@
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrogram is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from .send_chat_action import SendChatAction
class Action(
SendChatAction
):
pass

View File

@ -17,7 +17,7 @@
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from pyrogram.api import functions, types
from ....ext import BaseClient
from pyrogram.client.ext import BaseClient
class DeleteMessages(BaseClient):

View File

@ -17,7 +17,7 @@
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from pyrogram.api import functions, types
from ....ext import BaseClient, utils
from pyrogram.client.ext import BaseClient, utils
class EditMessageCaption(BaseClient):

View File

@ -17,7 +17,7 @@
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from pyrogram.api import functions, types
from ....ext import BaseClient, utils
from pyrogram.client.ext import BaseClient, utils
class EditMessageReplyMarkup(BaseClient):

View File

@ -17,7 +17,7 @@
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from pyrogram.api import functions, types
from ....ext import BaseClient, utils
from pyrogram.client.ext import BaseClient, utils
class EditMessageText(BaseClient):

View File

@ -1,47 +0,0 @@
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrogram is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from .send_audio import SendAudio
from .send_contact import SendContact
from .send_document import SendDocument
from .send_gif import SendGIF
from .send_location import SendLocation
from .send_media_group import SendMediaGroup
from .send_photo import SendPhoto
from .send_sticker import SendSticker
from .send_venue import SendVenue
from .send_video import SendVideo
from .send_video_note import SendVideoNote
from .send_voice import SendVoice
class Media(
SendContact,
SendVenue,
SendLocation,
SendMediaGroup,
SendVideoNote,
SendVoice,
SendVideo,
SendGIF,
SendSticker,
SendDocument,
SendAudio,
SendPhoto
):
pass

View File

@ -23,7 +23,7 @@ import struct
from pyrogram.api import functions, types
from pyrogram.api.errors import FileIdInvalid, FilePartMissing
from ....ext import BaseClient, utils
from pyrogram.client.ext import BaseClient, utils
class SendAudio(BaseClient):

View File

@ -17,7 +17,7 @@
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from pyrogram.api import functions
from ....ext import BaseClient, ChatAction
from pyrogram.client.ext import BaseClient, ChatAction
class SendChatAction(BaseClient):

View File

@ -17,7 +17,7 @@
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from pyrogram.api import functions, types
from ....ext import BaseClient, utils
from pyrogram.client.ext import BaseClient, utils
class SendContact(BaseClient):

View File

@ -23,7 +23,7 @@ import struct
from pyrogram.api import functions, types
from pyrogram.api.errors import FileIdInvalid, FilePartMissing
from ....ext import BaseClient, utils
from pyrogram.client.ext import BaseClient, utils
class SendDocument(BaseClient):

View File

@ -23,7 +23,7 @@ import struct
from pyrogram.api import functions, types
from pyrogram.api.errors import FileIdInvalid, FilePartMissing
from ....ext import BaseClient, utils
from pyrogram.client.ext import BaseClient, utils
class SendGIF(BaseClient):

View File

@ -17,7 +17,7 @@
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from pyrogram.api import functions, types
from ....ext import BaseClient, utils
from pyrogram.client.ext import BaseClient, utils
class SendLocation(BaseClient):

View File

@ -24,7 +24,7 @@ import struct
from pyrogram.api import functions, types
from pyrogram.api.errors import FileIdInvalid
from pyrogram.client import types as pyrogram_types
from ....ext import BaseClient, utils
from pyrogram.client.ext import BaseClient, utils
class SendMediaGroup(BaseClient):

View File

@ -22,7 +22,7 @@ import struct
from pyrogram.api import functions, types
from pyrogram.api.errors import FileIdInvalid, FilePartMissing
from ....ext import BaseClient, utils
from pyrogram.client.ext import BaseClient, utils
class SendPhoto(BaseClient):

View File

@ -22,7 +22,7 @@ import struct
from pyrogram.api import functions, types
from pyrogram.api.errors import FileIdInvalid, FilePartMissing
from ....ext import BaseClient, utils
from pyrogram.client.ext import BaseClient, utils
class SendSticker(BaseClient):

View File

@ -17,7 +17,7 @@
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from pyrogram.api import functions, types
from ....ext import BaseClient, utils
from pyrogram.client.ext import BaseClient, utils
class SendVenue(BaseClient):

View File

@ -23,7 +23,7 @@ import struct
from pyrogram.api import functions, types
from pyrogram.api.errors import FileIdInvalid, FilePartMissing
from ....ext import BaseClient, utils
from pyrogram.client.ext import BaseClient, utils
class SendVideo(BaseClient):

View File

@ -23,7 +23,7 @@ import struct
from pyrogram.api import functions, types
from pyrogram.api.errors import FileIdInvalid, FilePartMissing
from ....ext import BaseClient, utils
from pyrogram.client.ext import BaseClient, utils
class SendVideoNote(BaseClient):

View File

@ -23,7 +23,7 @@ import struct
from pyrogram.api import functions, types
from pyrogram.api.errors import FileIdInvalid, FilePartMissing
from ....ext import BaseClient, utils
from pyrogram.client.ext import BaseClient, utils
class SendVoice(BaseClient):

View File

@ -1,31 +0,0 @@
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrogram is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from .delete_messages import DeleteMessages
from .edit_message_caption import EditMessageCaption
from .edit_message_reply_markup import EditMessageReplyMarkup
from .edit_message_text import EditMessageText
class Update(
DeleteMessages,
EditMessageReplyMarkup,
EditMessageCaption,
EditMessageText
):
pass