2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-29 13:27:47 +00:00

Attempt to fix cyclic imports

This commit is contained in:
Dan 2018-03-10 10:50:51 +01:00
parent f26dc10ee2
commit e12a81ebb6
12 changed files with 35 additions and 71 deletions

View File

@ -1,10 +1,7 @@
from . import PhotoSize
class Animation: class Animation:
def __init__(self, def __init__(self,
file_id: str, file_id: str,
thumb: PhotoSize = None, thumb: "PhotoSize" = None,
file_name: str = None, file_name: str = None,
mime_type: str = None, mime_type: str = None,
file_size: int = None): file_size: int = None):

View File

@ -1,6 +1,3 @@
from . import Message, ChatPhoto
class Chat: class Chat:
def __init__(self, def __init__(self,
id: int, id: int,
@ -10,10 +7,10 @@ class Chat:
first_name: str = None, first_name: str = None,
last_name: str = None, last_name: str = None,
all_members_are_administrators: bool = None, all_members_are_administrators: bool = None,
photo: ChatPhoto = None, photo: "ChatPhoto" = None,
description: str = None, description: str = None,
invite_link: str = None, invite_link: str = None,
pinned_message: Message = None, pinned_message: "Message" = None,
sticker_set_name: str = None, sticker_set_name: str = None,
can_set_sticker_set: bool = None): can_set_sticker_set: bool = None):
self.id = id self.id = id

View File

@ -1,9 +1,6 @@
from . import User
class ChatMember: class ChatMember:
def __init__(self, def __init__(self,
user: User, user: "User",
status: str, status: str,
until_date: int = None, until_date: int = None,
can_be_edited: bool = None, can_be_edited: bool = None,

View File

@ -1,10 +1,7 @@
from . import PhotoSize
class Document: class Document:
def __init__(self, def __init__(self,
file_id: str, file_id: str,
thumb: PhotoSize = None, thumb: "PhotoSize" = None,
file_name: str = None, file_name: str = None,
mime_type: str = None, mime_type: str = None,
file_size: int = None): file_size: int = None):

View File

@ -1,6 +1,3 @@
from . import Animation
class Game: class Game:
def __init__(self, def __init__(self,
title: str, title: str,
@ -8,7 +5,7 @@ class Game:
photo: list, photo: list,
text: str = None, text: str = None,
text_entities: list = None, text_entities: list = None,
animation: Animation = None): animation: "Animation" = None):
self.title = title self.title = title
self.description = description self.description = description
self.photo = photo self.photo = photo

View File

@ -1,14 +1,11 @@
from . import User, Chat, Audio
class Message: class Message:
def __init__(self, def __init__(self,
message_id: int, message_id: int,
date: int, date: int,
chat: Chat, chat: "Chat",
from_user: User = None, from_user: "User" = None,
forward_from: User = None, forward_from: "User" = None,
forward_from_chat: Chat = None, forward_from_chat: "Chat" = None,
forward_from_message_id: int = None, forward_from_message_id: int = None,
forward_signature: str = None, forward_signature: str = None,
forward_date: int = None, forward_date: int = None,
@ -19,20 +16,20 @@ class Message:
text: str = None, text: str = None,
entities: list = None, entities: list = None,
caption_entities: list = None, caption_entities: list = None,
audio: Audio = None, audio: "Audio" = None,
document=None, document: "Document" = None,
game=None, game: "Game" = None,
photo=None, photo: list = None,
sticker=None, sticker: "Sticker" = None,
video=None, video: "Video" = None,
voice=None, voice: "Voice" = None,
video_note=None, video_note: "VideoNote" = None,
caption: str = None, caption: str = None,
contact=None, contact: "Contact" = None,
location=None, location: "Location" = None,
venue=None, venue: "Venue" = None,
new_chat_members: list = None, new_chat_members: list = None,
left_chat_member: User = None, left_chat_member: "User" = None,
new_chat_title: str = None, new_chat_title: str = None,
new_chat_photo: list = None, new_chat_photo: list = None,
delete_chat_photo: bool = None, delete_chat_photo: bool = None,
@ -42,9 +39,9 @@ class Message:
migrate_to_chat_id: int = None, migrate_to_chat_id: int = None,
migrate_from_chat_id: int = None, migrate_from_chat_id: int = None,
pinned_message: "Message" = None, pinned_message: "Message" = None,
invoice=None, invoice: "Invoice" = None,
successful_payment=None, successful_payment: "SuccessfulPayment" = None,
connected_website=None): connected_website: str = None):
self.message_id = message_id self.message_id = message_id
self.date = date self.date = date
self.chat = chat self.chat = chat

View File

@ -1,13 +1,10 @@
from . import User
class MessageEntity: class MessageEntity:
def __init__(self, def __init__(self,
type: str, type: str,
offset: int, offset: int,
length: int, length: int,
url: str = None, url: str = None,
user: User = None): user: "User" = None):
self.type = type self.type = type
self.offset = offset self.offset = offset
self.length = length self.length = length

View File

@ -1,15 +1,12 @@
from . import PhotoSize, MaskPosition
class Sticker: class Sticker:
def __init__(self, def __init__(self,
file_id: str, file_id: str,
width: int, width: int,
height: int, height: int,
thumb: PhotoSize = None, thumb: "PhotoSize" = None,
emoji: str = None, emoji: str = None,
set_name: str = None, set_name: str = None,
mask_position: MaskPosition = None, mask_position: "MaskPosition" = None,
file_size: int = None): file_size: int = None):
self.file_id = file_id self.file_id = file_id
self.width = width self.width = width

View File

@ -1,6 +1,3 @@
from . import Message
class Update: class Update:
"""This object represents an incoming update. """This object represents an incoming update.
At most one of the optional parameters can be present in any given update. At most one of the optional parameters can be present in any given update.
@ -18,10 +15,10 @@ class Update:
""" """
def __init__(self, def __init__(self,
message: Message = None, message: "Message" = None,
edited_message: Message = None, edited_message: "Message" = None,
channel_post: Message = None, channel_post: "Message" = None,
edited_channel_post: Message = None): edited_channel_post: "Message" = None):
self.message = message self.message = message
self.edited_message = edited_message self.edited_message = edited_message
self.channel_post = channel_post self.channel_post = channel_post

View File

@ -1,9 +1,6 @@
from . import Location
class Venue: class Venue:
def __init__(self, def __init__(self,
location: Location, location: "Location",
title: str, title: str,
address: str, address: str,
foursquare_id: str = None): foursquare_id: str = None):

View File

@ -1,13 +1,10 @@
from . import PhotoSize
class Video: class Video:
def __init__(self, def __init__(self,
file_id: str, file_id: str,
width: int, width: int,
height: int, height: int,
duration: int, duration: int,
thumb: PhotoSize = None, thumb: "PhotoSize" = None,
mime_type: str = None, mime_type: str = None,
file_size: int = None): file_size: int = None):
self.file_id = file_id self.file_id = file_id

View File

@ -1,12 +1,9 @@
from . import PhotoSize
class VideoNote: class VideoNote:
def __init__(self, def __init__(self,
file_id: str, file_id: str,
length: int, length: int,
duration: int, duration: int,
thumb: PhotoSize = None, thumb: "PhotoSize" = None,
file_size: int = None): file_size: int = None):
self.file_id = file_id self.file_id = file_id
self.length = length self.length = length