mirror of
				https://github.com/ARM-software/workload-automation.git
				synced 2025-10-31 15:12:25 +00:00 
			
		
		
		
	utils/doc: Add support for dicts to format literal
Now supports cleaner outputing of python dicts
This commit is contained in:
		| @@ -263,6 +263,9 @@ def format_literal(lit): | |||||||
|         return '``\'{}\'``'.format(lit) |         return '``\'{}\'``'.format(lit) | ||||||
|     elif hasattr(lit, 'pattern'):  # regex |     elif hasattr(lit, 'pattern'):  # regex | ||||||
|         return '``r\'{}\'``'.format(lit.pattern) |         return '``r\'{}\'``'.format(lit.pattern) | ||||||
|  |     elif isinstance(lit, dict): | ||||||
|  |         content = indent(',\n'.join("{}: {}".format(key,val) for (key,val) in lit.iteritems())) | ||||||
|  |         return '::\n\n{}'.format(indent('{{\n{}\n}}'.format(content))) | ||||||
|     else: |     else: | ||||||
|         return '``{}``'.format(lit) |         return '``{}``'.format(lit) | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user