python-telegram-bot/telegram/userprofilephotos.py
Leandro Toledo b2a4d4f5fc PEP8
2015-07-08 21:58:13 -03:00

22 lines
617 B
Python

#!/usr/bin/env python
class UserProfilePhotos(object):
def __init__(self,
total_count,
photos):
self.total_count = total_count
self.photos = photos
@staticmethod
def de_json(data):
if 'photos' in data:
from telegram import PhotoSize
photos = []
for photo in data['photos']:
photos.append([PhotoSize.de_json(x) for x in photo])
else:
photos = None
return UserProfilePhotos(total_count=data.get('total_count', None),
photos=photos)