package progress
User-definable progress bars
Install
Dune Dependency
Authors
Maintainers
Sources
progress-0.4.0.tbz
sha256=8be449553379bb2dc5e8b79805c80447690a03dca3e9aee959fecf46d8278fb7
sha512=841383e8aa7d6bd802ced5eb7feae01bd507b2914eb45e8a559140677f83d5b8ec614f1d0bc54421021b5254a1edd78dd8a2506b2dfb264af72448d76bd03ac5
doc/src/progress.engine/progress_engine.ml.html
Source file progress_engine.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
(*———————————————————————————————————————————————————————————————————————————— Copyright (c) 2020–2021 Craig Ferguson <me@craigfe.io> Distributed under the MIT license. See terms at the end of this file. ————————————————————————————————————————————————————————————————————————————*) open! Import include Progress_engine_intf module type Platform = Platform.S module Make (Platform : Platform) = struct module Color = Terminal.Color module Duration = Duration module Multi = Multi module Printer = Printer module Units = Units module Internals = struct module Ansi = Terminal.Style end module Config = struct include Config type t = user_supplied end module Renderer = struct include Renderer.Make (Platform) include Renderer end module Line = struct include Line.Make (Platform) include Line end module Display = Renderer.Display module Reporter = Renderer.Reporter let counter ?(style = `ASCII) ?message ?pp total = let map_option ~f x = Option.fold ~none:(Line.noop ()) ~some:f x in let open Line.Using_int64 in list [ map_option message ~f:const ; map_option pp ~f:(fun pp -> sum ~pp ~width:(Printer.print_width pp) ()) ; elapsed () ; bar ~style total ; percentage_of total ] let interject_with = Renderer.interject_with let instrument_logs_reporter = Renderer.instrument_logs_reporter let logs_reporter = Renderer.logs_reporter let with_reporters = Renderer.with_reporters let with_reporter ?config b f = with_reporters ?config (Multi.line b) f end module Integer = Integer module Exposed_for_testing = struct module Flow_meter = Flow_meter end (*———————————————————————————————————————————————————————————————————————————— Copyright (c) 2020–2021 Craig Ferguson <me@craigfe.io> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ————————————————————————————————————————————————————————————————————————————*)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>