Revision 0399ac7e kamaki/cli/utils.py
b/kamaki/cli/utils.py | ||
---|---|---|
35 | 35 |
from re import compile as regex_compile |
36 | 36 |
from time import sleep |
37 | 37 |
from os import walk, path |
38 |
from json import dumps |
|
38 | 39 |
|
39 | 40 |
from kamaki.cli.errors import raiseCLIError |
40 | 41 |
|
... | ... | |
100 | 101 |
return new_d |
101 | 102 |
|
102 | 103 |
|
104 |
def print_json(data): |
|
105 |
"""Print a list or dict as json in console |
|
106 |
|
|
107 |
:param data: json-dumpable data |
|
108 |
""" |
|
109 |
print(dumps(data, indent=2)) |
|
110 |
|
|
111 |
|
|
103 | 112 |
def print_dict( |
104 | 113 |
d, exclude=(), ident=0, |
105 | 114 |
with_enumeration=False, recursive_enumeration=False): |
Also available in: Unified diff