search for: json_optional_printf_str

Displaying 7 results from an estimated 7 matches for "json_optional_printf_str".

2014 Jan 22
1
[PATCH] builder: small code simplification
...(+), 4 deletions(-) diff --git a/builder/list_entries.ml b/builder/list_entries.ml index 742e43b..0d3d9b2 100644 --- a/builder/list_entries.ml +++ b/builder/list_entries.ml @@ -98,13 +98,11 @@ and list_entries_json ~sources index = | c -> String.make 1 c) done; !res in - let json_optional_printf_string key value = - match value with + let json_optional_printf_string key = function | None -> () | Some str -> printf " \"%s\": \"%s\",\n" key (json_string_escape str) in - let json_optional_printf_int64 key value = - match value with +...
2014 Jan 16
0
[PATCH 3/3] builder: add a JSON output for --list
...; + | '\\' -> "\\\\" + | '\b' -> "\\b" + | '\n' -> "\\n" + | '\r' -> "\\r" + | '\t' -> "\\t" + | c -> String.make 1 c) + done; + !res in + let json_optional_printf_string key value = + match value with + | None -> () + | Some str -> + printf " \"%s\": \"%s\",\n" key (json_string_escape str) in + let json_optional_printf_int64 key value = + match value with + | None -> () + | Some n -> + pri...
2014 Jan 16
5
[PATCH 0/3] Add JSON output for virt-builder
Hi, This small patch serie adds a JSON output for virt-builder. This way it is possible to parse the list of available templates, with no need to parse the unstructured and possibly changing short and long outputs of virt-builder. Pino Toscano (3): builder: small refactor of the list output builder: add --list-format builder: add a JSON output for --list builder/builder.ml
2014 Oct 10
0
[PATCH 3/3] builder: use the JSON module
...; - | '\\' -> "\\\\" - | '\b' -> "\\b" - | '\n' -> "\\n" - | '\r' -> "\\r" - | '\t' -> "\\t" - | c -> String.make 1 c) - done; - !res in - let json_optional_printf_string key = function - | None -> () - | Some str -> - printf " \"%s\": \"%s\",\n" key (json_string_escape str) in - let json_optional_printf_int64 key = function - | None -> () - | Some n -> - printf " \"%s\": \&quot...
2014 Jan 22
2
[PATCH] builder: read all the available notes from the index
...uot;", notes) :: _ -> + printf " \"notes\": \"%s\",\n" (json_string_escape notes) + | _ -> () in printf "{\n"; printf " \"version\": %d,\n" 1; @@ -132,7 +136,7 @@ and list_entries_json ~sources index = json_optional_printf_string "full-name" printable_name; printf " \"size\": %Ld,\n" size; json_optional_printf_int64 "compressed-size" compressed_size; - json_optional_printf_string "notes" notes; + print_notes notes; printf " \&quot...
2014 Feb 24
2
[PATCH] builder: add a mandatory 'arch' key in index files
...size = size; compressed_size = compressed_size; notes = notes; @@ -175,6 +178,7 @@ and list_entries_json ~sources index = printf " {\n"; printf " \"os-version\": \"%s\",\n" name; json_optional_printf_string "full-name" printable_name; + printf " \"arch\": \"%s\",\n" arch; printf " \"size\": %Ld,\n" size; json_optional_printf_int64 "compressed-size" compressed_size; print_notes notes; diff --git a/b...
2014 Oct 10
4
[PATCH 1/3] Move JSON to mllib
Move the simple OCaml JSON writer to mllib, so that can be enhanced and used also outside v2v. --- mllib/JSON.ml | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ mllib/JSON.mli | 26 ++++++++++++++++++++++++++ mllib/Makefile.am | 5 ++++- po/POTFILES-ml | 2 +- v2v/JSON.ml | 53 ----------------------------------------------------- v2v/JSON.mli | 26