comparison sat/tools/common/data_objects.py @ 3264:9896589487ae

tools (common/data_objects): added __iter__ to Identities
author Goffi <goffi@goffi.org>
date Sat, 25 Apr 2020 15:54:26 +0200
parents a9e8e925ad99
children 9f0e28137cd0
comparison
equal deleted inserted replaced
3263:e81ad34e8af8 3264:9896589487ae
377 return self.data[key] 377 return self.data[key]
378 except KeyError: 378 except KeyError:
379 raise AttributeError(key) 379 raise AttributeError(key)
380 380
381 381
382 class Identities(object): 382 class Identities:
383 def __init__(self): 383 def __init__(self):
384 self.identities = {} 384 self.identities = {}
385
386 def __iter__(self):
387 return iter(self.identities)
385 388
386 def __getitem__(self, jid_str): 389 def __getitem__(self, jid_str):
387 try: 390 try:
388 return self.identities[jid_str] 391 return self.identities[jid_str]
389 except KeyError: 392 except KeyError: