| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Mail::LMLM; |
|
2
|
|
|
|
|
|
|
$Mail::LMLM::VERSION = '0.6807'; |
|
3
|
1
|
|
|
1
|
|
69239
|
use strict; |
|
|
1
|
|
|
|
|
11
|
|
|
|
1
|
|
|
|
|
30
|
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
26
|
|
|
5
|
1
|
|
|
1
|
|
485
|
use autodie; |
|
|
1
|
|
|
|
|
15920
|
|
|
|
1
|
|
|
|
|
4
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
6913
|
use 5.008; |
|
|
1
|
|
|
|
|
8
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
7
|
use parent 'Mail::LMLM::Object'; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
6
|
|
|
10
|
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
511
|
use Mail::LMLM::Render::HTML (); |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
23
|
|
|
12
|
1
|
|
|
1
|
|
439
|
use Mail::LMLM::Types::Ezmlm (); |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
21
|
|
|
13
|
1
|
|
|
1
|
|
439
|
use Mail::LMLM::Types::Egroups (); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
21
|
|
|
14
|
1
|
|
|
1
|
|
419
|
use Mail::LMLM::Types::Listar (); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
22
|
|
|
15
|
1
|
|
|
1
|
|
419
|
use Mail::LMLM::Types::Majordomo (); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
23
|
|
|
16
|
1
|
|
|
1
|
|
411
|
use Mail::LMLM::Types::Listserv (); |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
29
|
|
|
17
|
1
|
|
|
1
|
|
471
|
use Mail::LMLM::Types::Mailman (); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
22
|
|
|
18
|
1
|
|
|
1
|
|
417
|
use Mail::LMLM::Types::GoogleGroups (); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
46
|
|
|
19
|
|
|
|
|
|
|
|
|
20
|
1
|
|
|
1
|
|
7
|
use vars qw(%mailing_list_classes); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
141
|
|
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
my $prefix = "Mail::LMLM::Types::"; |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub _pref |
|
25
|
|
|
|
|
|
|
{ |
|
26
|
7
|
|
|
7
|
|
13
|
my $name = shift; |
|
27
|
|
|
|
|
|
|
|
|
28
|
7
|
|
|
|
|
22
|
return $prefix . $name; |
|
29
|
|
|
|
|
|
|
} |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
%mailing_list_classes = ( |
|
32
|
|
|
|
|
|
|
( |
|
33
|
|
|
|
|
|
|
map { $_ => _pref( ucfirst($_) ) } ( |
|
34
|
|
|
|
|
|
|
'egroups', 'ezmlm', 'listar', 'majordomo', 'listserv', 'mailman' |
|
35
|
|
|
|
|
|
|
) |
|
36
|
|
|
|
|
|
|
), |
|
37
|
|
|
|
|
|
|
"google" => _pref("GoogleGroups"), |
|
38
|
|
|
|
|
|
|
); |
|
39
|
|
|
|
|
|
|
|
|
40
|
1
|
|
|
1
|
|
9
|
use vars qw(@render_what); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
952
|
|
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
@render_what = ( |
|
43
|
|
|
|
|
|
|
{ |
|
44
|
|
|
|
|
|
|
'title' => "Description", |
|
45
|
|
|
|
|
|
|
'func' => "render_description", |
|
46
|
|
|
|
|
|
|
'id' => "desc", |
|
47
|
|
|
|
|
|
|
}, |
|
48
|
|
|
|
|
|
|
{ |
|
49
|
|
|
|
|
|
|
'title' => "Posting Guidelines", |
|
50
|
|
|
|
|
|
|
'func' => "render_guidelines", |
|
51
|
|
|
|
|
|
|
'id' => "post_guidelines", |
|
52
|
|
|
|
|
|
|
}, |
|
53
|
|
|
|
|
|
|
{ |
|
54
|
|
|
|
|
|
|
'title' => "Subscribing to the Mailing-List", |
|
55
|
|
|
|
|
|
|
'func' => "render_subscribe", |
|
56
|
|
|
|
|
|
|
'id' => "subscribe", |
|
57
|
|
|
|
|
|
|
}, |
|
58
|
|
|
|
|
|
|
{ |
|
59
|
|
|
|
|
|
|
'title' => "Unsubscribing from the Mailing-List", |
|
60
|
|
|
|
|
|
|
'func' => "render_unsubscribe", |
|
61
|
|
|
|
|
|
|
'id' => "unsubscribe", |
|
62
|
|
|
|
|
|
|
}, |
|
63
|
|
|
|
|
|
|
{ |
|
64
|
|
|
|
|
|
|
'title' => "Posting Messages to the Mailing-List", |
|
65
|
|
|
|
|
|
|
'func' => "render_post", |
|
66
|
|
|
|
|
|
|
'id' => "posting", |
|
67
|
|
|
|
|
|
|
}, |
|
68
|
|
|
|
|
|
|
{ |
|
69
|
|
|
|
|
|
|
'title' => "Contacting the Mailing-List's Owner", |
|
70
|
|
|
|
|
|
|
'func' => "render_owner", |
|
71
|
|
|
|
|
|
|
'id' => "owner", |
|
72
|
|
|
|
|
|
|
}, |
|
73
|
|
|
|
|
|
|
{ |
|
74
|
|
|
|
|
|
|
'title' => "The Mailing-List's Homepage", |
|
75
|
|
|
|
|
|
|
'func' => "render_homepage", |
|
76
|
|
|
|
|
|
|
'id' => "homepage", |
|
77
|
|
|
|
|
|
|
}, |
|
78
|
|
|
|
|
|
|
{ |
|
79
|
|
|
|
|
|
|
'title' => "Online Messages Archive", |
|
80
|
|
|
|
|
|
|
'func' => "render_online_archive", |
|
81
|
|
|
|
|
|
|
'id' => "archive", |
|
82
|
|
|
|
|
|
|
}, |
|
83
|
|
|
|
|
|
|
); |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub _do_nothing |
|
86
|
|
|
|
0
|
|
|
{ |
|
87
|
|
|
|
|
|
|
} |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
sub initialize |
|
90
|
|
|
|
|
|
|
{ |
|
91
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
|
92
|
|
|
|
|
|
|
|
|
93
|
0
|
|
|
|
|
|
$self->{'title'} = "List of Mailing Lists"; |
|
94
|
0
|
|
|
|
|
|
$self->{'headline'} = "List of Mailing Lists"; |
|
95
|
0
|
|
|
|
|
|
$self->{'prolog'} = $self->{'epilog'} = \&_do_nothing; |
|
96
|
0
|
|
|
|
|
|
$self->{'extra_classes'} = {}; |
|
97
|
0
|
|
|
|
|
|
while ( scalar(@_) ) |
|
98
|
|
|
|
|
|
|
{ |
|
99
|
0
|
|
|
|
|
|
my $key = shift; |
|
100
|
0
|
|
|
|
|
|
my $value = shift; |
|
101
|
0
|
0
|
|
|
|
|
if ( $key =~ /^-?lists$/ ) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
{ |
|
103
|
0
|
|
|
|
|
|
$self->{'lists'} = $value; |
|
104
|
|
|
|
|
|
|
} |
|
105
|
|
|
|
|
|
|
elsif ( $key =~ /^-?title$/ ) |
|
106
|
|
|
|
|
|
|
{ |
|
107
|
0
|
|
|
|
|
|
$self->{'title'} = $value; |
|
108
|
|
|
|
|
|
|
} |
|
109
|
|
|
|
|
|
|
elsif ( $key =~ /^-?headline$/ ) |
|
110
|
|
|
|
|
|
|
{ |
|
111
|
0
|
|
|
|
|
|
$self->{'headline'} = $value; |
|
112
|
|
|
|
|
|
|
} |
|
113
|
|
|
|
|
|
|
elsif ( $key =~ /^-?extra-classes$/ ) |
|
114
|
|
|
|
|
|
|
{ |
|
115
|
0
|
|
|
|
|
|
$self->{'extra_classes'} = $value; |
|
116
|
|
|
|
|
|
|
} |
|
117
|
|
|
|
|
|
|
elsif ( $key =~ /^-?prolog$/ ) |
|
118
|
|
|
|
|
|
|
{ |
|
119
|
0
|
|
|
|
|
|
$self->{'prolog'} = $value; |
|
120
|
|
|
|
|
|
|
} |
|
121
|
|
|
|
|
|
|
elsif ( $key =~ /^-?epilog$/ ) |
|
122
|
|
|
|
|
|
|
{ |
|
123
|
0
|
|
|
|
|
|
$self->{'epilog'} = $value; |
|
124
|
|
|
|
|
|
|
} |
|
125
|
|
|
|
|
|
|
} |
|
126
|
|
|
|
|
|
|
|
|
127
|
0
|
0
|
|
|
|
|
if ( !exists( $self->{'lists'} ) ) |
|
128
|
|
|
|
|
|
|
{ |
|
129
|
0
|
|
|
|
|
|
die "The lists were not defined for Mail::LMLM!"; |
|
130
|
|
|
|
|
|
|
} |
|
131
|
0
|
|
|
|
|
|
return 0; |
|
132
|
|
|
|
|
|
|
} |
|
133
|
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
sub render |
|
135
|
|
|
|
|
|
|
{ |
|
136
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
|
137
|
|
|
|
|
|
|
|
|
138
|
0
|
|
|
|
|
|
open my $index_fh, ">", "index.html"; |
|
139
|
0
|
|
|
|
|
|
my $main_r = Mail::LMLM::Render::HTML->new( \$index_fh ); |
|
140
|
|
|
|
|
|
|
|
|
141
|
0
|
|
|
|
|
|
$main_r->start_document( $self->{'title'}, $self->{'headline'}, ); |
|
142
|
|
|
|
|
|
|
|
|
143
|
0
|
|
|
|
|
|
$self->{'prolog'}->( $self, $main_r ); |
|
144
|
|
|
|
|
|
|
|
|
145
|
0
|
|
|
|
|
|
foreach my $mailing_list ( @{ $self->{'lists'} } ) |
|
|
0
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
{ |
|
147
|
0
|
|
|
|
|
|
my $filename = $mailing_list->{'id'} . ".html"; |
|
148
|
0
|
|
|
|
|
|
open my $o_fh, ">", $filename; |
|
149
|
0
|
|
|
|
|
|
my $r = Mail::LMLM::Render::HTML->new( \$o_fh ); |
|
150
|
|
|
|
|
|
|
|
|
151
|
0
|
|
|
|
|
|
my $class_name = $mailing_list->{'class'}; |
|
152
|
|
|
|
|
|
|
my $class = |
|
153
|
|
|
|
|
|
|
$mailing_list_classes{$class_name} |
|
154
|
0
|
|
0
|
|
|
|
|| $self->{'extra_classes'}->{$class_name} |
|
155
|
|
|
|
|
|
|
|| die "Mail::LMLM: Unknown Class \"$class_name\""; |
|
156
|
0
|
0
|
|
|
|
|
my $mail_lister = ( |
|
157
|
|
|
|
|
|
|
( ref($class) eq "CODE" ) |
|
158
|
|
|
|
|
|
|
? $class->(%$mailing_list) |
|
159
|
|
|
|
|
|
|
: $class->new(%$mailing_list) |
|
160
|
|
|
|
|
|
|
); |
|
161
|
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
my $title = |
|
163
|
|
|
|
|
|
|
exists( $mailing_list->{'title'} ) |
|
164
|
|
|
|
|
|
|
? $mailing_list->{'title'} |
|
165
|
0
|
0
|
|
|
|
|
: $mailing_list->{'id'}; |
|
166
|
|
|
|
|
|
|
|
|
167
|
0
|
|
|
|
|
|
$r->start_document( $title, $title ); |
|
168
|
|
|
|
|
|
|
|
|
169
|
0
|
|
|
|
|
|
foreach my $what (@render_what) |
|
170
|
|
|
|
|
|
|
{ |
|
171
|
0
|
|
|
|
|
|
my $func = $what->{'func'}; |
|
172
|
0
|
|
|
|
|
|
$r->start_section( $what->{'title'}, +{ 'id' => $what->{'id'} } ); |
|
173
|
0
|
|
|
|
|
|
$mail_lister->$func($r); |
|
174
|
0
|
|
|
|
|
|
$r->end_section(); |
|
175
|
|
|
|
|
|
|
} |
|
176
|
|
|
|
|
|
|
|
|
177
|
0
|
|
|
|
|
|
$main_r->start_section( $title, { 'title_url' => $filename } ); |
|
178
|
0
|
|
|
|
|
|
$mail_lister->render_description($main_r); |
|
179
|
0
|
|
|
|
|
|
$main_r->end_section(); |
|
180
|
|
|
|
|
|
|
|
|
181
|
0
|
|
|
|
|
|
$r->end_document(); |
|
182
|
|
|
|
|
|
|
|
|
183
|
0
|
|
|
|
|
|
close($o_fh); |
|
184
|
|
|
|
|
|
|
} |
|
185
|
|
|
|
|
|
|
|
|
186
|
0
|
|
|
|
|
|
$self->{'epilog'}->( $self, $main_r ); |
|
187
|
|
|
|
|
|
|
|
|
188
|
0
|
|
|
|
|
|
$main_r->end_document(); |
|
189
|
0
|
|
|
|
|
|
close($index_fh); |
|
190
|
|
|
|
|
|
|
|
|
191
|
0
|
|
|
|
|
|
open my $STYLE, ">", "style.css"; |
|
192
|
0
|
|
|
|
|
|
print {$STYLE} <<"EOF"; |
|
|
0
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
a:hover { background-color : LightGreen } |
|
194
|
|
|
|
|
|
|
div.indent { margin-left : 3em } |
|
195
|
|
|
|
|
|
|
EOF |
|
196
|
|
|
|
|
|
|
|
|
197
|
0
|
|
|
|
|
|
close($STYLE); |
|
198
|
|
|
|
|
|
|
} |
|
199
|
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
#### Documentation |
|
201
|
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
__END__ |