From a91996ead618492a8a90ffe68c86959ab8b829ed Mon Sep 17 00:00:00 2001 From: Marek Marecki Date: Sat, 6 Jul 2013 22:13:53 +0200 Subject: [PATCH] Moved `lookup_user()` method from `Connection()` to `Search()` --- diaspy/connection.py | 9 --------- diaspy/search.py | 13 +++++++++++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/diaspy/connection.py b/diaspy/connection.py index 0a3c9cc..9ce4057 100644 --- a/diaspy/connection.py +++ b/diaspy/connection.py @@ -176,12 +176,3 @@ class Connection(): finally: if not self.token: raise TokenError('cannot obtain token and no previous token found for reuse') return self.token - - 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. - - :param string: Handle to search for. - """ - request = self.get('people', headers={'accept': 'text/html'}, params={'q':handle}) diff --git a/diaspy/search.py b/diaspy/search.py index e1e8574..7467295 100644 --- a/diaspy/search.py +++ b/diaspy/search.py @@ -7,5 +7,14 @@ class Search(): """This object is used for searching for content on Diaspora*. """ - def __init__(self): - pass + def __init__(self, connection): + self._connection = connection + + 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. + + :param string: Handle to search for. + """ + request = self.get('people', headers={'accept': 'text/html'}, params={'q':handle}) -- 2.25.1