projects
/
diaspy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b6061bf
)
Added __str__() and __repr__() to people.User()
author
Marek Marecki
<triviuss@gmail.com>
Fri, 5 Jul 2013 23:12:45 +0000
(
01:12
+0200)
committer
Marek Marecki
<triviuss@gmail.com>
Fri, 5 Jul 2013 23:12:45 +0000
(
01:12
+0200)
diaspy/people.py
patch
|
blob
|
blame
|
history
diff --git
a/diaspy/people.py
b/diaspy/people.py
index 8107ab2194efdd2a94919c055cc26bed87d490bd..25677fb10ea27f775a32676f155b3ac358bbf0a5 100644
(file)
--- a/
diaspy/people.py
+++ b/
diaspy/people.py
@@
-31,13
+31,19
@@
class User():
self.data = {
'guid': guid,
'handle': handle,
- 'id': id
+ 'id': id
,
}
self._do_fetch(fetch)
def __getitem__(self, key):
return self.data[key]
+ def __str__(self):
+ return self['guid']
+
+ def __repr__(self):
+ return '{0} ({1})'.format(self['diaspora_name'], self['guid'])
+
def _do_fetch(self, fetch):
if fetch == 'posts':
if self['handle'] and self['guid']: self.fetchguid()