misc. commit
git-svn-id: svn://127.0.0.1/Perl/Proc-ProcessTable-Colorizer/trunk@958 0c1c3402-1be1-de11-8092-0022686faf23
This commit is contained in:
parent
82a64ae37f
commit
c32518f28e
|
@ -94,21 +94,6 @@ sub new {
|
|||
|
||||
A list of columns to print.
|
||||
|
||||
=head4 colors
|
||||
|
||||
This is the color order to use in the form of an ARRAY.
|
||||
|
||||
This corresponds to L<Term::ANSIColor> colors.
|
||||
|
||||
Normally this defaults to.
|
||||
|
||||
[
|
||||
'BRIGHT_YELLOW',
|
||||
'BRIGHT_CYAN',
|
||||
'BRIGHT_MAGENTA',
|
||||
'BRIGHT_BLUE'
|
||||
]
|
||||
|
||||
=head2 processColor
|
||||
|
||||
This is the color to use for the process. This is by default 'WHITE'.
|
||||
|
@ -145,28 +130,7 @@ These are the colors for seconds, minutes, hour, 10+ hours.
|
|||
|
||||
sub colorize{
|
||||
my $self=$_[0];
|
||||
my %args;
|
||||
if(defined($_[1])){
|
||||
%args= %{$_[1]};
|
||||
}
|
||||
|
||||
$self->errorblank;
|
||||
|
||||
#sets some defaults if not set
|
||||
if ( ref($args{colors}) ne 'ARRAY' ){
|
||||
$args{colors}=$self->{colors};
|
||||
}
|
||||
if ( ref($args{timeColors}) ne 'ARRAY' ){
|
||||
$args{timeColors}=$self->{timeColors};
|
||||
}
|
||||
if ( ref($args{processColor}) ne 'SCALAR' ){
|
||||
$args{processColor}=$self->{processColor};
|
||||
}
|
||||
if ( ref($args{fields}) ne 'ARRAY' ){
|
||||
$args{fields}=$self->{fields};
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -209,6 +173,8 @@ sub timeString{
|
|||
|
||||
Gets a hash of possible fields from Proc::ProcessTable as an hash.
|
||||
|
||||
This is really meant as a internal function.
|
||||
|
||||
=cut
|
||||
|
||||
sub fields{
|
||||
|
@ -229,6 +195,63 @@ sub fields{
|
|||
return %toReturn;
|
||||
}
|
||||
|
||||
=head2 fieldsGet
|
||||
|
||||
Gets the currently set fields.
|
||||
|
||||
Returns a list of current fields to be printed.
|
||||
|
||||
my @fields=$cps->fieldsGet;
|
||||
|
||||
=cut
|
||||
|
||||
sub fieldsGet{
|
||||
my $self=$_[0];
|
||||
$self->errorblank;
|
||||
|
||||
return $self->{fields};
|
||||
}
|
||||
|
||||
=head2 timeColorsGet
|
||||
|
||||
my @timeColors=$cps->timeColorsGet;
|
||||
|
||||
=cut
|
||||
|
||||
sub timeColorsGet{
|
||||
my $self=$_[0];
|
||||
$self->errorblank;
|
||||
|
||||
return $self->{fields};
|
||||
}
|
||||
|
||||
=head1 COLORS
|
||||
|
||||
These corresponds to L<Term::ANSIColor> colors.
|
||||
|
||||
=head2 Time
|
||||
|
||||
The color column is not a single color, but multiple depending on the amount of time.
|
||||
|
||||
The default is as below.
|
||||
|
||||
'GREEN', seconds
|
||||
'BRIGHT_GREEN', minutes
|
||||
'RED', hours
|
||||
'BRIGHT_RED', 10+ hours
|
||||
|
||||
=head2 Columns
|
||||
|
||||
The non-proc/time columns are colored in a rotating color sequence.
|
||||
|
||||
The default is as below.
|
||||
|
||||
BRIGHT_YELLOW
|
||||
BRIGHT_CYAN
|
||||
BRIGHT_MAGENTA
|
||||
BRIGHT_BLUE
|
||||
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Zane C. Bowers-Hadley, C<< <vvelox at vvelox.net> >>
|
||||
|
|
Loading…
Reference in New Issue