wip
This commit is contained in:
		
							parent
							
								
									2eb23a5827
								
							
						
					
					
						commit
						da11f49cfb
					
				
					 2 changed files with 5 additions and 3 deletions
				
			
		|  | @ -1,7 +1,9 @@ | |||
| import json | ||||
| 
 | ||||
| class hdict(dict): | ||||
|     def __hash__(self): | ||||
|         return hash(tuple(sorted(self.items()))) | ||||
|         return hash(json.dumps(self, sorted=True)) | ||||
| 
 | ||||
| class hlist(list): | ||||
|     def __hash__(self): | ||||
|         return hash(tuple(sorted(self))) | ||||
|         return hash(json.dumps(self, sorted=True)) | ||||
|  |  | |||
|  | @ -7,7 +7,7 @@ template = ''' | |||
| # ${segment.split('#', 2)[1]} | ||||
| %     endif | ||||
| [${segment.split('#')[0]}] | ||||
| %     for option, value in options.items(): | ||||
| %     for option, value in sorted(options.items()): | ||||
| %         if isinstance(value, dict): | ||||
| %             for k, v in value.items(): | ||||
| ${option}=${k}=${v} | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 mwiegand
						mwiegand