line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# -*- Mode: cperl; mode: folding; -*- |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Goo::Thing::bug::Lister; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
############################################################################### |
6
|
|
|
|
|
|
|
# Nigel Hamilton |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# Copyright Nigel Hamilton 2005 |
9
|
|
|
|
|
|
|
# All Rights Reserved |
10
|
|
|
|
|
|
|
# |
11
|
|
|
|
|
|
|
# Author: Nigel Hamilton |
12
|
|
|
|
|
|
|
# Filename: Lister.pm |
13
|
|
|
|
|
|
|
# Description: List all the bugs |
14
|
|
|
|
|
|
|
# |
15
|
|
|
|
|
|
|
# Date Change |
16
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------- |
17
|
|
|
|
|
|
|
# |
18
|
|
|
|
|
|
|
############################################################################### |
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
1
|
|
3430
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
32
|
|
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
1
|
|
5
|
use Goo::Object; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
17
|
|
23
|
1
|
|
|
1
|
|
5
|
use Goo::Loader; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
78
|
|
24
|
1
|
|
|
1
|
|
6
|
use Goo::Profile; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
17
|
|
25
|
1
|
|
|
1
|
|
5
|
use Goo::Prompter; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
20
|
|
26
|
1
|
|
|
1
|
|
5
|
use Goo::Database; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
19
|
|
27
|
|
|
|
|
|
|
|
28
|
1
|
|
|
1
|
|
6
|
use Text::FormatTable; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
29
|
|
|
|
|
|
|
|
30
|
1
|
|
|
1
|
|
6
|
use base qw(Goo::Object); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
370
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# the size of the mental buffer |
33
|
|
|
|
|
|
|
our $BUFFER_SIZE = 7; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
############################################################################### |
37
|
|
|
|
|
|
|
# |
38
|
|
|
|
|
|
|
# get_bugs_table - return a table of things i care about |
39
|
|
|
|
|
|
|
# |
40
|
|
|
|
|
|
|
############################################################################### |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub get_bugs_table { |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
0
|
1
|
|
my ($this, $profile) = @_; |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
my $query = Goo::Database::execute_sql(<<EOSQL); |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
select title, bugid, importance, |
49
|
|
|
|
|
|
|
date_format(foundon, '%d %b %Y') as 'foundon', |
50
|
|
|
|
|
|
|
description |
51
|
|
|
|
|
|
|
from bug |
52
|
|
|
|
|
|
|
where status = 'alive' |
53
|
|
|
|
|
|
|
order by importance desc, foundon desc |
54
|
|
|
|
|
|
|
limit $BUFFER_SIZE |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
EOSQL |
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
my $full_text = ""; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
# set up the table |
61
|
0
|
|
|
|
|
|
my $table = Text::FormatTable->new('4l 60l 6l 11l 18l'); |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
# column headings |
64
|
0
|
|
|
|
|
|
$table->head('[#]', 'Title', 'BugID', 'Importance', 'Found On'); |
65
|
0
|
|
|
|
|
|
$table->rule('-'); |
66
|
|
|
|
|
|
|
|
67
|
0
|
|
|
|
|
|
while (my $row = Goo::Database::get_result_hash($query)) { |
68
|
|
|
|
|
|
|
|
69
|
0
|
|
|
|
|
|
my $index_key = $profile->get_next_index_key(); |
70
|
|
|
|
|
|
|
|
71
|
0
|
|
|
|
|
|
$profile->add_option($index_key, "$row->{bugid}.bug", "Goo::ThingProfileOption"); |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
# print "addin conter === $counter \n"; |
74
|
0
|
|
|
|
|
|
$table->row("[$index_key]", $row->{title}, $row->{bugid}, |
75
|
|
|
|
|
|
|
$row->{importance}, $row->{foundon}); |
76
|
0
|
|
|
|
|
|
$full_text .= $row->{title} . " " . $row->{description}; |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
0
|
|
|
|
|
|
return ($table->render(), $full_text); |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
############################################################################### |
86
|
|
|
|
|
|
|
# |
87
|
|
|
|
|
|
|
# run - show the care-o-meter |
88
|
|
|
|
|
|
|
# |
89
|
|
|
|
|
|
|
############################################################################### |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub run { |
92
|
|
|
|
|
|
|
|
93
|
0
|
|
|
0
|
1
|
|
my ($this, $thing) = @_; |
94
|
|
|
|
|
|
|
|
95
|
0
|
|
|
|
|
|
my $profile = Goo::Profile->new(Goo::Loader::load("care.goo")); |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
# show a profile of the Things I need to care about |
98
|
0
|
|
|
|
|
|
while (1) { |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
# profile clear |
101
|
0
|
|
|
|
|
|
$profile->clear(); |
102
|
|
|
|
|
|
|
|
103
|
0
|
|
|
|
|
|
Goo::Header::show("BugLister", "Things I need to care about"); |
104
|
|
|
|
|
|
|
|
105
|
0
|
|
|
|
|
|
my $full_text; |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
# add the bugs I care about |
108
|
0
|
|
|
|
|
|
my ($bugs_table, $bugs_text) = $this->get_bugs_table($profile); |
109
|
0
|
|
|
|
|
|
$full_text .= $bugs_text; |
110
|
0
|
|
|
|
|
|
$profile->add_rendered_table($bugs_table); |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
# add a list of Things found in this Thing |
113
|
0
|
|
|
|
|
|
$profile->add_things_table($full_text); |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
# show the profile and all the rendered tables |
116
|
0
|
|
|
|
|
|
$profile->display(); |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
# prompt the user for the next command |
119
|
0
|
|
|
|
|
|
$profile->get_command(); |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
} |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
1; |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
__END__ |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=head1 NAME |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
Goo::Thing::bug::Lister - List all the bugs |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=head1 SYNOPSIS |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
use Goo::Thing::bug::Lister; |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=head1 DESCRIPTION |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=head1 METHODS |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=over |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=item get_bugs_table |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
return a table of things i care about |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=item run |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
show the care-o-meter |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=back |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=head1 AUTHOR |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
Nigel Hamilton <nigel@trexy.com> |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
=head1 SEE ALSO |
162
|
|
|
|
|
|
|
|