tools (common/data_objects): fixed Identity
This commit is contained in:
parent
a9105242d0
commit
1c29b1cdc1
1 changed files with 8 additions and 3 deletions
|
|
@ -294,9 +294,14 @@ class Identity(object):
|
|||
self.jid_str = jid_str
|
||||
self.data = data if data is not None else {}
|
||||
|
||||
@property
|
||||
def nick(self):
|
||||
return self.data.get(u'nick')
|
||||
def __getitem__(self, key):
|
||||
return self.data[key]
|
||||
|
||||
def __getattr__(self, key):
|
||||
try:
|
||||
return self.data[key]
|
||||
except KeyError:
|
||||
raise AttributeError(key)
|
||||
|
||||
|
||||
class Identities(object):
|
||||
|
|
|
|||
Loading…
Reference in a new issue