This commit is contained in:
Leandro Toledo 2015-07-08 21:32:48 -03:00
parent 0214910741
commit bfe5b79ad9
4 changed files with 48 additions and 46 deletions

View file

@ -2,16 +2,15 @@
class Audio(object):
def __init__(self, **kwargs):
param_defaults = {
'file_id': None,
'duration': None,
'mime_type': None,
'file_size': None
}
for (param, default) in param_defaults.iteritems():
setattr(self, param, kwargs.get(param, default))
def __init__(self,
file_id,
duration,
mime_type=None,
file_size=None):
self.file_id = file_id
self.duration = duration
self.mime_type = mime_type
self.file_size = file_size
@staticmethod
def de_json(data):

View file

@ -2,17 +2,17 @@
class Document(object):
def __init__(self, **kwargs):
param_defaults = {
'file_id': None,
'thumb': None,
'file_name': None,
'mime_type': None,
'file_size': None
}
for (param, default) in param_defaults.iteritems():
setattr(self, param, kwargs.get(param, default))
def __init__(self,
file_id,
thumb,
file_name=None,
mime_type=None,
file_size=None):
self.file_id = file_id
self.thumb = thumb
self.file_name = file_name
self.mime_type = mime_type
self.file_size = file_size
@staticmethod
def de_json(data):

View file

@ -2,17 +2,17 @@
class Sticker(object):
def __init__(self, **kwargs):
param_defaults = {
'file_id': None,
'width': None,
'height': None,
'thumb': None,
'file_size': None
}
for (param, default) in param_defaults.iteritems():
setattr(self, param, kwargs.get(param, default))
def __init__(self,
file_id,
width,
height,
thumb,
file_size=None):
self.file_id = file_id
self.width = width
self.height = height
self.thumb = thumb
self.file_size = file_size
@staticmethod
def de_json(data):

View file

@ -2,20 +2,23 @@
class Video(object):
def __init__(self, **kwargs):
param_defaults = {
'file_id': None,
'width': None,
'height': None,
'duration': None,
'thumb': None,
'mime_type': None,
'file_size': None,
'caption': None
}
for (param, default) in param_defaults.iteritems():
setattr(self, param, kwargs.get(param, default))
def __init__(self,
file_id,
width,
height,
duration,
thumb,
mime_type=None,
file_size=None,
caption=None):
self.file_id = file_id
self.width = width
self.height = height
self.duration = duration
self.thumb = thumb
self.mime_type = mime_type
self.file_size = file_size
self.caption = caption
@staticmethod
def de_json(data):