| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Term::Spinner::Color; |
|
2
|
1
|
|
|
1
|
|
53271
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
24
|
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
22
|
|
|
4
|
1
|
|
|
1
|
|
15
|
use 5.010; |
|
|
1
|
|
|
|
|
7
|
|
|
5
|
1
|
|
|
1
|
|
277
|
use POSIX; |
|
|
1
|
|
|
|
|
4448
|
|
|
|
1
|
|
|
|
|
5
|
|
|
6
|
1
|
|
|
1
|
|
2373
|
use Time::HiRes qw( sleep ); |
|
|
1
|
|
|
|
|
919
|
|
|
|
1
|
|
|
|
|
3
|
|
|
7
|
1
|
|
|
1
|
|
581
|
use Term::ANSIColor; |
|
|
1
|
|
|
|
|
6395
|
|
|
|
1
|
|
|
|
|
64
|
|
|
8
|
1
|
|
|
1
|
|
378
|
use Term::Cap; |
|
|
1
|
|
|
|
|
2775
|
|
|
|
1
|
|
|
|
|
31
|
|
|
9
|
1
|
|
|
1
|
|
339
|
use utf8; |
|
|
1
|
|
|
|
|
19
|
|
|
|
1
|
|
|
|
|
8
|
|
|
10
|
1
|
|
|
1
|
|
334
|
use open ':std', ':encoding(UTF-8)'; |
|
|
1
|
|
|
|
|
947
|
|
|
|
1
|
|
|
|
|
7
|
|
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
$| = 1; # Disable buffering on STDOUT. |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# Couple of instance vars for colors and frame sets |
|
15
|
|
|
|
|
|
|
my @colors = qw( red green yellow blue magenta cyan white ); |
|
16
|
|
|
|
|
|
|
my %frames = ( |
|
17
|
|
|
|
|
|
|
'ascii_propeller' => [qw(/ - \\ |)], |
|
18
|
|
|
|
|
|
|
'ascii_plus' => [qw(x +)], |
|
19
|
|
|
|
|
|
|
'ascii_blink' => [qw(o -)], |
|
20
|
|
|
|
|
|
|
'ascii_v' => [qw(v < ^ >)], |
|
21
|
|
|
|
|
|
|
'ascii_inflate' => [qw(. o O o)], |
|
22
|
|
|
|
|
|
|
'uni_dots' => [qw(⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏)], |
|
23
|
|
|
|
|
|
|
'uni_dots2' => [qw(⣾ ⣽ ⣻ ⢿ ⡿ ⣟ ⣯ ⣷)], |
|
24
|
|
|
|
|
|
|
'uni_dots3' => [qw(⣷ ⣯ ⣟ ⡿ ⢿ ⣻ ⣽ ⣾)], |
|
25
|
|
|
|
|
|
|
'uni_dots4' => [qw(⠋ ⠙ ⠚ ⠞ ⠖ ⠦ ⠴ ⠲ ⠳ ⠓)], |
|
26
|
|
|
|
|
|
|
'uni_dots5' => [qw(⠄ ⠆ ⠇ ⠋ ⠙ ⠸ ⠰ ⠠ ⠰ ⠸ ⠙ ⠋ ⠇ ⠆)], |
|
27
|
|
|
|
|
|
|
'uni_dots6' => [qw(⠋ ⠙ ⠚ ⠒ ⠂ ⠂ ⠒ ⠲ ⠴ ⠦ ⠖ ⠒ ⠐ ⠐ ⠒ ⠓ ⠋')], |
|
28
|
|
|
|
|
|
|
'uni_dots7' => [qw(⠁ ⠉ ⠙ ⠚ ⠒ ⠂ ⠂ ⠒ ⠲ ⠴ ⠤ ⠄ ⠄ ⠤ ⠴ ⠲ ⠒ ⠂ ⠂ ⠒ ⠚ ⠙ ⠉ ⠁)], |
|
29
|
|
|
|
|
|
|
'uni_dots8' => [qw(⠈ ⠉ ⠋ ⠓ ⠒ ⠐ ⠐ ⠒ ⠖ ⠦ ⠤ ⠠ ⠠ ⠤ ⠦ ⠖ ⠒ ⠐ ⠐ ⠒ ⠓ ⠋ ⠉ ⠈)], |
|
30
|
|
|
|
|
|
|
'uni_dots9' => |
|
31
|
|
|
|
|
|
|
[qw(⠁ ⠁ ⠉ ⠙ ⠚ ⠒ ⠂ ⠂ ⠒ ⠲ ⠴ ⠤ ⠄ ⠄ ⠤ ⠠ ⠠ ⠤ ⠦ ⠖ ⠒ ⠐ ⠐ ⠒ ⠓ ⠋ ⠉ ⠈ ⠈)], |
|
32
|
|
|
|
|
|
|
'uni_dots10' => [qw(⢹ ⢺ ⢼ ⣸ ⣇ ⡧ ⡗ ⡏)], |
|
33
|
|
|
|
|
|
|
'uni_dots11' => [qw(⢄ ⢂ ⢁ ⡁ ⡈ ⡐ ⡠)], |
|
34
|
|
|
|
|
|
|
'uni_dots12' => [qw(⠁ ⠂ ⠄ ⡀ ⢀ ⠠ ⠐ ⠈)], |
|
35
|
|
|
|
|
|
|
'uni_bounce' => [qw(⠁ ⠂ ⠄ ⠂)], |
|
36
|
|
|
|
|
|
|
'uni_pipes' => [qw(┤ ┘ ┴ └ ├ ┌ ┬ ┐)], |
|
37
|
|
|
|
|
|
|
'uni_hippie' => [qw(☮ ✌ ☺ ♥)], |
|
38
|
|
|
|
|
|
|
'uni_hands' => [qw(☜ ☝ ☞ ☟)], |
|
39
|
|
|
|
|
|
|
'uni_arrow_rot' => [qw(➫ ➭ ➬ ➭)], |
|
40
|
|
|
|
|
|
|
'uni_cards' => [qw(♣ ♤ ♥ ♦)], |
|
41
|
|
|
|
|
|
|
'uni_triangle' => [qw(◢ ◣ ◤ ◥)], |
|
42
|
|
|
|
|
|
|
'uni_square' => [qw(◰ ◳ ◲ ◱)], |
|
43
|
|
|
|
|
|
|
'uni_pie' => [qw(◴ ◷ ◶ ◵)], |
|
44
|
|
|
|
|
|
|
'uni_circle' => [qw(◐ ◓ ◑ ◒)], |
|
45
|
|
|
|
|
|
|
'uni_qtr_circle' => [qw(◜ ◝ ◞ ◟)], |
|
46
|
|
|
|
|
|
|
'uni_three_lines' => [qw(⚞ ☰ ⚟ ☰)], |
|
47
|
|
|
|
|
|
|
'uni_trigram_down' => [qw(☰ ☱ ☲ ☴)], |
|
48
|
|
|
|
|
|
|
'uni_trigram_bounce' => [qw(☰ ☱ ☲ ☴ ☰ ☴ ☲ ☱)], |
|
49
|
|
|
|
|
|
|
'uni_count' => [qw(➀ ➁ ➂ ➃ ➄ ➅ ➆ ➇ ➈ ➉)], |
|
50
|
|
|
|
|
|
|
'uni_ellipsis_propeller' => [qw(⋮ ⋰ ⋯ ⋱)], |
|
51
|
|
|
|
|
|
|
'uni_earth' => [qw(🌍 🌏 🌎)], |
|
52
|
|
|
|
|
|
|
'uni_moon' => [qw(🌑 🌘 🌗 🌖 🌕 🌔 🌒)], |
|
53
|
|
|
|
|
|
|
'uni_junk_food' => [qw(🌭 🌮 🌯 🍔 🍕 🍟)], |
|
54
|
|
|
|
|
|
|
'uni_clapping' => [qw(👐 👏)], |
|
55
|
|
|
|
|
|
|
'uni_diamonds' => [qw(🔹 🔷 🔸 🔶)], |
|
56
|
|
|
|
|
|
|
'wide_ascii_prog' => [ |
|
57
|
|
|
|
|
|
|
qw([>----] [=>---] [==>--] [===>-] [====>] [----<] [---<=] [--<==] [-<===] [<====]) |
|
58
|
|
|
|
|
|
|
], |
|
59
|
|
|
|
|
|
|
'wide_ascii_propeller' => |
|
60
|
|
|
|
|
|
|
[qw([|----] [=/---] [==---] [===\-] [====|] [---\=] [---==] [-/===])], |
|
61
|
|
|
|
|
|
|
'wide_ascii_snek' => [ |
|
62
|
|
|
|
|
|
|
qw([>----] [~>---] [~~>--] [~~~>-] [~~~~>] [----<] [---<~] [--<~~] [-<~~~] [<~~~~]) |
|
63
|
|
|
|
|
|
|
], |
|
64
|
|
|
|
|
|
|
'wide_uni_greyscale' => [ |
|
65
|
|
|
|
|
|
|
qw(▒▒▒▒▒▒▒ █▒▒▒▒▒▒ ██▒▒▒▒▒ ███▒▒▒▒ ████▒▒▒ █████▒▒ ██████▒ ███████ ██████▒ █████▒▒ ████▒▒▒ ███▒▒▒▒ ██▒▒▒▒▒ █▒▒▒▒▒▒ ▒▒▒▒▒▒▒) |
|
66
|
|
|
|
|
|
|
], |
|
67
|
|
|
|
|
|
|
'wide_uni_greyscale2' => [ |
|
68
|
|
|
|
|
|
|
qw(▒▒▒▒▒▒▒ █▒▒▒▒▒▒ ██▒▒▒▒▒ ███▒▒▒▒ ████▒▒▒ █████▒▒ ██████▒ ███████ ▒██████ ▒▒█████ ▒▒▒████ ▒▒▒▒███ ▒▒▒▒▒██ ▒▒▒▒▒█ ▒▒▒▒▒▒) |
|
69
|
|
|
|
|
|
|
], |
|
70
|
|
|
|
|
|
|
); |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub new { |
|
73
|
0
|
|
|
0
|
0
|
|
my ( $class, %args ) = @_; |
|
74
|
0
|
|
|
|
|
|
my $self = {}; |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
# seq can either be an array ref with a whole set of frames, or can be the |
|
77
|
|
|
|
|
|
|
# name of a frame set. |
|
78
|
0
|
0
|
|
|
|
|
if ( !defined( $args{'seq'} ) ) { |
|
|
|
0
|
|
|
|
|
|
|
79
|
0
|
|
|
|
|
|
$self->{'seq'} = $frames{'wide_uni_greyscale2'}; |
|
80
|
|
|
|
|
|
|
} |
|
81
|
|
|
|
|
|
|
elsif ( ref( $args{'seq'} ) ne 'ARRAY' ) { |
|
82
|
0
|
|
|
|
|
|
$self->{'seq'} = $frames{ $args{'seq'} }; |
|
83
|
|
|
|
|
|
|
} |
|
84
|
|
|
|
|
|
|
else { |
|
85
|
0
|
|
|
|
|
|
$self->{'seq'} = $args{'seq'}; |
|
86
|
|
|
|
|
|
|
} |
|
87
|
|
|
|
|
|
|
|
|
88
|
0
|
|
0
|
|
|
|
$self->{'delay'} = $args{'delay'} || 0.2; |
|
89
|
0
|
|
0
|
|
|
|
$self->{'color'} = $args{'color'} || 'cyan'; |
|
90
|
0
|
|
0
|
|
|
|
$self->{'colorcycle'} = $args{'colorcycle'} || 0; |
|
91
|
0
|
|
|
|
|
|
$self->{'bksp'} = chr(0x08); |
|
92
|
0
|
|
|
|
|
|
$self->{'last_size'} = length( $self->{'seq'}[0] ); |
|
93
|
0
|
|
|
|
|
|
return bless $self, $class; |
|
94
|
|
|
|
|
|
|
} |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
sub start { |
|
97
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
|
98
|
0
|
|
|
|
|
|
print "\x1b[?25l"; # Hide cursor |
|
99
|
0
|
|
|
|
|
|
$self->{'last_size'} = length( $self->{'seq'}[0] ); |
|
100
|
0
|
|
|
|
|
|
print colored( "$self->{'seq'}[0]", $self->{'color'} ); |
|
101
|
|
|
|
|
|
|
} |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
sub next { |
|
104
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
|
105
|
0
|
|
|
|
|
|
state $pos = 1; |
|
106
|
|
|
|
|
|
|
|
|
107
|
0
|
0
|
|
|
|
|
if ( $self->{'colorcycle'} ) { |
|
108
|
0
|
|
|
|
|
|
push @colors, shift @colors; # rotate the colors list |
|
109
|
0
|
|
|
|
|
|
$self->{'color'} = $colors[0]; |
|
110
|
|
|
|
|
|
|
} |
|
111
|
|
|
|
|
|
|
|
|
112
|
0
|
|
|
|
|
|
print $self->{'bksp'} x $self->{'last_size'}; |
|
113
|
0
|
|
|
|
|
|
print colored( "$self->{'seq'}[$pos]", $self->{'color'} ); |
|
114
|
|
|
|
|
|
|
|
|
115
|
0
|
|
|
|
|
|
$pos = ++$pos % scalar @{ $self->{'seq'} }; |
|
|
0
|
|
|
|
|
|
|
|
116
|
0
|
|
|
|
|
|
$self->{'last_size'} = length( $self->{'seq'}[$pos] ); |
|
117
|
|
|
|
|
|
|
} |
|
118
|
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
sub done { |
|
120
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
|
121
|
|
|
|
|
|
|
|
|
122
|
0
|
|
|
|
|
|
print $self->{'bksp'} x $self->{'last_size'}; |
|
123
|
0
|
|
|
|
|
|
print "\x1b[?25h"; # Show cursor |
|
124
|
|
|
|
|
|
|
} |
|
125
|
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
# Fork and run spinner asynchronously, until signal received. |
|
127
|
|
|
|
|
|
|
sub auto_start { |
|
128
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
|
129
|
|
|
|
|
|
|
|
|
130
|
0
|
|
|
|
|
|
my $ppid = $$; |
|
131
|
0
|
|
|
|
|
|
my $pid = fork(); |
|
132
|
0
|
0
|
|
|
|
|
die("Failed to fork progress indicator.\n") unless defined $pid; |
|
133
|
|
|
|
|
|
|
|
|
134
|
0
|
0
|
|
|
|
|
if ($pid) { # Parent |
|
135
|
0
|
|
|
|
|
|
$self->{'child'} = $pid; |
|
136
|
0
|
|
|
|
|
|
return; |
|
137
|
|
|
|
|
|
|
} |
|
138
|
|
|
|
|
|
|
else { # Kid stuff |
|
139
|
0
|
|
|
|
|
|
$self->start(); |
|
140
|
0
|
|
|
|
|
|
my $exists; |
|
141
|
0
|
|
|
|
|
|
while (1) { |
|
142
|
0
|
|
|
|
|
|
sleep $self->{'delay'}; |
|
143
|
0
|
|
|
|
|
|
$self->next(); |
|
144
|
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
# Check to be sure parent is still running, if not, die |
|
146
|
0
|
|
|
|
|
|
$exists = kill 0, $ppid; |
|
147
|
0
|
0
|
|
|
|
|
unless ($exists) { |
|
148
|
0
|
|
|
|
|
|
$self->done(); |
|
149
|
0
|
|
|
|
|
|
exit 0; |
|
150
|
|
|
|
|
|
|
} |
|
151
|
0
|
|
|
|
|
|
$exists = ""; |
|
152
|
|
|
|
|
|
|
} |
|
153
|
0
|
|
|
|
|
|
exit 0; # Should never get here? |
|
154
|
|
|
|
|
|
|
} |
|
155
|
|
|
|
|
|
|
} |
|
156
|
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
sub auto_done { |
|
158
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
|
159
|
|
|
|
|
|
|
|
|
160
|
0
|
|
|
|
|
|
kill 'KILL', $self->{'child'}; |
|
161
|
0
|
|
|
|
|
|
my $pid = wait(); |
|
162
|
0
|
|
|
|
|
|
$self->done(); |
|
163
|
|
|
|
|
|
|
} |
|
164
|
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
# Run, OK? Does a thing, or a list of things. usually long-running things, |
|
166
|
|
|
|
|
|
|
# runs a spinner, and prints a nice status message (check or X, whether |
|
167
|
|
|
|
|
|
|
# success or err), when done. |
|
168
|
|
|
|
|
|
|
sub run_ok { |
|
169
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
|
170
|
0
|
|
|
|
|
|
my $exp = shift; # A list of functions to call and wait on. |
|
171
|
0
|
|
|
|
|
|
my $message = shift; # String to print before the spinner |
|
172
|
0
|
|
|
|
|
|
my $termwidth = `tput cols`; |
|
173
|
0
|
0
|
|
|
|
|
$termwidth = 80 unless $termwidth <= 80; |
|
174
|
0
|
|
|
|
|
|
my $cols = $termwidth - length($message) - $self->{'last_size'} - 1; |
|
175
|
0
|
|
|
|
|
|
my ( $ok, $nok ); |
|
176
|
0
|
0
|
|
|
|
|
if ( $self->{'last_size'} == 1 ) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
177
|
0
|
|
|
|
|
|
$ok = colored( "✔", 'green' ); |
|
178
|
0
|
|
|
|
|
|
$nok = colored( "✘", 'red' ); |
|
179
|
|
|
|
|
|
|
} |
|
180
|
|
|
|
|
|
|
elsif ( $self->{'last_size'} == 3 ) { |
|
181
|
0
|
|
|
|
|
|
$ok = colored( "[✔]", 'white on_green' ); |
|
182
|
0
|
|
|
|
|
|
$nok = colored( "[✘]", 'white on_red' ); |
|
183
|
|
|
|
|
|
|
} |
|
184
|
|
|
|
|
|
|
elsif ( $self->{'last_size'} == 5 ) { |
|
185
|
0
|
|
|
|
|
|
$ok = colored( "[ ✔ ]", 'white on_green' ); |
|
186
|
0
|
|
|
|
|
|
$nok = colored( "[ ✘ ]", 'white on_red' ); |
|
187
|
|
|
|
|
|
|
} |
|
188
|
|
|
|
|
|
|
else { # Better be 7, or it'll look goofy, but still work |
|
189
|
0
|
|
|
|
|
|
$ok = colored( "[ ✔ ]", 'white on_green' ); |
|
190
|
0
|
|
|
|
|
|
$nok = colored( "[ ✘ ]", 'white on_red' ); |
|
191
|
|
|
|
|
|
|
} |
|
192
|
|
|
|
|
|
|
|
|
193
|
0
|
|
|
|
|
|
print $message; |
|
194
|
0
|
|
|
|
|
|
print ' ' x $cols; |
|
195
|
0
|
0
|
|
|
|
|
if ( ref($exp) eq 'ARRAY' ) { # List of expressions |
|
196
|
0
|
|
|
|
|
|
$self->start(); |
|
197
|
0
|
|
|
|
|
|
foreach my $exp ( @{$exp} ) { |
|
|
0
|
|
|
|
|
|
|
|
198
|
0
|
|
|
|
|
|
$self->next(); |
|
199
|
0
|
|
|
|
|
|
my $res = eval $exp; ## no critic |
|
200
|
0
|
0
|
|
|
|
|
unless ($res) { |
|
201
|
0
|
|
|
|
|
|
$self->done(); |
|
202
|
0
|
|
|
|
|
|
say $nok; |
|
203
|
0
|
|
|
|
|
|
return 0; |
|
204
|
|
|
|
|
|
|
} |
|
205
|
|
|
|
|
|
|
} |
|
206
|
0
|
|
|
|
|
|
$self->done(); |
|
207
|
0
|
|
|
|
|
|
say $ok; |
|
208
|
|
|
|
|
|
|
} |
|
209
|
|
|
|
|
|
|
else { # Single expression |
|
210
|
0
|
|
|
|
|
|
$self->auto_start(); |
|
211
|
0
|
|
|
|
|
|
my $res = eval $exp; ## no critic |
|
212
|
0
|
0
|
|
|
|
|
unless ($res) { |
|
213
|
0
|
|
|
|
|
|
$self->auto_done(); |
|
214
|
0
|
|
|
|
|
|
say $nok; |
|
215
|
0
|
|
|
|
|
|
return 0; |
|
216
|
|
|
|
|
|
|
} |
|
217
|
0
|
|
|
|
|
|
$self->auto_done(); |
|
218
|
0
|
|
|
|
|
|
say $ok; |
|
219
|
|
|
|
|
|
|
} |
|
220
|
|
|
|
|
|
|
} |
|
221
|
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
# Return list of available frames |
|
223
|
|
|
|
|
|
|
sub available_frames { |
|
224
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
|
225
|
0
|
|
|
|
|
|
return \%frames; |
|
226
|
|
|
|
|
|
|
} |
|
227
|
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
sub available_colors { |
|
229
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
|
230
|
0
|
|
|
|
|
|
return @colors; |
|
231
|
|
|
|
|
|
|
} |
|
232
|
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
# ok! |
|
234
|
|
|
|
|
|
|
# Call this if you want a nice checkmark after you spinn |
|
235
|
|
|
|
|
|
|
sub ok { |
|
236
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
|
237
|
0
|
|
|
|
|
|
my $ok; |
|
238
|
0
|
0
|
|
|
|
|
if ( $self->{'last_size'} == 1 ) { |
|
|
|
0
|
|
|
|
|
|
|
239
|
0
|
|
|
|
|
|
$ok = colored( "✔", 'green' ); |
|
240
|
|
|
|
|
|
|
} |
|
241
|
|
|
|
|
|
|
elsif ( $self->{'last_size'} == 5 ) { |
|
242
|
0
|
|
|
|
|
|
$ok = colored( "[ ✔ ]", 'white on_green' ); |
|
243
|
|
|
|
|
|
|
} |
|
244
|
|
|
|
|
|
|
else { # Better be 7, or it'll look goofy, but still work |
|
245
|
0
|
|
|
|
|
|
$ok = colored( "[ ✔ ]", 'white on_green' ); |
|
246
|
|
|
|
|
|
|
} |
|
247
|
0
|
|
|
|
|
|
say $ok; |
|
248
|
|
|
|
|
|
|
} |
|
249
|
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
# nok! |
|
251
|
|
|
|
|
|
|
# call this to tell user everything is not ok. prints a red x |
|
252
|
|
|
|
|
|
|
sub nok { |
|
253
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
|
254
|
0
|
|
|
|
|
|
my $nok; |
|
255
|
0
|
0
|
|
|
|
|
if ( $self->{'last_size'} == 1 ) { |
|
|
|
0
|
|
|
|
|
|
|
256
|
0
|
|
|
|
|
|
$nok = colored( "✘", 'red' ); |
|
257
|
|
|
|
|
|
|
} |
|
258
|
|
|
|
|
|
|
elsif ( $self->{'last_size'} == 5 ) { |
|
259
|
0
|
|
|
|
|
|
$nok = colored( "[ ✘ ]", 'white on_red' ); |
|
260
|
|
|
|
|
|
|
} |
|
261
|
|
|
|
|
|
|
else { # Better be 7, or it'll look goofy, but still work |
|
262
|
0
|
|
|
|
|
|
$nok = colored( "[ ✘ ]", 'white on_red' ); |
|
263
|
|
|
|
|
|
|
} |
|
264
|
0
|
|
|
|
|
|
say $nok; |
|
265
|
|
|
|
|
|
|
} |
|
266
|
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
# Frame length of the first frame of a seq...this won't work if |
|
268
|
|
|
|
|
|
|
# if the frames change size, but the rest of the spinnner will |
|
269
|
|
|
|
|
|
|
# probably also screw up in that case. |
|
270
|
|
|
|
|
|
|
sub frame_length { |
|
271
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
|
272
|
0
|
|
|
|
|
|
return length( $self->{'seq'}[0] ); |
|
273
|
|
|
|
|
|
|
} |
|
274
|
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
1; |
|
276
|
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
__END__ |