From a34d1853a32a15c14a2c21ca87f3afb8cd9c3fb5 Mon Sep 17 00:00:00 2001 From: Marek Marecki Date: Sat, 6 Jul 2013 22:25:33 +0200 Subject: [PATCH] `Search().lookup_user()` now returns response code (just in case somebody would find it useful) --- diaspy/search.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/diaspy/search.py b/diaspy/search.py index 7467295..6da1beb 100644 --- a/diaspy/search.py +++ b/diaspy/search.py @@ -12,9 +12,10 @@ class Search(): def lookup_user(self, handle): """This function will launch a webfinger lookup from the pod for the - handle requested. Nothing is returned but if the lookup was successful, - user should soon be searchable via this pod. - + handle requested. Response code is returned and if the lookup was successful, + user should soon be searchable via pod used for connection. + :param string: Handle to search for. """ - request = self.get('people', headers={'accept': 'text/html'}, params={'q':handle}) + request = self.get('people', headers={'accept': 'text/html'}, params={'q': handle}) + return request.status_code -- 2.25.1