Merge branch 'master' of waschsauger.bl0rg.net:dirty-helpers
This commit is contained in:
		
						commit
						64513a9259
					
				
					 1 changed files with 9 additions and 2 deletions
				
			
		|  | @ -67,8 +67,15 @@ else: | ||||||
|     key = lambda i: i[0] |     key = lambda i: i[0] | ||||||
|     reverse = False |     reverse = False | ||||||
| 
 | 
 | ||||||
|  | try: | ||||||
|     length_name = max(len(name) for name in counts.keys()) |     length_name = max(len(name) for name in counts.keys()) | ||||||
|  | except: | ||||||
|  |     length_name = len('Total') | ||||||
|  | try: | ||||||
|     length_count = max(len(str(count)) for count in counts.values()) |     length_count = max(len(str(count)) for count in counts.values()) | ||||||
|  | except: | ||||||
|  |     length_count = 3 | ||||||
|  | 
 | ||||||
| for name, count in sorted(counts.items(), key=key, reverse=reverse): | for name, count in sorted(counts.items(), key=key, reverse=reverse): | ||||||
|     print('{0:{1}}\t{2:{3}d}'.format(name, length_name, count, length_count)) |     print('{0:{1}}\t{2:{3}d}'.format(name, length_name, count, length_count)) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue