move identmap-action from __add__ to __get__
This commit is contained in:
parent
2361211e55
commit
a914b96b39
|
@ -40,8 +40,6 @@ class Clients:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def __add__(self, id_or_uid):
|
def __add__(self, id_or_uid):
|
||||||
if id_or_uid in self.ident_map:
|
|
||||||
id_or_uid = self.ident_map[id_or_uid]
|
|
||||||
if self.is_id(id_or_uid):
|
if self.is_id(id_or_uid):
|
||||||
if id_or_uid not in self.clients_by_id:
|
if id_or_uid not in self.clients_by_id:
|
||||||
self.clients_by_id[id_or_uid] = Client(id_or_uid)
|
self.clients_by_id[id_or_uid] = Client(id_or_uid)
|
||||||
|
@ -51,6 +49,8 @@ class Clients:
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def __getitem__(self, id_or_uid):
|
def __getitem__(self, id_or_uid):
|
||||||
|
if id_or_uid in self.ident_map:
|
||||||
|
id_or_uid = self.ident_map[id_or_uid]
|
||||||
if self.is_id(id_or_uid):
|
if self.is_id(id_or_uid):
|
||||||
if id_or_uid not in self.clients_by_id:
|
if id_or_uid not in self.clients_by_id:
|
||||||
self += id_or_uid
|
self += id_or_uid
|
||||||
|
|
Loading…
Reference in New Issue