]> matita.cs.unibo.it Git - helm.git/commitdiff
- ported to new output_html Disambiguate callback
authorStefano Zacchiroli <zack@upsilon.cc>
Tue, 16 Dec 2003 17:56:42 +0000 (17:56 +0000)
committerStefano Zacchiroli <zack@upsilon.cc>
Tue, 16 Dec 2003 17:56:42 +0000 (17:56 +0000)
- removed netclient dependency

helm/searchEngine/Makefile
helm/searchEngine/searchEngine.ml

index a2287e77d1005763c5e5dd72c99c7d36f040e9b9..e7b9555e418a6bab87dc4e75f416c285f46fce12 100644 (file)
@@ -1,6 +1,6 @@
 REQUIRES = http helm-cic_textual_parser helm-cic_proof_checking \
            helm-xml gdome2-xslt helm-cic_unification helm-mathql \
-           helm-mathql_interpreter helm-mathql_generator netclient
+           helm-mathql_interpreter helm-mathql_generator
 OCAMLOPTIONS = -package "$(REQUIRES)" -pp camlp4o -I ../gTopLevel
 OCAMLC = ocamlfind ocamlc $(OCAMLOPTIONS)
 OCAMLOPT = ocamlfind ocamlopt $(OCAMLOPTIONS)
index 535b5f83f398408ac3bca5b534eeaa3e9e921c1a..a140666aca5d3d2434f78bcd6d3bac75592ed246 100644 (file)
@@ -345,7 +345,7 @@ let callback (req: Http_types.request) outchan =
       if List.mem server_and_port valid_servers then
         Http_daemon.respond
           ~headers:["Content-Type", "text/html"]
-          ~body:(Http_client.Convenience.http_get url)
+          ~body:(Http_client.http_get url)
           outchan
       else
         Http_daemon.respond
@@ -413,7 +413,16 @@ List.iter (fun u -> prerr_endline ("<" ^ Netencoding.Url.decode u ^ ">")) tail;
             let set_metasenv metasenv =
               CicTextualParser0.metasenv := metasenv
 
-            let output_html = prerr_endline
+            let output_html ?(append_NL = true) html_msg =
+              let rec collect_string = function
+                | `BR -> "\n"
+                | `T s -> s
+                | `L tags -> String.concat "" (List.map collect_string tags)
+              in
+              match html_msg with
+              | `Error msg | `Msg msg ->
+                  (if append_NL then prerr_endline else prerr_string)
+                    (collect_string msg ^ (if append_NL then "\n" else ""))
 
             let interactive_user_uri_choice
               ~selection_mode ?ok