open Printf
+let debug = false
+let debug_print s =
+ if debug then prerr_endline ("Helm_registry debugging: " ^ s)
+
exception Malformed_key of string
exception Key_not_found of string
exception Type_error of string * string * string (* expected type, value, msg *)
(Hashtbl.find_all validators key)
let set' registry ~key ~value =
+ debug_print (sprintf "Setting %s = %s" key value);
key_is_valid key;
value_is_valid ~key ~value;
Hashtbl.replace registry key value
mk_get_set "string list" string_list_of_string string_of_string_list
let save_to fname =
+ debug_print ("Saving configuration to " ^ fname);
let oc = open_out fname in
output_string oc "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
output_string oc "<helm_registry>\n";
let config = default_config in
let entry = `Entry_document [ `Extend_dtd_fully; `Parse_xml_decl ] in
fun fname ->
+ debug_print ("Loading configuration from " ^ fname);
let document =
parse_wfdocument_entity config (from_file fname) default_spec
in