mirror of
				https://github.com/ARM-software/workload-automation.git
				synced 2025-10-30 22:54:18 +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) | ||||
|     elif hasattr(lit, 'pattern'):  # regex | ||||
|         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: | ||||
|         return '``{}``'.format(lit) | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user