<s> import re <EOL> from ovhcli . utils import camel_to_bash , pretty_print_value_scalar <EOL> PREFIX = "<STR_LIT>" <EOL> def bash_pretty_print_value_scalar ( data ) : <EOL> data = str ( pretty_print_value_scalar ( data ) ) <EOL> data = re . escape ( data ) <EOL> return data <EOL> def do_format ( client , verb , method , arguments ) : <EOL> data = getattr ( client , verb . lower ( ) ) ( method , ** arguments ) <EOL> if isinstance ( data , list ) : <EOL> print PREFIX + "<STR_LIT>" + '<STR_LIT:U+0020>' . join ( data ) + "<STR_LIT:'>" <EOL> elif isinstance ( data , dict ) : <EOL> for key , value in data . iteritems ( ) : <EOL> print PREFIX + camel_to_bash ( key ) + "<STR_LIT:=>" + bash_pretty_print_value_scalar ( value ) <EOL> else : <EOL> print PREFIX + "<STR_LIT>" + bash_pretty_print_value_scalar ( value ) </s>
