Moved `lookup_user()` method from `Connection()` to `Search()`
authorMarek Marecki <triviuss@gmail.com>
Sat, 6 Jul 2013 20:13:53 +0000 (22:13 +0200)
committerMarek Marecki <triviuss@gmail.com>
Sat, 6 Jul 2013 20:13:53 +0000 (22:13 +0200)
diaspy/connection.py
diaspy/search.py

index 0a3c9cc6b4a422711607a0216211c20a28741fbf..9ce40570e69f628b7fb3a8fc395ed76d40d79592 100644 (file)
@@ -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})
index e1e857406b4c3514d2999bffa9ff6679dfdde774..7467295ab4e276aa2ec3dd0c90dededc1db52ff5 100644 (file)
@@ -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})