line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Event::ExecFlow::Frontend::Term; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1178
|
use base qw( Event::ExecFlow::Frontend ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
89
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
6
|
use AnyEvent; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
21
|
|
6
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
6576
|
|
7
|
|
|
|
|
|
|
|
8
|
102
|
|
|
102
|
0
|
502
|
sub get_quiet { shift->{quiet} } |
9
|
0
|
|
|
0
|
0
|
0
|
sub get_nl_needed { shift->{nl_needed} } |
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
0
|
12
|
sub set_quiet { shift->{quiet} = $_[1] } |
12
|
0
|
|
|
0
|
0
|
0
|
sub set_nl_needed { shift->{nl_needed} = $_[1] } |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub start_job { |
15
|
1
|
|
|
1
|
0
|
6
|
my $self = shift; |
16
|
1
|
|
|
|
|
2
|
my ($job) = @_; |
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
|
|
9
|
my $w = AnyEvent->condvar; |
19
|
1
|
|
|
1
|
|
45558
|
$job->get_post_callbacks->add(sub { $w->broadcast }); |
|
1
|
|
|
|
|
29
|
|
20
|
1
|
|
|
|
|
12
|
$self->SUPER::start_job($job); |
21
|
1
|
|
|
|
|
25
|
$w->wait; |
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
|
|
15
|
1; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub report_job_start { |
27
|
14
|
|
|
14
|
0
|
98
|
my $self = shift; |
28
|
14
|
|
|
|
|
21
|
my ($job) = @_; |
29
|
|
|
|
|
|
|
|
30
|
14
|
50
|
|
|
|
28
|
return if $self->get_quiet; |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
0
|
$self->new_line; |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
0
|
print "START [".$job->get_name."]: ". |
35
|
|
|
|
|
|
|
$job->get_progress_text."\n"; |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
0
|
1; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub report_job_progress { |
41
|
74
|
|
|
74
|
0
|
128
|
my $self = shift; |
42
|
74
|
|
|
|
|
107
|
my ($job) = @_; |
43
|
|
|
|
|
|
|
|
44
|
74
|
50
|
|
|
|
256
|
return if $self->get_quiet; |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
0
|
print "PROGRESS [".$job->get_name."]: ". |
47
|
|
|
|
|
|
|
$job->get_progress_text." \r"; |
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
0
|
$self->set_nl_needed(1); |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
0
|
1; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub report_job_error { |
55
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
56
|
0
|
|
|
|
|
0
|
my ($job) = @_; |
57
|
|
|
|
|
|
|
|
58
|
0
|
0
|
|
|
|
0
|
return if $self->get_quiet; |
59
|
|
|
|
|
|
|
|
60
|
0
|
|
|
|
|
0
|
$self->new_line; |
61
|
|
|
|
|
|
|
|
62
|
0
|
|
|
|
|
0
|
print "ERROR [".$job->get_name."]:\n". |
63
|
|
|
|
|
|
|
$job->get_error_message."\n"; |
64
|
|
|
|
|
|
|
|
65
|
0
|
|
|
|
|
0
|
1; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub report_job_warning { |
69
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
70
|
0
|
|
|
|
|
0
|
my ($job, $message) = @_; |
71
|
|
|
|
|
|
|
|
72
|
0
|
|
0
|
|
|
0
|
$message ||= $job->get_warning_message; |
73
|
|
|
|
|
|
|
|
74
|
0
|
|
|
|
|
0
|
$self->new_line; |
75
|
|
|
|
|
|
|
|
76
|
0
|
|
|
|
|
0
|
print "WARNING [".$job->get_name."]: $message\n"; |
77
|
|
|
|
|
|
|
|
78
|
0
|
|
|
|
|
0
|
1; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub report_job_finished { |
82
|
14
|
|
|
14
|
0
|
35
|
my $self = shift; |
83
|
14
|
|
|
|
|
26
|
my ($job) = @_; |
84
|
|
|
|
|
|
|
|
85
|
14
|
50
|
33
|
|
|
62
|
return if $self->get_quiet and $job->get_state eq 'finished'; |
86
|
|
|
|
|
|
|
|
87
|
0
|
|
|
|
|
0
|
$self->new_line; |
88
|
|
|
|
|
|
|
|
89
|
0
|
|
|
|
|
0
|
print "\nFINISHED [".$job->get_name."]: "; |
90
|
|
|
|
|
|
|
|
91
|
0
|
0
|
|
|
|
0
|
print $job->get_cancelled ? "CANCELLED\n" : |
|
|
0
|
|
|
|
|
|
92
|
|
|
|
|
|
|
$job->get_error_message ? "ERROR\n" : |
93
|
|
|
|
|
|
|
"OK\n"; |
94
|
|
|
|
|
|
|
|
95
|
0
|
|
|
|
|
0
|
1; |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
sub new_line { |
99
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
100
|
|
|
|
|
|
|
|
101
|
0
|
0
|
|
|
|
0
|
if ( $self->get_nl_needed ) { |
102
|
0
|
|
|
|
|
0
|
print "\n"; |
103
|
0
|
|
|
|
|
0
|
$self->set_nl_needed(0); |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
0
|
|
|
|
|
0
|
1; |
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
sub log { |
110
|
10
|
|
|
10
|
0
|
19
|
my $self = shift; |
111
|
10
|
|
|
|
|
30
|
my ($msg) = @_; |
112
|
10
|
|
|
|
|
29
|
return; |
113
|
0
|
|
|
|
|
|
print "LOG $msg\n"; |
114
|
0
|
|
|
|
|
|
1; |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
1; |