From dadad120fc60290352a52ac4583bab04e3f68b51 Mon Sep 17 00:00:00 2001 From: Leandro Toledo Date: Wed, 8 Jul 2015 10:14:07 -0300 Subject: [PATCH] Adding UserProfilePhotos doc and flake8 minor fixes --- telegram/__init__.py | 1 + telegram/bot.py | 14 ++++++++++++++ telegram/userprofilephotos.py | 4 ++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/telegram/__init__.py b/telegram/__init__.py index 411e0d1a4..5ae7ce6a0 100644 --- a/telegram/__init__.py +++ b/telegram/__init__.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +# flake8: noqa """A library that provides a Python interface to the Telegram Bots API""" diff --git a/telegram/bot.py b/telegram/bot.py index 9d3213675..9c1674484 100644 --- a/telegram/bot.py +++ b/telegram/bot.py @@ -389,6 +389,20 @@ class Bot(object): user_id, offset=None, limit=100): + """Use this method to get a list of profile pictures for a user. + + Args: + user_id: + Unique identifier of the target user. + offset: + Sequential number of the first photo to be returned. By default, + all photos are returned. [Optional] + limit: + Limits the number of photos to be retrieved. Values between 1—100 + are accepted. Defaults to 100. [Optional] + Returns: + Returns a telegram.UserProfilePhotos object. + """ url = '%s/getUserProfilePhotos' % (self.base_url) diff --git a/telegram/userprofilephotos.py b/telegram/userprofilephotos.py index 1fc23de4d..ce111c710 100644 --- a/telegram/userprofilephotos.py +++ b/telegram/userprofilephotos.py @@ -17,9 +17,9 @@ class UserProfilePhotos(object): from telegram import PhotoSize photos = [] for photo in data['photos']: - photos.append([PhotoSize.newFromJsonDict(x) for x in photo]) + photos.append([PhotoSize.newFromJsonDict(x) for x in photo]) else: - photos= None + photos = None return UserProfilePhotos(total_count=data.get('total_count', None), photos=photos)