mirror of
				https://github.com/Thor77/TeamspeakStats.git
				synced 2025-11-03 15:22:45 -05:00 
			
		
		
		
	Adapt log.parse_logs and utils.sort_clients
to Clients.__iter__ return keys instead of values
This commit is contained in:
		
							parent
							
								
									2ebd445349
								
							
						
					
					
						commit
						8d1c19a734
					
				
					 2 changed files with 5 additions and 2 deletions
				
			
		| 
						 | 
					@ -144,7 +144,9 @@ def parse_logs(log_glob, ident_map=None, online_dc=True):
 | 
				
			||||||
                clients.apply_events(itertools.chain.from_iterable(events))
 | 
					                clients.apply_events(itertools.chain.from_iterable(events))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                # find connected clients
 | 
					                # find connected clients
 | 
				
			||||||
                online_clients = list(filter(lambda c: c.connected, clients))
 | 
					                online_clients = list(
 | 
				
			||||||
 | 
					                    filter(lambda c: c.connected, clients.values())
 | 
				
			||||||
 | 
					                )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                logger.debug(
 | 
					                logger.debug(
 | 
				
			||||||
                    'Some clients are still connected: %s', online_clients
 | 
					                    'Some clients are still connected: %s', online_clients
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -13,7 +13,8 @@ def sort_clients(clients, key_l):
 | 
				
			||||||
    :rtype: list
 | 
					    :rtype: list
 | 
				
			||||||
    '''
 | 
					    '''
 | 
				
			||||||
    cl_data = [
 | 
					    cl_data = [
 | 
				
			||||||
        (client, key_l(client)) for client in clients if key_l(client) > 0
 | 
					        (client, key_l(client)) for client in clients.values()
 | 
				
			||||||
 | 
					        if key_l(client) > 0
 | 
				
			||||||
    ]
 | 
					    ]
 | 
				
			||||||
    return sorted(cl_data, key=lambda data: data[1], reverse=True)
 | 
					    return sorted(cl_data, key=lambda data: data[1], reverse=True)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue