ProgressMonitor::Stringify::ToEscStatus - monitor printing in EscStatus form
use PerlIO::via::EscStatus; binmode (STDOUT, ':via(EscStatus)') or die; use ProgressMonitor::Stringify::ToEscStatus; my $mon = ProgressMonitor::Stringify::ToEscStatus->new ({ fields => [ ProgressMonitor::Stringify::Fields::Spinner->new ]}); $mon->prepare; $mon->begin; $mon->tick; $mon->tick; # etc $mon->end;
ToEscStatus is a subclass of AbstractMonitor,
ToEscStatus
AbstractMonitor
ProgressMonitor ProgressMonitor::AbstractStatefulMonitor ProgressMonitor::Stringify::AbstractMonitor ProgressMonitor::Stringify::ToEscStatus
ToEscStatus implements a ProgressMonitor which prints status lines in EscStatus form, ready to be shown by an EscStatus layer on the output stream.
Basically where ProgressMonitor::Stringify::ToStream would do something like print "\rStatus line", the ToEscStatus instead does
ProgressMonitor::Stringify::ToStream
print "\rStatus line"
print make_status("Status line")
giving the output form EscStatus uses. The contents of the status line are built by the configured ProgressMonitor field objects in the usual way. See examples/progressmonitor.pl in the EscStatus sources for a complete program.
ProgressMonitor
ProgressMonitor::Stringify::ToEscStatus->new({key=>value,...})
Create and return a new ToEscStatus progress monitor object. Configuration parameters are taken in usual Moose style as a single hashref argument. This will normally at least include a fields array of objects to do the rendering.
fields
See ProgressMonitor::Stringify::AbstractMonitor for the base configuration parameters. ToEscStatus has the following additional parameters
stream
STDOUT
A file handle to write to. The default is standard output, ie. \*STDOUT (the same as ProgressMonitor::Stringify::ToStream).
\*STDOUT
ToEscStatus doesn't check what layers are on the stream. If for instance you're printing to tty then it's your responsibility to push a PerlIO::via::EscStatus. Similarly it's your responsibility to set :utf8 mode or not, as desired.
PerlIO::via::EscStatus
:utf8
ProgressMonitor, PerlIO::via::EscStatus, Moose
http://user42.tuxfamily.org/perlio-via-escstatus/index.html
Copyright 2008, 2009, 2010, 2011, 2012 Kevin Ryde
PerlIO-via-EscStatus is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
PerlIO-via-EscStatus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PerlIO-via-EscStatus. If not, see http://www.gnu.org/licenses/.
To install PerlIO::via::EscStatus, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PerlIO::via::EscStatus
CPAN shell
perl -MCPAN -e shell install PerlIO::via::EscStatus
For more information on module installation, please visit the detailed CPAN module installation guide.