[Pkg-libvirt-commits] [libguestfs] 108/116: mllib: use Unix.isatty

Hilko Bengen bengen at moszumanska.debian.org
Wed Nov 26 22:05:33 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag debian/1%1.29.10-1
in repository libguestfs.

commit 8a56fc8e08e4b3080ea96abf928ce280f4440d90
Author: Pino Toscano <ptoscano at redhat.com>
Date:   Tue Nov 25 11:40:04 2014 +0100

    mllib: use Unix.isatty
    
    Make use of Unix.isatty instead of our TTY.isatty_stdout, as the
    supported OCaml provides the former already.
---
 mllib/common_utils.ml | 10 +++++-----
 mllib/progress.ml     |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml
index 295981c..9fcd8dd 100644
--- a/mllib/common_utils.ml
+++ b/mllib/common_utils.ml
@@ -207,15 +207,15 @@ let rec combine3 xs ys zs =
 
 (* ANSI terminal colours. *)
 let ansi_green ?(chan = stdout) () =
-  if TTY.isatty_stdout () then output_string chan "\x1b[0;32m"
+  if Unix.isatty Unix.stdout then output_string chan "\x1b[0;32m"
 let ansi_red ?(chan = stdout) () =
-  if TTY.isatty_stdout () then output_string chan "\x1b[1;31m"
+  if Unix.isatty Unix.stdout then output_string chan "\x1b[1;31m"
 let ansi_blue ?(chan = stdout) () =
-  if TTY.isatty_stdout () then output_string chan "\x1b[1;34m"
+  if Unix.isatty Unix.stdout then output_string chan "\x1b[1;34m"
 let ansi_magenta ?(chan = stdout) () =
-  if TTY.isatty_stdout () then output_string chan "\x1b[1;35m"
+  if Unix.isatty Unix.stdout then output_string chan "\x1b[1;35m"
 let ansi_restore ?(chan = stdout) () =
-  if TTY.isatty_stdout () then output_string chan "\x1b[0m"
+  if Unix.isatty Unix.stdout then output_string chan "\x1b[0m"
 
 (* Timestamped progress messages, used for ordinary messages when not
  * --quiet.
diff --git a/mllib/progress.ml b/mllib/progress.ml
index 194120e..8cf5875 100644
--- a/mllib/progress.ml
+++ b/mllib/progress.ml
@@ -33,7 +33,7 @@ let set_up_progress_bar ?(machine_readable = false) (g : Guestfs.guestfs) =
   (* Only display progress bars if the machine_readable flag is set or
    * the output is a tty.
    *)
-  if machine_readable || TTY.isatty_stdout () then (
+  if machine_readable || Unix.isatty Unix.stdout then (
     (* Initialize the C mini library. *)
     let bar = progress_bar_init ~machine_readable in
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list