*docstrings* -> *docs/* -> *manual/*
+----
+
+Version `0.3.2` (2013-08-):
+
+* __upd__: `diaspy.connection.getUserData()` raises `DiaspyError` when it cannot find user data,
+
----
Version `0.3.1` (2013-07-12):
class Connection():
- """Object representing connection with the server.
- It is pushed around internally and is considered private.
+ """Object representing connection with the pod.
"""
_token_regex = re.compile(r'content="(.*?)"\s+name="csrf-token')
_userinfo_regex = re.compile(r'window.current_user_attributes = ({.*})')
:returns: dict -- json formatted user info.
"""
request = self.get('bookmarklet')
- userdata = json.loads(self._userinfo_regex.search(request.text).group(1))
+ try:
+ userdata = json.loads(self._userinfo_regex.search(request.text).group(1))
+ except AttributeError:
+ raise errors.DiaspyError('cannot find user data')
return userdata
def _fetchtoken(self):
stream = diaspy.streams.Stream(test_connection)
try:
stream.post(text=post_text, photo='test-image.png')
- except (StreamError) as e:
+ except (diaspy.errors.StreamError) as e:
warnings.warn('{0}')
finally:
pass