|
|
@ -30,9 +30,13 @@ def to_nice_yaml(*a, **kw):
|
|
|
|
'''Make verbose, human readable yaml'''
|
|
|
|
'''Make verbose, human readable yaml'''
|
|
|
|
return yaml.safe_dump(*a, indent=4, allow_unicode=True, default_flow_style=False, **kw)
|
|
|
|
return yaml.safe_dump(*a, indent=4, allow_unicode=True, default_flow_style=False, **kw)
|
|
|
|
|
|
|
|
|
|
|
|
def to_nice_json(*a, **kw):
|
|
|
|
def to_json(a, *args, **kw):
|
|
|
|
|
|
|
|
''' Convert the value to JSON '''
|
|
|
|
|
|
|
|
return json.dumps(a, *args, **kw)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def to_nice_json(a, *args, **kw):
|
|
|
|
'''Make verbose, human readable JSON'''
|
|
|
|
'''Make verbose, human readable JSON'''
|
|
|
|
return json.dumps(*a, indent=4, sort_keys=True, **kw)
|
|
|
|
return json.dumps(a, indent=4, sort_keys=True, *args, **kw)
|
|
|
|
|
|
|
|
|
|
|
|
def failed(*a, **kw):
|
|
|
|
def failed(*a, **kw):
|
|
|
|
''' Test if task result yields failed '''
|
|
|
|
''' Test if task result yields failed '''
|
|
|
@ -148,7 +152,7 @@ class FilterModule(object):
|
|
|
|
'b64encode': base64.b64encode,
|
|
|
|
'b64encode': base64.b64encode,
|
|
|
|
|
|
|
|
|
|
|
|
# json
|
|
|
|
# json
|
|
|
|
'to_json': json.dumps,
|
|
|
|
'to_json': to_json,
|
|
|
|
'to_nice_json': to_nice_json,
|
|
|
|
'to_nice_json': to_nice_json,
|
|
|
|
'from_json': json.loads,
|
|
|
|
'from_json': json.loads,
|
|
|
|
|
|
|
|
|
|
|
|