From 87cf6f93eb901bc1250739c637645184b20a693e Mon Sep 17 00:00:00 2001 From: Marek Marecki Date: Sun, 23 Apr 2017 15:42:59 +0200 Subject: [PATCH] Access methods for getting handle and guid of a user --- diaspy/people.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/diaspy/people.py b/diaspy/people.py index 3720924..f4a94df 100644 --- a/diaspy/people.py +++ b/diaspy/people.py @@ -81,6 +81,12 @@ class User(): def __repr__(self): return '{0} ({1})'.format(self['handle'], self['guid']) + def handle(self): + return self.data.get('diaspora_id', 'Unknown handle') + + def guid(self): + return self.data.get('guid', '') + def _fetchstream(self): self.stream = Outer(self._connection, guid=self['guid']) -- 2.25.1