_fetchstream() method in User() object
authorMarek Marecki <marekjm@taistelu.com>
Fri, 13 Sep 2013 22:11:03 +0000 (00:11 +0200)
committerMarek Marecki <marekjm@taistelu.com>
Fri, 13 Sep 2013 22:11:03 +0000 (00:11 +0200)
Changelog.markdown
diaspy/__init__.py
diaspy/people.py

index 9754d4a18722d4875aa5d3757281d711ab0dc446..a1af97a51199d62c1b19639ae4affb8b73e242fa 100644 (file)
@@ -25,6 +25,13 @@ up-to-date than manual and if conflicts appear they should follow the order:
 * __bug__:  `diaspy` has problems/can't connect to pods using SNI (this is an issue with requests/urllib3/python),
 
 
+----
+
+#### Version `0.4.1` (2013-09-):
+
+* __new__:  `diaspy.people.User._fetchstream()` method,
+
+
 ----
 
 #### Version `0.4.1` (2013-09-12):
index 97a21431b9cb5813d8e0250c77b5ca2e3270e950..36317c3cc01851acf3bf76e015214f0f4425a637 100644 (file)
@@ -10,4 +10,4 @@ import diaspy.notifications as notifications
 import diaspy.settings as settings
 
 
-__version__ = '0.4.1'
+__version__ = '0.4.2'
index 13aa7474e6f591b7b5f7c48aa5cca19a1195a179..67404efdcfd4da25bd1ee26ae88d5c9388f0ea2c 100644 (file)
@@ -56,6 +56,9 @@ class User():
     def __repr__(self):
         return '{0} ({1})'.format(self['diaspora_name'], self['guid'])
 
+    def _fetchstream(self):
+        self.stream = Outer(self._connection, location='people/{0}.json'.format(self['guid']))
+
     def _fetch(self, fetch):
         """Fetch user posts or data.
         """
@@ -91,7 +94,6 @@ class User():
         request = request.json()
         if not len(request): raise errors.UserError('cannot extract user data: no posts to analyze')
         self.data = self._finalize_data(request[0]['author'])
-        self.stream = Outer(self._connection, location='people/{0}.json'.format(self['guid']))
 
     def fetchhandle(self, protocol='https'):
         """Fetch user data and posts using Diaspora handle.
@@ -99,6 +101,7 @@ class User():
         pod, user = sephandle(self['handle'])
         request = self._connection.get('{0}://{1}/u/{2}.json'.format(protocol, pod, user), direct=True)
         self._postproc(request)
+        self._fetchstream()
 
     def fetchguid(self):
         """Fetch user data and posts using guid.
@@ -106,6 +109,7 @@ class User():
         if self['guid']:
             request = self._connection.get('people/{0}.json'.format(self['guid']))
             self._postproc(request)
+            self._fetchstream()
         else:
             raise errors.UserError('GUID not set')