search for: istty

Displaying 16 results from an estimated 16 matches for "istty".

Did you mean: isatty
2014 Nov 25
3
[PATCH] 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
2016 Jun 18
8
[PATCH 0/7] p2v: Multiple improvements to the look of virt-p2v.
In the run dialog, I have implemented an ANSI colour escape sequence interpreter, so that colours displayed by the remote virt-v2v are now shown to the user. (https://bugzilla.redhat.com/show_bug.cgi?id=1314244) This requires virt-v2v to send colours. It wasn't doing that because the output was a pipe (as we capture the output into the log file). So I added a global --colours option to make
2019 Mar 28
0
[PATCH v2 1/4] common/mltools: move the code for machine readable up
...File f -> Some (open_out f) in + machine_readable_channel := chan + ); + !machine_readable_channel + in + match chan with + | None -> None + | Some chan -> + let pr fs = + ksprintf (output_string chan) fs + in + Some { pr } + (* ANSI terminal colours. *) let istty chan = Unix.isatty (Unix.descr_of_out_channel chan) @@ -236,36 +266,6 @@ let human_size i = ) ) -type machine_readable_fn = { - pr : 'a. ('a, unit, string, unit) format4 -> 'a; -} (* [@@unboxed] *) - -type machine_readable_output_type = - | NoOutput - | Channel of out...
2019 Mar 22
8
[PATCH 0/4] OCaml tools: output messages as JSON machine
Enhance the output in machine parseable mode, by outputting all the messages of OCaml tools as JSON to the machine parseable stream. Related, although not strictly needed for this (and thus can be split if requested), is the addition of the fd format for the machine readable stream. Pino Toscano (4): common/mltools: move the code for machine readable up common/mltools: make sure machine
2019 Mar 28
8
[PATCH v2 0/4] OCaml tools: output messages as JSON machine
Enhance the output in machine parseable mode, by outputting all the messages of OCaml tools as JSON to the machine parseable stream. Related, although not strictly needed for this (and thus can be split if requested), is the addition of the fd format for the machine readable stream. Changes from v1: - use Obj.magic to convert int -> Unix.file_descr - add tests Pino Toscano (4):
2019 Mar 22
0
[PATCH 4/4] OCaml tools: output messages into JSON for machine readable
...ring : unit -> string = "guestfs_int_mllib_rfc3999_date_time_string" type machine_readable_fn = { pr : 'a. ('a, unit, string, unit) format4 -> 'a; @@ -85,12 +86,24 @@ let ansi_magenta ?(chan = stdout) () = let ansi_restore ?(chan = stdout) () = if colours () || istty chan then output_string chan "\x1b[0m" +let log_as_json msgtype msg = + match machine_readable () with + | None -> () + | Some { pr } -> + let json = [ + "message", JSON.String msg; + "timestamp", JSON.String (c_rfc3999_date_time_string ()); +...
2015 Jan 28
4
[PATCH 0/3] sparsify: Ignore read-only LVs (RHBZ#1185561).
virt-sparsify shouldn't die if sparsifying a filesystem that contains read-only LVs. https://bugzilla.redhat.com/show_bug.cgi?id=1185561 I thought about trying to make the LV writable temporarily, but I suspect that if the sysadmin has made the LV read-only, then they probably did it for a reason, so we shouldn't touch it. Rich.
2015 Nov 10
7
[PATCH 0/4]: mllib: Add 'may' function, and refactoring.
The 'may' function is a higher-order function (HOF) that replaces: match x with | None -> () | Some x -> f x with: may f x The idea comes from lablgtk (OCaml Gtk bindings) where it is widely used. If this change is clearer than previous code, then this could be used in many more places. However I previously steered clear from using HOFs like this because they can be
2019 Mar 28
0
[PATCH v2 4/4] OCaml tools: output messages into JSON for machine readable
...ring : unit -> string = "guestfs_int_mllib_rfc3999_date_time_string" type machine_readable_fn = { pr : 'a. ('a, unit, string, unit) format4 -> 'a; @@ -86,12 +87,24 @@ let ansi_magenta ?(chan = stdout) () = let ansi_restore ?(chan = stdout) () = if colours () || istty chan then output_string chan "\x1b[0m" +let log_as_json msgtype msg = + match machine_readable () with + | None -> () + | Some { pr } -> + let json = [ + "message", JSON.String msg; + "timestamp", JSON.String (c_rfc3999_date_time_string ()); +...
2017 Jun 15
0
[PATCH v6 04/41] mllib: Split ‘Common_utils’ into ‘Std_utils’ + ‘Common_utils’.
...olours - -let quiet = ref false -let set_quiet () = quiet := true -let quiet () = !quiet - -let trace = ref false -let set_trace () = trace := true -let trace () = !trace - -let verbose = ref false -let set_verbose () = verbose := true -let verbose () = !verbose - (* ANSI terminal colours. *) let istty chan = Unix.isatty (Unix.descr_of_out_channel chan) @@ -514,8 +41,6 @@ let ansi_magenta ?(chan = stdout) () = let ansi_restore ?(chan = stdout) () = if colours () || istty chan then output_string chan "\x1b[0m" -(*</stdlib>*) - (* Timestamped progress messages, used for or...
2016 Dec 08
4
[PATCH] generator: Share Common_utils code.
...; raise exn +exception Executable_not_found of string (* executable *) + let which executable = let paths = try String.nsplit ":" (Sys.getenv "PATH") @@ -390,6 +470,8 @@ let ansi_magenta ?(chan = stdout) () = let ansi_restore ?(chan = stdout) () = if colours () || istty chan then output_string chan "\x1b[0m" +(*</stdlib>*) + (* Timestamped progress messages, used for ordinary messages when not * --quiet. *) @@ -497,6 +579,8 @@ let print_version_and_exit () = let generated_by = sprintf (f_"generated by %s %s") prog Guestfs_confi...
2017 Jun 19
16
[PATCH v7 00/13] Refactor utilities
This is just the utilities part of the patch series from: https://www.redhat.com/archives/libguestfs/2017-June/msg00103.html I believe this addresses everything raised in comments on that patch series. Rich.
2017 Jun 09
12
[PATCH 00/12] Refactor utility functions.
This turned out to be rather more involved than I thought. We have lots of utility functions, spread all over the repository, with not a lot of structure. This moves many of them under common/ and structures them so there are clear dependencies. This doesn't complete the job by any means. Other items I had on my to-do list for this change were: - Split up mllib/common_utils into: -
2017 Jun 12
32
[PATCH v5 00/32] Refactor utilities, implement some APIs in OCaml.
This is a combination of: https://www.redhat.com/archives/libguestfs/2017-June/msg00046.html [PATCH 00/12] Refactor utility functions. plus: https://www.redhat.com/archives/libguestfs/2017-June/msg00023.html [PATCH v3 00/19] Allow APIs to be implemented in OCaml. with the second patches rebased on top of the utility refactoring, and some other adjustments and extensions. This passes
2017 Jun 15
45
[PATCH v6 00/41] Refactor utilities, reimplement inspection in the daemon.
v5: https://www.redhat.com/archives/libguestfs/2017-June/msg00065.html Since v5, this now implements inspection almost completely for Linux and Windows guests. Rich.
2017 Jun 21
45
[PATCH v8 00/42] Refactor utilities and reimplement inspection.
v7 was: https://www.redhat.com/archives/libguestfs/2017-June/msg00169.html https://www.redhat.com/archives/libguestfs/2017-June/msg00184.html I believe this addresses all comments received so far. Also it now passes a test where I compared about 100 disk images processed with old and new virt-inspector binaries. The output is identical in all cases except one which is caused by a bug in blkid