| 1 | package UI::Dialog::Backend::Whiptail; | ||||||||||||||||||||||||||||||||||||||||||||||
| 2 | ############################################################################### | ||||||||||||||||||||||||||||||||||||||||||||||
| 3 | # Copyright (C) 2004-2016 Kevin C. Krinke <kevin@krinke.ca> | ||||||||||||||||||||||||||||||||||||||||||||||
| 4 | # | ||||||||||||||||||||||||||||||||||||||||||||||
| 5 | # This library is free software; you can redistribute it and/or | ||||||||||||||||||||||||||||||||||||||||||||||
| 6 | # modify it under the terms of the GNU Lesser General Public | ||||||||||||||||||||||||||||||||||||||||||||||
| 7 | # License as published by the Free Software Foundation; either | ||||||||||||||||||||||||||||||||||||||||||||||
| 8 | # version 2.1 of the License, or (at your option) any later version. | ||||||||||||||||||||||||||||||||||||||||||||||
| 9 | # | ||||||||||||||||||||||||||||||||||||||||||||||
| 10 | # This library is distributed in the hope that it will be useful, | ||||||||||||||||||||||||||||||||||||||||||||||
| 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||||||||||||||||||||||||||||||||||||||||||||
| 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||||||||||||||||||||||||||||||||||||||||||||
| 13 | # Lesser General Public License for more details. | ||||||||||||||||||||||||||||||||||||||||||||||
| 14 | # | ||||||||||||||||||||||||||||||||||||||||||||||
| 15 | # You should have received a copy of the GNU Lesser General Public | ||||||||||||||||||||||||||||||||||||||||||||||
| 16 | # License along with this library; if not, write to the Free Software | ||||||||||||||||||||||||||||||||||||||||||||||
| 17 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||||||||||||||||||||||||||||||||||||||||||||||
| 18 | ############################################################################### | ||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 6 | ▶ | use 5.006; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 6 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 6 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 6 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 6 | ▶ | use FileHandle; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 6 | ▶ | use Time::HiRes qw( sleep ); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 6 | ▶ | use UI::Dialog::Backend; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||||||
| 27 | BEGIN { | ||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 6 | ▶ | use vars qw( $VERSION @ISA ); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 6 | ▶ | @ISA = qw( UI::Dialog::Backend ); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 6 | $VERSION = '1.20'; | |||||||||||||||||||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||||||
| 33 | #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||||||||||||||||||||||||||||||||||||||||||||||
| 34 | #: Constructor Method | ||||||||||||||||||||||||||||||||||||||||||||||
| 35 | #: | ||||||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||||||
| 37 | sub new { | ||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 1 | ▶ | my $proto = shift(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=32 SCAR=49.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 1 | ▶ | my $class = ref($proto) || $proto; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
ref $proto || $proto
MC/DC0%0/2
ref $proto || $proto
ref $proto
$proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
| |||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 1 | ▶ | my $cfg = ((ref($_[0]) eq "HASH") ? $_[0] : (@_) ? { @_ } : {}); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 1 | my $self = {}; | |||||||||||||||||||||||||||||||||||||||||||||
| 42 | 1 | bless($self, $class); | |||||||||||||||||||||||||||||||||||||||||||||
| 43 | 1 | $self->{'_state'} = {}; | |||||||||||||||||||||||||||||||||||||||||||||
| 44 | 1 | $self->{'_opts'} = {}; | |||||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||||||
| 46 | #: Dynamic path discovery... | ||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 1 | my $CFG_PATH = $cfg->{'PATH'}; | |||||||||||||||||||||||||||||||||||||||||||||
| 48 | 1 | ▶ | if ($CFG_PATH) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 0 | ▶ | if (ref($CFG_PATH) eq "ARRAY") { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 0 | $self->{'PATHS'} = $CFG_PATH; | |||||||||||||||||||||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 52 | elsif ($CFG_PATH =~ m!:!) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 0 | $self->{'PATHS'} = [ split(/:/,$CFG_PATH) ]; | |||||||||||||||||||||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 55 | elsif (-d $CFG_PATH) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 0 | $self->{'PATHS'} = [ $CFG_PATH ]; | |||||||||||||||||||||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 59 | elsif ($ENV{'PATH'}) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 1 | $self->{'PATHS'} = [ split(/:/,$ENV{'PATH'}) ]; | |||||||||||||||||||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 62 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 0 | $self->{'PATHS'} = ''; | |||||||||||||||||||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 1 | ▶ | $self->{'_opts'}->{'literal'} = $cfg->{'literal'} || 0; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'literal'} || 0
MC/DC0%0/1
$cfg->{'literal'} || 0
$cfg->{'literal'}
Truth table50%1/2
A
A= $cfg->{'literal'}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 1 | ▶ | $self->{'_opts'}->{'callbacks'} = $cfg->{'callbacks'} || undef(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'callbacks'} || undef()
MC/DC0%0/1
$cfg->{'callbacks'} || undef()
$cfg->{'callbacks'}
Truth table50%1/2
A
A= $cfg->{'callbacks'}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 1 | ▶ | $self->{'_opts'}->{'debug'} = $cfg->{'debug'} || undef(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'debug'} || undef()
MC/DC0%0/1
$cfg->{'debug'} || undef()
$cfg->{'debug'}
Truth table50%1/2
A
A= $cfg->{'debug'}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 1 | ▶ | $self->{'_opts'}->{'title'} = $cfg->{'title'} || undef(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'title'} || undef()
MC/DC0%0/1
$cfg->{'title'} || undef()
$cfg->{'title'}
Truth table50%1/2
A
A= $cfg->{'title'}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 1 | ▶ | $self->{'_opts'}->{'backtitle'} = $cfg->{'backtitle'} || undef(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'backtitle'} || undef()
MC/DC0%0/1
$cfg->{'backtitle'} || undef()
$cfg->{'backtitle'}
Truth table50%1/2
A
A= $cfg->{'backtitle'}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 1 | ▶ | $self->{'_opts'}->{'width'} = $cfg->{'width'} || 65; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'width'} || 65
MC/DC0%0/1
$cfg->{'width'} || 65
$cfg->{'width'}
Truth table50%1/2
A
A= $cfg->{'width'}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 1 | ▶ | $self->{'_opts'}->{'height'} = $cfg->{'height'} || 10; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'height'} || 10
MC/DC0%0/1
$cfg->{'height'} || 10
$cfg->{'height'}
Truth table50%1/2
A
A= $cfg->{'height'}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 1 | ▶ | $self->{'_opts'}->{'listheight'} = $cfg->{'listheight'} || $cfg->{'menuheight'} || 10; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition40%2/5
$cfg->{'listheight'} || $cfg->{'menuheight'} || 10
$cfg->{"listheight"} or $cfg->{"menuheight"}
MC/DC0%0/2
$cfg->{'listheight'} || $cfg->{'menuheight'} || 10
$cfg->{"listheight"}
$cfg->{"menuheight"}
Truth table33%1/3
A or B
A= $cfg->{"listheight"}B= $cfg->{"menuheight"}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 1 | ▶ | $self->{'_opts'}->{'percentage'} = $cfg->{'percentage'} || 1; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'percentage'} || 1
MC/DC0%0/1
$cfg->{'percentage'} || 1
$cfg->{'percentage'}
Truth table50%1/2
A
A= $cfg->{'percentage'}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 1 | ▶ | $self->{'_opts'}->{'bin'} ||= $self->_find_bin('whiptail'); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->{"_opts"}{"bin"} ||= $self->_find_bin("whiptail")
MC/DC0%0/2
$self->{"_opts"}{"bin"} ||= $self->_find_bin("whiptail")
$self->{"_opts"}{"bin"}
$self->_find_bin("whiptail")
Truth table33%1/3
A ||= B
A= $self->{"_opts"}{"bin"}B= $self->_find_bin("whiptail")
| |||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 1 | ▶ | $self->{'_opts'}->{'autoclear'} = $cfg->{'autoclear'} || 0; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'autoclear'} || 0
MC/DC0%0/1
$cfg->{'autoclear'} || 0
$cfg->{'autoclear'}
Truth table50%1/2
A
A= $cfg->{'autoclear'}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 1 | ▶ | $self->{'_opts'}->{'clearbefore'} = $cfg->{'clearbefore'} || 0; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'clearbefore'} || 0
MC/DC0%0/1
$cfg->{'clearbefore'} || 0
$cfg->{'clearbefore'}
Truth table50%1/2
A
A= $cfg->{'clearbefore'}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 1 | ▶ | $self->{'_opts'}->{'clearafter'} = $cfg->{'clearafter'} || 0; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'clearafter'} || 0
MC/DC0%0/1
$cfg->{'clearafter'} || 0
$cfg->{'clearafter'}
Truth table50%1/2
A
A= $cfg->{'clearafter'}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 1 | ▶ | $self->{'_opts'}->{'beepbin'} = $cfg->{'beepbin'} || $self->_find_bin('beep') || '/usr/bin/beep'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition40%2/5
$cfg->{'beepbin'} || $self->_find_bin('beep') || '/usr/bin/beep'
$cfg->{"beepbin"} or $self->_find_bin("beep")
MC/DC0%0/2
$cfg->{'beepbin'} || $self->_find_bin('beep') || '/usr/bin/beep'
$cfg->{"beepbin"}
$self->_find_bin("beep")
Truth table33%1/3
A or B
A= $cfg->{"beepbin"}B= $self->_find_bin("beep")
| |||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 1 | ▶ | $self->{'_opts'}->{'beepbefore'} = $cfg->{'beepbefore'} || 0; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'beepbefore'} || 0
MC/DC0%0/1
$cfg->{'beepbefore'} || 0
$cfg->{'beepbefore'}
Truth table50%1/2
A
A= $cfg->{'beepbefore'}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 1 | ▶ | $self->{'_opts'}->{'beepafter'} = $cfg->{'beepafter'} || 0; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'beepafter'} || 0
MC/DC0%0/1
$cfg->{'beepafter'} || 0
$cfg->{'beepafter'}
Truth table50%1/2
A
A= $cfg->{'beepafter'}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 1 | ▶ | $self->{'_opts'}->{'timeout'} = $cfg->{'timeout'} || 0; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'timeout'} || 0
MC/DC0%0/1
$cfg->{'timeout'} || 0
$cfg->{'timeout'}
Truth table50%1/2
A
A= $cfg->{'timeout'}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 1 | ▶ | $self->{'_opts'}->{'wait'} = $cfg->{'wait'} || 0; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'wait'} || 0
MC/DC0%0/1
$cfg->{'wait'} || 0
$cfg->{'wait'}
Truth table50%1/2
A
A= $cfg->{'wait'}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 1 | ▶ | unless (-x $self->{'_opts'}->{'bin'}) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 1 | croak("the whiptail binary could not be found at: ".$self->{'_opts'}->{'bin'}); | |||||||||||||||||||||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | ▶ | $self->{'_opts'}->{'trust-input'} = $cfg->{'trust-input'} || 0; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$cfg->{'trust-input'} || 0
MC/DC0%0/1
$cfg->{'trust-input'} || 0
$cfg->{'trust-input'}
Truth table0%0/2
A
A= $cfg->{'trust-input'}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | ▶ | $self->{'test_mode'} = $cfg->{'test_mode'} if exists $cfg->{'test_mode'}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 0 | $self->{'test_mode_result'} = ''; | |||||||||||||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 0 | return($self); | |||||||||||||||||||||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||||||||||||||||||||
| 97 | #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||||||||||||||||||||||||||||||||||||||||||||||
| 98 | #: Private Methods | ||||||||||||||||||||||||||||||||||||||||||||||
| 99 | #: | ||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 6 | my $SIG_CODE = {}; | |||||||||||||||||||||||||||||||||||||||||||||
| 101 | sub _del_gauge { | ||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 0 | ▶ | my $CODE = $SIG_CODE->{$$}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_del_gauge: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 0 | ▶ | unless (not ref($CODE)) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 0 | delete($CODE->{'_GAUGE'}); | |||||||||||||||||||||||||||||||||||||||||||||
| 105 | 0 | $CODE->rv('1'); | |||||||||||||||||||||||||||||||||||||||||||||
| 106 | 0 | $CODE->rs('null'); | |||||||||||||||||||||||||||||||||||||||||||||
| 107 | 0 | $CODE->ra('null'); | |||||||||||||||||||||||||||||||||||||||||||||
| 108 | 0 | $SIG_CODE->{$$} = ""; | |||||||||||||||||||||||||||||||||||||||||||||
| 109 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||||||||||||||||||||
| 112 | sub append_format_base { | ||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 0 | ▶ | my ($self,$args,$fmt) = @_; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
append_format_base: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 0 | $fmt = $self->append_format_check($args,$fmt,'backtitle','--backtitle {{backtitle}}'); | |||||||||||||||||||||||||||||||||||||||||||||
| 115 | 0 | $fmt = $self->append_format_check($args,$fmt,"defaultno","--defaultno"); | |||||||||||||||||||||||||||||||||||||||||||||
| 116 | 0 | $fmt = $self->append_format_check($args,$fmt,"default-item","--default-item {{default-item}}"); | |||||||||||||||||||||||||||||||||||||||||||||
| 117 | 0 | $fmt = $self->append_format_check($args,$fmt,"fullbuttons","--fullbuttons"); | |||||||||||||||||||||||||||||||||||||||||||||
| 118 | 0 | $fmt = $self->append_format_check($args,$fmt,"nocancel","--nocancel"); | |||||||||||||||||||||||||||||||||||||||||||||
| 119 | 0 | $fmt = $self->append_format_check($args,$fmt,"yes-button","--yes-button {{yes-button}}"); | |||||||||||||||||||||||||||||||||||||||||||||
| 120 | 0 | $fmt = $self->append_format_check($args,$fmt,"no-button","--no-button {{no-button}}"); | |||||||||||||||||||||||||||||||||||||||||||||
| 121 | 0 | $fmt = $self->append_format_check($args,$fmt,"ok-button","--ok-button {{ok-button}}"); | |||||||||||||||||||||||||||||||||||||||||||||
| 122 | 0 | $fmt = $self->append_format_check($args,$fmt,"cancel-button","--cancel-button {{cancel-button}}"); | |||||||||||||||||||||||||||||||||||||||||||||
| 123 | 0 | $fmt = $self->append_format_check($args,$fmt,"notags","--notags"); | |||||||||||||||||||||||||||||||||||||||||||||
| 124 | 0 | $fmt = $self->append_format_check($args,$fmt,"scrolltext","--scrolltext"); | |||||||||||||||||||||||||||||||||||||||||||||
| 125 | 0 | $fmt = $self->append_format_check($args,$fmt,"top-left","--top-left"); | |||||||||||||||||||||||||||||||||||||||||||||
| 126 | 0 | ▶ | if ($self->{'_opts'}->{'force-no-separate-output'}) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 0 | delete $args->{'separate-output'}; | |||||||||||||||||||||||||||||||||||||||||||||
| 128 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 129 | 0 | $fmt = $self->append_format_check($args,$fmt,"separate-output","--separate-output"); | |||||||||||||||||||||||||||||||||||||||||||||
| 130 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 0 | return $fmt; | |||||||||||||||||||||||||||||||||||||||||||||
| 132 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||||||||||||||||||||
| 134 | #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||||||||||||||||||||||||||||||||||||||||||||||
| 135 | #: Public Methods | ||||||||||||||||||||||||||||||||||||||||||||||
| 136 | #: | ||||||||||||||||||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||||||||||||||||
| 138 | #:+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||||||||||||||||||||||||||||||||||||||||||||||
| 139 | #: Ask a binary question (Yes/No) | ||||||||||||||||||||||||||||||||||||||||||||||
| 140 | sub yesno { | ||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
yesno: not called CC=9 SCAR=45.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 0 | ▶ | my $caller = (caller(1))[3] || 'main'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 0 | ▶ | $caller = ($caller =~ /^UI\:\:Dialog\:\:Backend\:\:/) ? ((caller(2))[3]||'main') : $caller; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
(caller 2)[3] or "main"
MC/DC0%0/1
(caller 2)[3] or "main"
(caller 2)[3]
Truth table0%0/2
A
A= (caller 2)[3]
| |||||||||||||||||||||||||||||||||||||||||||||||
| 144 | 0 | ▶ | if ($_[0] && $_[0] eq 'caller') { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$_[0] and $_[0] eq "caller"
MC/DC0%0/2
$_[0] and $_[0] eq "caller"
$_[0]
$_[0] eq "caller"
Truth table0%0/3
A and B
A= $_[0]B= $_[0] eq "caller"
| |||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 0 | shift(); $caller = shift(); | |||||||||||||||||||||||||||||||||||||||||||||
| 146 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 0 | my $args = $self->_pre($caller,@_); | |||||||||||||||||||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 0 | my $fmt = $self->prepare_format($args); | |||||||||||||||||||||||||||||||||||||||||||||
| 150 | 0 | $fmt = $self->append_format_base($args,$fmt); | |||||||||||||||||||||||||||||||||||||||||||||
| 151 | 0 | $fmt = $self->append_format($fmt,'--yesno {{text}} {{height}} {{width}}'); | |||||||||||||||||||||||||||||||||||||||||||||
| 152 | my $command = $self->prepare_command | ||||||||||||||||||||||||||||||||||||||||||||||
| 153 | ( $args, $fmt, | ||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 0 | text => $self->make_kvt($args,$args->{'text'}), | |||||||||||||||||||||||||||||||||||||||||||||
| 155 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 0 | my $rv = $self->command_state($command); | |||||||||||||||||||||||||||||||||||||||||||||
| 158 | 0 | ▶ | if ($rv && $rv >= 1) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$rv and $rv >= 1
MC/DC0%0/2
$rv and $rv >= 1
$rv
$rv >= 1
Truth table0%0/3
A and B
A= $rvB= $rv >= 1
| |||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 0 | $self->ra("NO"); | |||||||||||||||||||||||||||||||||||||||||||||
| 160 | 0 | $self->rs("NO"); | |||||||||||||||||||||||||||||||||||||||||||||
| 161 | 0 | $self->rv($rv); | |||||||||||||||||||||||||||||||||||||||||||||
| 162 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 163 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 0 | $self->ra("YES"); | |||||||||||||||||||||||||||||||||||||||||||||
| 165 | 0 | $self->rs("YES"); | |||||||||||||||||||||||||||||||||||||||||||||
| 166 | 0 | $self->rv('null'); | |||||||||||||||||||||||||||||||||||||||||||||
| 167 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 168 | 0 | $self->_post($args); | |||||||||||||||||||||||||||||||||||||||||||||
| 169 | 0 | ▶ | return($rv == 0 ? 1 : 0); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 170 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||||||||||||||||||||
| 172 | #:+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||||||||||||||||||||||||||||||||||||||||||||||
| 173 | #: Text entry | ||||||||||||||||||||||||||||||||||||||||||||||
| 174 | sub inputbox { | ||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
inputbox: not called CC=9 SCAR=45.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 176 | 0 | ▶ | my $caller = (caller(1))[3] || 'main'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 0 | ▶ | $caller = ($caller =~ /^UI\:\:Dialog\:\:Backend\:\:/) ? ((caller(2))[3]||'main') : $caller; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
(caller 2)[3] or "main"
MC/DC0%0/1
(caller 2)[3] or "main"
(caller 2)[3]
Truth table0%0/2
A
A= (caller 2)[3]
| |||||||||||||||||||||||||||||||||||||||||||||||
| 178 | 0 | ▶ | if ($_[0] && $_[0] eq 'caller') { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$_[0] and $_[0] eq "caller"
MC/DC0%0/2
$_[0] and $_[0] eq "caller"
$_[0]
$_[0] eq "caller"
Truth table0%0/3
A and B
A= $_[0]B= $_[0] eq "caller"
| |||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 0 | shift(); $caller = shift(); | |||||||||||||||||||||||||||||||||||||||||||||
| 180 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 0 | my $args = $self->_pre($caller,@_); | |||||||||||||||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||||||||||||||||
| 183 | 0 | my $fmt = $self->prepare_format($args); | |||||||||||||||||||||||||||||||||||||||||||||
| 184 | 0 | $fmt = $self->append_format_base($args,$fmt); | |||||||||||||||||||||||||||||||||||||||||||||
| 185 | 0 | ▶ | if ($args->{'password'}) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 186 | 0 | $fmt = $self->append_format($fmt,'--passwordbox'); | |||||||||||||||||||||||||||||||||||||||||||||
| 187 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 188 | 0 | $fmt = $self->append_format($fmt,'--inputbox'); | |||||||||||||||||||||||||||||||||||||||||||||
| 189 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 0 | $fmt = $self->append_format($fmt,'{{text}} {{height}} {{width}} {{entry}}'); | |||||||||||||||||||||||||||||||||||||||||||||
| 191 | my $command = $self->prepare_command | ||||||||||||||||||||||||||||||||||||||||||||||
| 192 | ( $args, $fmt, | ||||||||||||||||||||||||||||||||||||||||||||||
| 193 | text => $self->make_kvt($args,$args->{'text'}), | ||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 0 | ▶ | entry => $self->make_kvl($args,($args->{'init'}||$args->{'entry'})), | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$args->{'init'} || $args->{'entry'}
MC/DC0%0/2
$args->{'init'} || $args->{'entry'}
$args->{'init'}
$args->{'entry'}
Truth table0%0/3
A || B
A= $args->{'init'}B= $args->{'entry'}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 195 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 0 | my ($rv,$text) = $self->command_string($command); | |||||||||||||||||||||||||||||||||||||||||||||
| 198 | 0 | $self->_post($args); | |||||||||||||||||||||||||||||||||||||||||||||
| 199 | 0 | ▶ | return($rv == 0 ? $text : 0); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 200 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 201 | #: password boxes aren't supported by gdialog | ||||||||||||||||||||||||||||||||||||||||||||||
| 202 | sub password { | ||||||||||||||||||||||||||||||||||||||||||||||
| 203 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
password: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 204 | 0 | ▶ | return($self->inputbox('caller',((caller(1))[3]||'main'),@_,'password',1)); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||||||||||||||||||
| 205 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 206 | |||||||||||||||||||||||||||||||||||||||||||||||
| 207 | #:+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||||||||||||||||||||||||||||||||||||||||||||||
| 208 | #: Text box | ||||||||||||||||||||||||||||||||||||||||||||||
| 209 | sub msgbox { | ||||||||||||||||||||||||||||||||||||||||||||||
| 210 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
msgbox: not called CC=19 SCAR=59.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 211 | 0 | ▶ | my $caller = (caller(1))[3] || 'main'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||||||||||||||||||
| 212 | 0 | ▶ | $caller = ($caller =~ /^UI\:\:Dialog\:\:Backend\:\:/) ? ((caller(2))[3]||'main') : $caller; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
(caller 2)[3] or "main"
MC/DC0%0/1
(caller 2)[3] or "main"
(caller 2)[3]
Truth table0%0/2
A
A= (caller 2)[3]
| |||||||||||||||||||||||||||||||||||||||||||||||
| 213 | 0 | ▶ | if ($_[0] && $_[0] eq 'caller') { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$_[0] and $_[0] eq "caller"
MC/DC0%0/2
$_[0] and $_[0] eq "caller"
$_[0]
$_[0] eq "caller"
Truth table0%0/3
A and B
A= $_[0]B= $_[0] eq "caller"
| |||||||||||||||||||||||||||||||||||||||||||||||
| 214 | 0 | shift(); $caller = shift(); | |||||||||||||||||||||||||||||||||||||||||||||
| 215 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 0 | my $args = $self->_pre($caller,@_); | |||||||||||||||||||||||||||||||||||||||||||||
| 217 | 0 | ▶ | $args->{'msgbox'} ||= 'msgbox'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$args->{"msgbox"} ||= "msgbox"
MC/DC0%0/1
$args->{"msgbox"} ||= "msgbox"
$args->{"msgbox"}
Truth table0%0/2
A
A= $args->{"msgbox"}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||||||||||||||||||||
| 219 | 0 | my $fmt = $self->prepare_format($args); | |||||||||||||||||||||||||||||||||||||||||||||
| 220 | 0 | $fmt = $self->append_format_base($args,$fmt); | |||||||||||||||||||||||||||||||||||||||||||||
| 221 | 0 | ▶ | if ($args->{'infobox'}) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 222 | 0 | $fmt = $self->append_format($fmt,'--infobox'); | |||||||||||||||||||||||||||||||||||||||||||||
| 223 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 224 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 225 | 0 | $fmt = $self->append_format($fmt,'--msgbox'); | |||||||||||||||||||||||||||||||||||||||||||||
| 226 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 227 | 0 | $fmt = $self->append_format($fmt,'{{text}} {{height}} {{width}}'); | |||||||||||||||||||||||||||||||||||||||||||||
| 228 | my $command = $self->prepare_command | ||||||||||||||||||||||||||||||||||||||||||||||
| 229 | ( $args, $fmt, | ||||||||||||||||||||||||||||||||||||||||||||||
| 230 | 0 | text => $self->make_kvt($args,$args->{'text'}), | |||||||||||||||||||||||||||||||||||||||||||||
| 231 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 232 | |||||||||||||||||||||||||||||||||||||||||||||||
| 233 | $args->{'timeout'} ||= $args->{'wait'} | ||||||||||||||||||||||||||||||||||||||||||||||
| 234 | 0 | ▶ | if exists $args->{'wait'} and $args->{'wait'}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
exists $args->{"wait"} and $args->{"wait"}
$args->{"timeout"} ||= $args->{"wait"}
MC/DC0%0/2
exists $args->{"wait"} and $args->{"wait"}
exists $args->{"wait"}
$args->{"wait"}
MC/DC0%0/2
$args->{"timeout"} ||= $args->{"wait"}
$args->{"timeout"}
$args->{"wait"}
Truth table0%0/3
A and B
A= exists $args->{"wait"}B= $args->{"wait"}
Truth table0%0/3
A ||= B
A= $args->{"timeout"}B= $args->{"wait"}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 235 | |||||||||||||||||||||||||||||||||||||||||||||||
| 236 | 0 | my $tmp_term = $ENV{TERM}; | |||||||||||||||||||||||||||||||||||||||||||||
| 237 | $ENV{TERM} = 'vt220' # wow, really folks? | ||||||||||||||||||||||||||||||||||||||||||||||
| 238 | 0 | ▶ | if ($args->{'infobox'}); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 239 | 0 | my $rv = $self->command_state($command); | |||||||||||||||||||||||||||||||||||||||||||||
| 240 | 0 | ▶ | if ($args->{'infobox'}) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 241 | 0 | $ENV{TERM} = $tmp_term; # yep, really. | |||||||||||||||||||||||||||||||||||||||||||||
| 242 | 0 | my $sec = 0; | |||||||||||||||||||||||||||||||||||||||||||||
| 243 | 0 | ▶ | if ($args->{'timeout'}) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||
| 244 | 0 | ▶ | $sec = int($args->{'timeout'} ? ($args->{'timeout'} / 1000.0) : 1.0); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 245 | 0 | $self->_debug("Will sleep for timeout=".$sec); | |||||||||||||||||||||||||||||||||||||||||||||
| 246 | } elsif ($args->{'wait'}) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 247 | 0 | ▶ | $sec = int($args->{'wait'} ? $args->{'wait'} : 1); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 248 | 0 | $self->_debug("Will sleep for wait=".$sec); | |||||||||||||||||||||||||||||||||||||||||||||
| 249 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 250 | 0 | ▶ | sleep($sec) if $sec; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 251 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 252 | 0 | $self->_post($args); | |||||||||||||||||||||||||||||||||||||||||||||
| 253 | 0 | ▶ | return($rv == 0 ? 1 : 0); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 254 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 255 | sub infobox { | ||||||||||||||||||||||||||||||||||||||||||||||
| 256 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
infobox: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 257 | 0 | ▶ | return($self->msgbox('caller',((caller(1))[3]||'main'),@_,'infobox',1)); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||||||||||||||||||
| 258 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 259 | |||||||||||||||||||||||||||||||||||||||||||||||
| 260 | #:+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||||||||||||||||||||||||||||||||||||||||||||||
| 261 | #: File box | ||||||||||||||||||||||||||||||||||||||||||||||
| 262 | sub textbox { | ||||||||||||||||||||||||||||||||||||||||||||||
| 263 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
textbox: not called CC=8 SCAR=42.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 264 | 0 | ▶ | my $caller = (caller(1))[3] || 'main'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||||||||||||||||||
| 265 | 0 | ▶ | $caller = ($caller =~ /^UI\:\:Dialog\:\:Backend\:\:/) ? ((caller(2))[3]||'main') : $caller; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
(caller 2)[3] or "main"
MC/DC0%0/1
(caller 2)[3] or "main"
(caller 2)[3]
Truth table0%0/2
A
A= (caller 2)[3]
| |||||||||||||||||||||||||||||||||||||||||||||||
| 266 | 0 | ▶ | if ($_[0] && $_[0] eq 'caller') { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$_[0] and $_[0] eq "caller"
MC/DC0%0/2
$_[0] and $_[0] eq "caller"
$_[0]
$_[0] eq "caller"
Truth table0%0/3
A and B
A= $_[0]B= $_[0] eq "caller"
| |||||||||||||||||||||||||||||||||||||||||||||||
| 267 | 0 | shift(); $caller = shift(); | |||||||||||||||||||||||||||||||||||||||||||||
| 268 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 269 | 0 | my $args = $self->_pre($caller,@_); | |||||||||||||||||||||||||||||||||||||||||||||
| 270 | |||||||||||||||||||||||||||||||||||||||||||||||
| 271 | 0 | my $fmt = $self->prepare_format($args); | |||||||||||||||||||||||||||||||||||||||||||||
| 272 | 0 | $fmt = $self->append_format_base($args,$fmt); | |||||||||||||||||||||||||||||||||||||||||||||
| 273 | 0 | $fmt = $self->append_format($fmt,'--textbox'); | |||||||||||||||||||||||||||||||||||||||||||||
| 274 | 0 | $fmt = $self->append_format($fmt,'{{path}} {{height}} {{width}}'); | |||||||||||||||||||||||||||||||||||||||||||||
| 275 | my $command = $self->prepare_command | ||||||||||||||||||||||||||||||||||||||||||||||
| 276 | ( $args, $fmt, | ||||||||||||||||||||||||||||||||||||||||||||||
| 277 | 0 | ▶ | path => $self->make_kvl($args,($args->{'path'}||'.')), | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$args->{'path'} || '.'
MC/DC0%0/1
$args->{'path'} || '.'
$args->{'path'}
Truth table0%0/2
A
A= $args->{'path'}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 278 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 279 | |||||||||||||||||||||||||||||||||||||||||||||||
| 280 | 0 | my ($rv,$text) = $self->command_string($command); | |||||||||||||||||||||||||||||||||||||||||||||
| 281 | 0 | $self->_post($args); | |||||||||||||||||||||||||||||||||||||||||||||
| 282 | 0 | ▶ | return($rv == 0 ? 1 : 0); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 283 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 284 | |||||||||||||||||||||||||||||||||||||||||||||||
| 285 | #:+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||||||||||||||||||||||||||||||||||||||||||||||
| 286 | #: Lists | ||||||||||||||||||||||||||||||||||||||||||||||
| 287 | sub menu { | ||||||||||||||||||||||||||||||||||||||||||||||
| 288 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
menu: not called CC=8 SCAR=42.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 289 | 0 | ▶ | my $caller = (caller(1))[3] || 'main'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||||||||||||||||||
| 290 | 0 | ▶ | $caller = ($caller =~ /^UI\:\:Dialog\:\:Backend\:\:/) ? ((caller(2))[3]||'main') : $caller; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
(caller 2)[3] or "main"
MC/DC0%0/1
(caller 2)[3] or "main"
(caller 2)[3]
Truth table0%0/2
A
A= (caller 2)[3]
| |||||||||||||||||||||||||||||||||||||||||||||||
| 291 | 0 | ▶ | if ($_[0] && $_[0] eq 'caller') { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$_[0] and $_[0] eq "caller"
MC/DC0%0/2
$_[0] and $_[0] eq "caller"
$_[0]
$_[0] eq "caller"
Truth table0%0/3
A and B
A= $_[0]B= $_[0] eq "caller"
| |||||||||||||||||||||||||||||||||||||||||||||||
| 292 | 0 | shift(); $caller = shift(); | |||||||||||||||||||||||||||||||||||||||||||||
| 293 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 294 | 0 | my $args = $self->_pre($caller,@_); | |||||||||||||||||||||||||||||||||||||||||||||
| 295 | |||||||||||||||||||||||||||||||||||||||||||||||
| 296 | $args->{'listheight'} = $args->{'menuheight'} | ||||||||||||||||||||||||||||||||||||||||||||||
| 297 | 0 | ▶ | if exists $args->{'menuheight'}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 298 | |||||||||||||||||||||||||||||||||||||||||||||||
| 299 | 0 | my $fmt = $self->prepare_format($args); | |||||||||||||||||||||||||||||||||||||||||||||
| 300 | 0 | $fmt = $self->append_format_base($args,$fmt); | |||||||||||||||||||||||||||||||||||||||||||||
| 301 | 0 | $fmt = $self->append_format($fmt,'--separate-output'); | |||||||||||||||||||||||||||||||||||||||||||||
| 302 | 0 | $fmt = $self->append_format($fmt,'--menu'); | |||||||||||||||||||||||||||||||||||||||||||||
| 303 | 0 | $fmt = $self->append_format($fmt,'{{text}} {{height}} {{width}} {{listheight}} {{list}}'); | |||||||||||||||||||||||||||||||||||||||||||||
| 304 | my $command = $self->prepare_command | ||||||||||||||||||||||||||||||||||||||||||||||
| 305 | ( $args, $fmt, | ||||||||||||||||||||||||||||||||||||||||||||||
| 306 | 0 | text => $self->make_kvt($args,$args->{'text'}), | |||||||||||||||||||||||||||||||||||||||||||||
| 307 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 308 | |||||||||||||||||||||||||||||||||||||||||||||||
| 309 | 0 | my ($rv,$selected) = $self->command_string($command); | |||||||||||||||||||||||||||||||||||||||||||||
| 310 | 0 | $self->_post($args); | |||||||||||||||||||||||||||||||||||||||||||||
| 311 | 0 | ▶ | return($rv == 0 ? $selected : 0); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 312 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 313 | |||||||||||||||||||||||||||||||||||||||||||||||
| 314 | sub checklist { | ||||||||||||||||||||||||||||||||||||||||||||||
| 315 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
checklist: not called CC=12 SCAR=50.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 316 | 0 | ▶ | my $caller = (caller(1))[3] || 'main'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||||||||||||||||||
| 317 | 0 | ▶ | $caller = ($caller =~ /^UI\:\:Dialog\:\:Backend\:\:/) ? ((caller(2))[3]||'main') : $caller; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
(caller 2)[3] or "main"
MC/DC0%0/1
(caller 2)[3] or "main"
(caller 2)[3]
Truth table0%0/2
A
A= (caller 2)[3]
| |||||||||||||||||||||||||||||||||||||||||||||||
| 318 | 0 | ▶ | if ($_[0] && $_[0] eq 'caller') { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$_[0] and $_[0] eq "caller"
MC/DC0%0/2
$_[0] and $_[0] eq "caller"
$_[0]
$_[0] eq "caller"
Truth table0%0/3
A and B
A= $_[0]B= $_[0] eq "caller"
| |||||||||||||||||||||||||||||||||||||||||||||||
| 319 | 0 | shift(); $caller = shift(); | |||||||||||||||||||||||||||||||||||||||||||||
| 320 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 321 | 0 | my $args = $self->_pre($caller,@_); | |||||||||||||||||||||||||||||||||||||||||||||
| 322 | |||||||||||||||||||||||||||||||||||||||||||||||
| 323 | $args->{'listheight'} = $args->{'menuheight'} | ||||||||||||||||||||||||||||||||||||||||||||||
| 324 | 0 | ▶ | if exists $args->{'menuheight'}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 325 | |||||||||||||||||||||||||||||||||||||||||||||||
| 326 | 0 | my $fmt = $self->prepare_format($args); | |||||||||||||||||||||||||||||||||||||||||||||
| 327 | 0 | $fmt = $self->append_format_base($args,$fmt); | |||||||||||||||||||||||||||||||||||||||||||||
| 328 | 0 | $fmt = $self->append_format($fmt,'--separate-output'); | |||||||||||||||||||||||||||||||||||||||||||||
| 329 | 0 | ▶ | $args->{radiolist} ||= 0; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$args->{"radiolist"} ||= 0
MC/DC0%0/1
$args->{"radiolist"} ||= 0
$args->{"radiolist"}
Truth table0%0/2
A
A= $args->{"radiolist"}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 330 | 0 | ▶ | if ($args->{radiolist}) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 331 | 0 | $fmt = $self->append_format($fmt,'--radiolist'); | |||||||||||||||||||||||||||||||||||||||||||||
| 332 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 333 | 0 | $fmt = $self->append_format($fmt,'--checklist'); | |||||||||||||||||||||||||||||||||||||||||||||
| 334 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 335 | 0 | $fmt = $self->append_format($fmt,'{{text}} {{height}} {{width}} {{listheight}} {{list}}'); | |||||||||||||||||||||||||||||||||||||||||||||
| 336 | my $command = $self->prepare_command | ||||||||||||||||||||||||||||||||||||||||||||||
| 337 | ( $args, $fmt, | ||||||||||||||||||||||||||||||||||||||||||||||
| 338 | 0 | text => $self->make_kvt($args,$args->{'text'}), | |||||||||||||||||||||||||||||||||||||||||||||
| 339 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 340 | |||||||||||||||||||||||||||||||||||||||||||||||
| 341 | 0 | ▶ | if ($args->{radiolist}) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 342 | 0 | my ($rv,$selected) = $self->command_string($command); | |||||||||||||||||||||||||||||||||||||||||||||
| 343 | 0 | ▶ | return($rv == 0 ? $selected : 0); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 344 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 345 | 0 | my ($rv,$selected) = $self->command_array($command); | |||||||||||||||||||||||||||||||||||||||||||||
| 346 | 0 | ▶ | return($rv == 0 ? @{$selected} : 0); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 347 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 348 | sub radiolist { | ||||||||||||||||||||||||||||||||||||||||||||||
| 349 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
radiolist: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 350 | 0 | ▶ | return($self->checklist('caller',((caller(1))[3]||'main'),@_,'radiolist',1)); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||||||||||||||||||
| 351 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 352 | |||||||||||||||||||||||||||||||||||||||||||||||
| 353 | #:+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||||||||||||||||||||||||||||||||||||||||||||||
| 354 | #: progress meter | ||||||||||||||||||||||||||||||||||||||||||||||
| 355 | sub gauge_start { | ||||||||||||||||||||||||||||||||||||||||||||||
| 356 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
gauge_start: not called CC=13 SCAR=52.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 357 | 0 | ▶ | my $caller = (caller(1))[3] || 'main'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||||||||||||||||||
| 358 | 0 | ▶ | $caller = ($caller =~ /^UI\:\:Dialog\:\:Backend\:\:/) ? ((caller(2))[3]||'main') : $caller; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
(caller 2)[3] or "main"
MC/DC0%0/1
(caller 2)[3] or "main"
(caller 2)[3]
Truth table0%0/2
A
A= (caller 2)[3]
| |||||||||||||||||||||||||||||||||||||||||||||||
| 359 | 0 | ▶ | if ($_[0] && $_[0] eq 'caller') { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$_[0] and $_[0] eq "caller"
MC/DC0%0/2
$_[0] and $_[0] eq "caller"
$_[0]
$_[0] eq "caller"
Truth table0%0/3
A and B
A= $_[0]B= $_[0] eq "caller"
| |||||||||||||||||||||||||||||||||||||||||||||||
| 360 | 0 | shift(); $caller = shift(); | |||||||||||||||||||||||||||||||||||||||||||||
| 361 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 362 | 0 | my $args = $self->_pre($caller,@_); | |||||||||||||||||||||||||||||||||||||||||||||
| 363 | |||||||||||||||||||||||||||||||||||||||||||||||
| 364 | 0 | ▶ | $self->{'_GAUGE'} ||= {}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$self->{"_GAUGE"} ||= {}
MC/DC0%0/1
$self->{"_GAUGE"} ||= {}
$self->{"_GAUGE"}
Truth table0%0/2
A
A= $self->{"_GAUGE"}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 365 | 0 | $self->{'_GAUGE'}->{'ARGS'} = $args; | |||||||||||||||||||||||||||||||||||||||||||||
| 366 | |||||||||||||||||||||||||||||||||||||||||||||||
| 367 | 0 | ▶ | if (defined $self->{'_GAUGE'}->{'FH'}) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 368 | 0 | $self->rv(129); | |||||||||||||||||||||||||||||||||||||||||||||
| 369 | 0 | $self->_post($args); | |||||||||||||||||||||||||||||||||||||||||||||
| 370 | 0 | return(0); | |||||||||||||||||||||||||||||||||||||||||||||
| 371 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 372 | |||||||||||||||||||||||||||||||||||||||||||||||
| 373 | 0 | my $fmt = $self->prepare_format($args); | |||||||||||||||||||||||||||||||||||||||||||||
| 374 | 0 | $fmt = $self->append_format($fmt,'--gauge'); | |||||||||||||||||||||||||||||||||||||||||||||
| 375 | 0 | $fmt = $self->append_format($fmt,'{{text}} {{height}} {{width}} {{percentage}}'); | |||||||||||||||||||||||||||||||||||||||||||||
| 376 | my $command = $self->prepare_command | ||||||||||||||||||||||||||||||||||||||||||||||
| 377 | ( $args, $fmt, | ||||||||||||||||||||||||||||||||||||||||||||||
| 378 | text => $self->make_kvt($args,$args->{'text'}), | ||||||||||||||||||||||||||||||||||||||||||||||
| 379 | 0 | ▶ | percentage => $self->make_kvl($args,$args->{'percentage'}||'0'), | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$args->{'percentage'} || '0'
MC/DC0%0/1
$args->{'percentage'} || '0'
$args->{'percentage'}
Truth table0%0/2
A
A= $args->{'percentage'}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 380 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 381 | |||||||||||||||||||||||||||||||||||||||||||||||
| 382 | 0 | ▶ | $self->{'_GAUGE'}->{'PERCENT'} = ($args->{'percentage'} || '0'); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$args->{'percentage'} || '0'
MC/DC0%0/1
$args->{'percentage'} || '0'
$args->{'percentage'}
Truth table0%0/2
A
A= $args->{'percentage'}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 383 | 0 | $self->{'_GAUGE'}->{'FH'} = new FileHandle; | |||||||||||||||||||||||||||||||||||||||||||||
| 384 | 0 | $self->{'_GAUGE'}->{'FH'}->open("| $command"); | |||||||||||||||||||||||||||||||||||||||||||||
| 385 | 0 | my $rv = $? >> 8; | |||||||||||||||||||||||||||||||||||||||||||||
| 386 | 0 | $self->{'_GAUGE'}->{'FH'}->autoflush(1); | |||||||||||||||||||||||||||||||||||||||||||||
| 387 | 0 | ▶ | $self->rv($rv||'null'); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$rv || 'null'
MC/DC0%0/1
$rv || 'null'
$rv
Truth table0%0/2
A
A= $rv
| |||||||||||||||||||||||||||||||||||||||||||||||
| 388 | 0 | $self->ra('null'); | |||||||||||||||||||||||||||||||||||||||||||||
| 389 | 0 | $self->rs('null'); | |||||||||||||||||||||||||||||||||||||||||||||
| 390 | 0 | my $this_rv; | |||||||||||||||||||||||||||||||||||||||||||||
| 391 | 0 | ▶ | if ($rv && $rv >= 1) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$rv and $rv >= 1
MC/DC0%0/2
$rv and $rv >= 1
$rv
$rv >= 1
Truth table0%0/3
A and B
A= $rvB= $rv >= 1
| |||||||||||||||||||||||||||||||||||||||||||||||
| 392 | 0 | $this_rv = 0; | |||||||||||||||||||||||||||||||||||||||||||||
| 393 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 394 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 395 | 0 | $this_rv = 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 396 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 397 | 0 | return($this_rv); | |||||||||||||||||||||||||||||||||||||||||||||
| 398 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 399 | sub gauge_inc { | ||||||||||||||||||||||||||||||||||||||||||||||
| 400 | 0 | ▶ | my $self = $_[0]; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
gauge_inc: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 401 | 0 | ▶ | my $incr = $_[1] || 1; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$_[1] || 1
MC/DC0%0/1
$_[1] || 1
$_[1]
Truth table0%0/2
A
A= $_[1]
| |||||||||||||||||||||||||||||||||||||||||||||||
| 402 | |||||||||||||||||||||||||||||||||||||||||||||||
| 403 | 0 | ▶ | return(0) unless defined $self->{'_GAUGE'}->{'FH'}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 404 | |||||||||||||||||||||||||||||||||||||||||||||||
| 405 | 0 | my $fh = $self->{'_GAUGE'}->{'FH'}; | |||||||||||||||||||||||||||||||||||||||||||||
| 406 | 0 | $self->{'_GAUGE'}->{'PERCENT'} += $incr; | |||||||||||||||||||||||||||||||||||||||||||||
| 407 | 0 | $SIG_CODE->{$$} = $self; local $SIG{'PIPE'} = \&_del_gauge; | |||||||||||||||||||||||||||||||||||||||||||||
| 408 | 0 | print $fh $self->{'_GAUGE'}->{'PERCENT'}."\n"; | |||||||||||||||||||||||||||||||||||||||||||||
| 409 | 0 | ▶ | return(((defined $self->{'_GAUGE'}->{'FH'}) ? 1 : 0)); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 410 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 411 | sub gauge_dec { | ||||||||||||||||||||||||||||||||||||||||||||||
| 412 | 0 | ▶ | my $self = $_[0]; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
gauge_dec: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 413 | 0 | ▶ | my $decr = $_[1] || 1; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$_[1] || 1
MC/DC0%0/1
$_[1] || 1
$_[1]
Truth table0%0/2
A
A= $_[1]
| |||||||||||||||||||||||||||||||||||||||||||||||
| 414 | |||||||||||||||||||||||||||||||||||||||||||||||
| 415 | 0 | ▶ | return(0) unless defined $self->{'_GAUGE'}->{'FH'}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 416 | |||||||||||||||||||||||||||||||||||||||||||||||
| 417 | 0 | my $fh = $self->{'_GAUGE'}->{'FH'}; | |||||||||||||||||||||||||||||||||||||||||||||
| 418 | 0 | $self->{'_GAUGE'}->{'PERCENT'} -= $decr; | |||||||||||||||||||||||||||||||||||||||||||||
| 419 | 0 | $SIG_CODE->{$$} = $self; local $SIG{'PIPE'} = \&_del_gauge; | |||||||||||||||||||||||||||||||||||||||||||||
| 420 | 0 | print $fh $self->{'_GAUGE'}->{'PERCENT'}."\n"; | |||||||||||||||||||||||||||||||||||||||||||||
| 421 | 0 | ▶ | return(((defined $self->{'_GAUGE'}->{'FH'}) ? 1 : 0)); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 422 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 423 | sub gauge_set { | ||||||||||||||||||||||||||||||||||||||||||||||
| 424 | 0 | ▶ | my $self = $_[0]; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
gauge_set: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 425 | 0 | ▶ | my $perc = $_[1] || $self->{'_GAUGE'}->{'PERCENT'} || 1; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/5
$_[1] || $self->{'_GAUGE'}{'PERCENT'} || 1
$_[1] or $self->{"_GAUGE"}{"PERCENT"}
MC/DC0%0/2
$_[1] || $self->{'_GAUGE'}{'PERCENT'} || 1
$_[1]
$self->{"_GAUGE"}{"PERCENT"}
Truth table0%0/3
A or B
A= $_[1]B= $self->{"_GAUGE"}{"PERCENT"}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 426 | |||||||||||||||||||||||||||||||||||||||||||||||
| 427 | 0 | my $fh = $self->{'_GAUGE'}->{'FH'}; | |||||||||||||||||||||||||||||||||||||||||||||
| 428 | 0 | ▶ | return(0) unless $self->{'_GAUGE'}->{'FH'}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 429 | |||||||||||||||||||||||||||||||||||||||||||||||
| 430 | 0 | $self->{'_GAUGE'}->{'PERCENT'} = $perc; | |||||||||||||||||||||||||||||||||||||||||||||
| 431 | 0 | $SIG_CODE->{$$} = $self; local $SIG{'PIPE'} = \&_del_gauge; | |||||||||||||||||||||||||||||||||||||||||||||
| 432 | 0 | print $fh $self->{'_GAUGE'}->{'PERCENT'}."\n"; | |||||||||||||||||||||||||||||||||||||||||||||
| 433 | 0 | ▶ | return(((defined $self->{'_GAUGE'}->{'FH'}) ? 1 : 0)); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 434 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 435 | sub gauge_text { | ||||||||||||||||||||||||||||||||||||||||||||||
| 436 | 0 | ▶ | my $self = $_[0]; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
gauge_text: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 437 | 0 | ▶ | my $mesg = $_[1] || return(0); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$_[1] || (return 0)
MC/DC0%0/1
$_[1] || (return 0)
$_[1]
Truth table0%0/2
A
A= $_[1]
| |||||||||||||||||||||||||||||||||||||||||||||||
| 438 | |||||||||||||||||||||||||||||||||||||||||||||||
| 439 | 0 | my $fh = $self->{'_GAUGE'}->{'FH'}; | |||||||||||||||||||||||||||||||||||||||||||||
| 440 | 0 | ▶ | return(0) unless $self->{'_GAUGE'}->{'FH'}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 441 | |||||||||||||||||||||||||||||||||||||||||||||||
| 442 | 0 | $SIG_CODE->{$$} = $self; local $SIG{'PIPE'} = \&_del_gauge; | |||||||||||||||||||||||||||||||||||||||||||||
| 443 | 0 | print $fh "\nXXX\n\n".$mesg."\n\nXXX\n\n".$self->{'_GAUGE'}->{'PERCENT'}."\n"; | |||||||||||||||||||||||||||||||||||||||||||||
| 444 | 0 | ▶ | return(((defined $self->{'_GAUGE'}->{'FH'}) ? 1 : 0)); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 445 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 446 | sub gauge_stop { | ||||||||||||||||||||||||||||||||||||||||||||||
| 447 | 0 | ▶ | my $self = $_[0]; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
gauge_stop: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 448 | |||||||||||||||||||||||||||||||||||||||||||||||
| 449 | 0 | ▶ | return(0) unless $self->{'_GAUGE'}->{'FH'}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 450 | |||||||||||||||||||||||||||||||||||||||||||||||
| 451 | 0 | my $args = $self->{'_GAUGE'}->{'ARGS'}; | |||||||||||||||||||||||||||||||||||||||||||||
| 452 | 0 | my $fh = $self->{'_GAUGE'}->{'FH'}; | |||||||||||||||||||||||||||||||||||||||||||||
| 453 | 0 | $SIG_CODE->{$$} = $self; local $SIG{'PIPE'} = \&_del_gauge; | |||||||||||||||||||||||||||||||||||||||||||||
| 454 | 0 | $self->{'_GAUGE'}->{'FH'}->close(); | |||||||||||||||||||||||||||||||||||||||||||||
| 455 | 0 | delete($self->{'_GAUGE'}->{'FH'}); | |||||||||||||||||||||||||||||||||||||||||||||
| 456 | 0 | delete($self->{'_GAUGE'}->{'ARGS'}); | |||||||||||||||||||||||||||||||||||||||||||||
| 457 | 0 | delete($self->{'_GAUGE'}->{'PERCENT'}); | |||||||||||||||||||||||||||||||||||||||||||||
| 458 | 0 | delete($self->{'_GAUGE'}); | |||||||||||||||||||||||||||||||||||||||||||||
| 459 | 0 | $self->rv('null'); | |||||||||||||||||||||||||||||||||||||||||||||
| 460 | 0 | $self->rs('null'); | |||||||||||||||||||||||||||||||||||||||||||||
| 461 | 0 | $self->ra('null'); | |||||||||||||||||||||||||||||||||||||||||||||
| 462 | 0 | $self->_post($args); | |||||||||||||||||||||||||||||||||||||||||||||
| 463 | 0 | return(1); | |||||||||||||||||||||||||||||||||||||||||||||
| 464 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 465 | |||||||||||||||||||||||||||||||||||||||||||||||
| 466 | |||||||||||||||||||||||||||||||||||||||||||||||
| 467 | 6 | 1; | |||||||||||||||||||||||||||||||||||||||||||||