mirror of
https://github.com/Thor77/TeamspeakStats.git
synced 2025-07-09 00:48:42 -04:00
move identmap-action from __add__ to __get__
This commit is contained in:
parent
2361211e55
commit
a914b96b39
1 changed files with 2 additions and 2 deletions
|
@ -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…
Add table
Reference in a new issue