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