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:
def __init__(self,
file_id: str,
thumb: PhotoSize = None,
thumb: "PhotoSize" = None,
file_name: str = None,
mime_type: str = None,
file_size: int = None):

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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