diff options
| author | fukachan <fukachan> | 2002-01-13 14:51:25 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2002-01-13 14:51:25 +0000 |
| commit | 1f90ea4f35453bbc276c1a9942655c0caa66a148 (patch) | |
| tree | 3e98f9ea9f189ded75470d041c84a6d1e9609d43 /fml/lib/Mail/ThreadTrack | |
| parent | 48105cef6bf7d7217d8dfc32cc8d65d8207e6250 (diff) | |
| download | fml8-1f90ea4f35453bbc276c1a9942655c0caa66a148.tar.gz fml8-1f90ea4f35453bbc276c1a9942655c0caa66a148.tar.bz2 fml8-1f90ea4f35453bbc276c1a9942655c0caa66a148.zip | |
update comments, copyright. FNF-ify.
delayed loading by eval { use ...}.
Diffstat (limited to 'fml/lib/Mail/ThreadTrack')
| -rw-r--r-- | fml/lib/Mail/ThreadTrack/Print/HTML.pm | 61 | ||||
| -rw-r--r-- | fml/lib/Mail/ThreadTrack/Print/Message.pm | 70 | ||||
| -rw-r--r-- | fml/lib/Mail/ThreadTrack/Print/Sort.pm | 58 | ||||
| -rw-r--r-- | fml/lib/Mail/ThreadTrack/Print/Text.pm | 71 | ||||
| -rw-r--r-- | fml/lib/Mail/ThreadTrack/Print/Utils.pm | 59 |
5 files changed, 279 insertions, 40 deletions
diff --git a/fml/lib/Mail/ThreadTrack/Print/HTML.pm b/fml/lib/Mail/ThreadTrack/Print/HTML.pm index bff0e198..bf919434 100644 --- a/fml/lib/Mail/ThreadTrack/Print/HTML.pm +++ b/fml/lib/Mail/ThreadTrack/Print/HTML.pm @@ -1,10 +1,10 @@ #-*- perl -*- # -# Copyright (C) 2001 Ken'ichi Fukamachi +# Copyright (C) 2001,2002 Ken'ichi Fukamachi # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: HTML.pm,v 1.7 2001/11/17 04:03:38 fukachan Exp $ +# $FML: HTML.pm,v 1.8 2001/12/22 09:21:21 fukachan Exp $ # package Mail::ThreadTrack::Print::HTML; @@ -12,13 +12,35 @@ package Mail::ThreadTrack::Print::HTML; use strict; use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD); use Carp; -use CGI qw/:standard/; + +=head1 NAME + +Mail::ThreadTrack::Print::HTML - print thread summary as HTML + +=head1 SYNOPSIS + +See C<Mail::ThreadTrack::Print> for usage of this subclass. + +=head1 DESCRIPTION + +See C<Mail::ThreadTrack::Print> for usage of this subclass. + +=head1 METHODS + +=head2 show_articles_in_thread(thread_id) + +show articles as HTML in this thread. + +=cut + + +use CGI qw/:standard/; use Mail::ThreadTrack::Print::Utils qw(decode_mime_string STR2EUC); # Descriptions: show articles as HTML in this thread -# Arguments: $self $str +# Arguments: OBJ($self) STR($thread_id) # Side Effects: none # Return Value: none sub show_articles_in_thread @@ -62,7 +84,7 @@ sub show_articles_in_thread # Descriptions: show guide -# Arguments: $self $args +# Arguments: OBJ($self) HASH_REF($args) # Side Effects: none # Return Value: none sub __start_thread_summary @@ -110,7 +132,7 @@ sub __start_thread_summary # Descriptions: finalize thread list # close TABLE tag -# Arguments: $self $args +# Arguments: OBJ($self) HASH_REF($args) # Side Effects: none # Return Value: none sub __end_thread_summary @@ -128,7 +150,7 @@ sub __end_thread_summary # Descriptions: This shows summary on C<$thread_id> in HTML language. # It is used in C<FML::CGI::ThreadSystem>. -# Arguments: $self $args +# Arguments: OBJ($self) HASH_REF($args) # Side Effects: none # Return Value: none sub __print_thread_summary @@ -207,7 +229,7 @@ sub __print_thread_summary } -# Descriptions: dummy +# Descriptions: dummy, defined for symmetry # Arguments: none # Side Effects: none # Return Value: none @@ -217,4 +239,27 @@ sub __print_message_summary } +=head1 CODING STYLE + +See C<http://www.fml.org/software/FNF/> on fml coding style guide. + +=head1 AUTHOR + +Ken'ichi Fukamachi + +=head1 COPYRIGHT + +Copyright (C) 2001,2002 Ken'ichi Fukamachi + +All rights reserved. This program is free software; you can +redistribute it and/or modify it under the same terms as Perl itself. + +=head1 HISTORY + +Mail::ThreadTrack::Print::HTML appeared in fml5 mailing list driver package. +See C<http://www.fml.org/> for more details. + +=cut + + 1; diff --git a/fml/lib/Mail/ThreadTrack/Print/Message.pm b/fml/lib/Mail/ThreadTrack/Print/Message.pm index 5dcf6edb..b5026cd8 100644 --- a/fml/lib/Mail/ThreadTrack/Print/Message.pm +++ b/fml/lib/Mail/ThreadTrack/Print/Message.pm @@ -1,10 +1,10 @@ #-*- perl -*- # -# Copyright (C) 2001 Ken'ichi Fukamachi +# Copyright (C) 2001,2002 Ken'ichi Fukamachi # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Message.pm,v 1.4 2001/11/19 03:01:26 fukachan Exp $ +# $FML: Message.pm,v 1.5 2001/12/22 09:21:21 fukachan Exp $ # package Mail::ThreadTrack::Print::Message; @@ -13,6 +13,32 @@ use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD); use Carp; use Mail::ThreadTrack::Print::Utils qw(decode_mime_string STR2EUC); + +=head1 NAME + +Mail::ThreadTrack::Print::Message - summarize et.al. + +=head1 SYNOPSIS + +See C<Mail::ThreadTrack::Print> for usage of this subclass. + +=head1 DESCRIPTION + +See C<Mail::ThreadTrack::Print> for usage of this subclass. + +=head1 METHODS + +=head2 message_summary($file) + +make message summary for specified $file (article). + +=cut + + +# Descriptions: make message summary for specified $file (article) +# Arguments: OBJ($self) STR($file) +# Side Effects: none +# Return Value: STR sub message_summary { my ($self, $file) = @_; @@ -77,6 +103,10 @@ sub message_summary } +# Descriptions: str looks effective, not quotation et.al. ? +# Arguments: STR($str) +# Side Effects: none +# Return Value: 1 or 0 sub _valid_buf { my ($str) = @_; @@ -99,6 +129,10 @@ sub _valid_buf } +# Descriptions: remove subject tag like string in $str e.g. [elena 100] +# Arguments: STR($str) +# Side Effects: none +# Return Value: STR sub _delete_subject_tag_like_string { my ($str) = @_; @@ -113,6 +147,10 @@ sub _delete_subject_tag_like_string } +# Descriptions: make summary of header $args->{ header } +# Arguments: OBJ($self) HASH_REF($args) +# Side Effects: none +# Return Value: STR sub header_summary { my ($self, $args) = @_; @@ -141,6 +179,11 @@ sub header_summary } +# Descriptions: get gecos field in $address. +# return $address itself if the extraction failed. +# Arguments: OBJ($self) STR($address) +# Side Effects: none +# Return Value: STR sub _who_of_address { my ($self, $address) = @_; @@ -172,4 +215,27 @@ sub _who_of_address } +=head1 CODING STYLE + +See C<http://www.fml.org/software/FNF/> on fml coding style guide. + +=head1 AUTHOR + +Ken'ichi Fukamachi + +=head1 COPYRIGHT + +Copyright (C) 2001,2002 Ken'ichi Fukamachi + +All rights reserved. This program is free software; you can +redistribute it and/or modify it under the same terms as Perl itself. + +=head1 HISTORY + +Mail::ThreadTrack::Print::Message appeared in fml5 mailing list driver package. +See C<http://www.fml.org/> for more details. + +=cut + + 1; diff --git a/fml/lib/Mail/ThreadTrack/Print/Sort.pm b/fml/lib/Mail/ThreadTrack/Print/Sort.pm index dbe3e027..77df7011 100644 --- a/fml/lib/Mail/ThreadTrack/Print/Sort.pm +++ b/fml/lib/Mail/ThreadTrack/Print/Sort.pm @@ -1,10 +1,10 @@ #-*- perl -*- # -# Copyright (C) 2001 Ken'ichi Fukamachi +# Copyright (C) 2001,2002 Ken'ichi Fukamachi # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Sort.pm,v 1.4 2001/11/10 08:50:41 fukachan Exp $ +# $FML: Sort.pm,v 1.5 2001/12/22 09:21:21 fukachan Exp $ # package Mail::ThreadTrack::Print::Sort; @@ -13,15 +13,29 @@ use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD); use Carp; +=head1 NAME + +Mail::ThreadTrack::Print::Sort - sort function for printing + +=head1 SYNOPSIS + +See C<Mail::ThreadTrack::Print> for usage of this subclass. + +=head1 DESCRIPTION + +See C<Mail::ThreadTrack::Print> for usage of this subclass. + +=head1 METHODS + =head2 sort_thread_id($thread_id_list) =cut -# Descriptions: -# Arguments: $self $args -# Side Effects: -# Return Value: none +# Descriptions: sort ARRAY REFERENCE $thread_id_list +# Arguments: OBJ($self) REF_ARRAY($thread_id_list) +# Side Effects: none +# Return Value: REF_ARRAY sub sort_thread_id { my ($self, $thread_id_list) = @_; @@ -45,10 +59,10 @@ my $status_cost = { }; -# Descriptions: -# Arguments: $self $args -# Side Effects: -# Return Value: none +# Descriptions: evaluate how old and status for each thread +# Arguments: OBJ($self) REF_ARRAY($thread_id_list) +# Side Effects: none +# Return Value: ARRAY( REF_HASH, REF_HASH ) sub _calculate_age { my ($self, $thread_id_list) = @_; @@ -79,4 +93,28 @@ sub _calculate_age } + +=head1 CODING STYLE + +See C<http://www.fml.org/software/FNF/> on fml coding style guide. + +=head1 AUTHOR + +Ken'ichi Fukamachi + +=head1 COPYRIGHT + +Copyright (C) 2001,2002 Ken'ichi Fukamachi + +All rights reserved. This program is free software; you can +redistribute it and/or modify it under the same terms as Perl itself. + +=head1 HISTORY + +Mail::ThreadTrack::Print::Sort appeared in fml5 mailing list driver package. +See C<http://www.fml.org/> for more details. + +=cut + + 1; diff --git a/fml/lib/Mail/ThreadTrack/Print/Text.pm b/fml/lib/Mail/ThreadTrack/Print/Text.pm index 63180fa6..3b059748 100644 --- a/fml/lib/Mail/ThreadTrack/Print/Text.pm +++ b/fml/lib/Mail/ThreadTrack/Print/Text.pm @@ -1,10 +1,10 @@ #-*- perl -*- # -# Copyright (C) 2001 Ken'ichi Fukamachi +# Copyright (C) 2001,2002 Ken'ichi Fukamachi # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Text.pm,v 1.4 2001/11/19 08:47:01 fukachan Exp $ +# $FML: Text.pm,v 1.5 2001/12/22 09:21:21 fukachan Exp $ # package Mail::ThreadTrack::Print::Text; @@ -13,13 +13,32 @@ use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD); use Carp; use Mail::ThreadTrack::Print::Utils qw(decode_mime_string STR2EUC); +=head1 NAME + +Mail::ThreadTrack::Print::Text - what is this + +=head1 SYNOPSIS + +See C<Mail::ThreadTrack::Print> for usage of this subclass. + +=head1 DESCRIPTION + +See C<Mail::ThreadTrack::Print> for usage of this subclass. + +=head1 METHODS + +=head2 show_articles_in_thread(thread_id) + +=cut + + my $is_show_cost_indicate = 0; my $format = "%-20s %10s %5s %8s %s\n"; -# Descriptions: show articles as HTML in this thread -# Arguments: $self $str +# Descriptions: show articles as text in this thread +# Arguments: OBJ($self) STR($thread_id) # Side Effects: none # Return Value: none sub show_articles_in_thread @@ -49,7 +68,7 @@ sub show_articles_in_thread # Descriptions: show guide line -# Arguments: $self $args +# Arguments: OBJ($self) HASH_REF($args) # Side Effects: none # Return Value: none sub __start_thread_summary @@ -64,7 +83,7 @@ sub __start_thread_summary # Descriptions: print formated brief summary -# Arguments: $self $args +# Arguments: OBJ($self) HASH_REF($args) # Side Effects: none # Return Value: none sub __print_thread_summary @@ -83,9 +102,9 @@ sub __print_thread_summary } -# Descriptions: -# Arguments: $self $args -# Side Effects: +# Descriptions: print closing string, empty now +# Arguments: OBJ($self) HASH_REF($args) +# Side Effects: none # Return Value: none sub __end_thread_summary { @@ -95,9 +114,9 @@ sub __end_thread_summary # Descriptions: create a string of "a b c .." style up to $num bytes -# Arguments: $num $str +# Arguments: NUM($num) STR($str) # Side Effects: none -# Return Value: string +# Return Value: STR sub _format_list { my ($max, $str) = @_; @@ -117,7 +136,7 @@ sub _format_list # Descriptions: print message summary -# Arguments: $self $args +# Arguments: OBJ($self) STR($thread_id) # Side Effects: none # Return Value: none sub __print_message_summary @@ -157,10 +176,11 @@ sub __print_message_summary } -# Descriptions: ( broken now ;-) -# Arguments: $string +# Descriptions: for example, cost -> '!!!' +# broken now ;-) +# Arguments: STR($cost) # Side Effects: none -# Return Value: string +# Return Value: STR sub _cost_to_indicator { my ($cost) = @_; @@ -176,4 +196,25 @@ sub _cost_to_indicator } +=head1 CODING STYLE + +See C<http://www.fml.org/software/FNF/> on fml coding style guide. + +=head1 AUTHOR + +Ken'ichi Fukamachi + +=head1 COPYRIGHT + +Copyright (C) 2001,2002 Ken'ichi Fukamachi + +All rights reserved. This program is free software; you can +redistribute it and/or modify it under the same terms as Perl itself. + +=head1 HISTORY + +Mail::ThreadTrack::Print::Text appeared in fml5 mailing list driver package. +See C<http://www.fml.org/> for more details. + + 1; diff --git a/fml/lib/Mail/ThreadTrack/Print/Utils.pm b/fml/lib/Mail/ThreadTrack/Print/Utils.pm index 98cd0183..be2250a5 100644 --- a/fml/lib/Mail/ThreadTrack/Print/Utils.pm +++ b/fml/lib/Mail/ThreadTrack/Print/Utils.pm @@ -1,10 +1,10 @@ #-*- perl -*- # -# Copyright (C) 2001 Ken'ichi Fukamachi +# Copyright (C) 2001,2002 Ken'ichi Fukamachi # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Utils.pm,v 1.1 2001/11/09 10:37:06 fukachan Exp $ +# $FML: Utils.pm,v 1.2 2001/12/22 09:21:21 fukachan Exp $ # package Mail::ThreadTrack::Print::Utils; @@ -17,7 +17,21 @@ require Exporter; @EXPORT_OK = qw(decode_mime_string STR2EUC); -=head2 C<decode_mime_string(string, [$options])> +=head1 NAME + +Mail::ThreadTrack::Print::Utils - utility functions + +=head1 SYNOPSIS + + use Mail::ThreadTrack::Print::Utils qw(decode_mime_string STR2EUC); + +=head1 DESCRIPTION + +utility functions to manipulate Japanese string. + +=head1 METHODS + +=head2 decode_mime_string(string, [$options]) decode a base64/quoted-printable encoded string to a plain message. The encoding method is automatically detected. @@ -26,22 +40,30 @@ C<$options> is a HASH REFERENCE. You can specify the charset of the string to return by $options->{ charset }. +=head2 STR2EUC(str) + +convert str to Japanese EUC. + =cut +# Descriptions: decode $str +# Arguments: STR($str) HASH_REF($options) +# Side Effects: none +# Return Value: STR sub decode_mime_string { my ($str, $options) = @_; my $charset = $options->{ 'charset' } || 'euc-japan'; if ($charset eq 'euc-japan') { - use MIME::Base64; if ($str =~ /=\?ISO\-2022\-JP\?B\?(\S+\=*)\?=/i) { + eval q{ use MIME::Base64; }; $str =~ s/=\?ISO\-2022\-JP\?B\?(\S+\=*)\?=/decode_base64($1)/gie; } - use MIME::QuotedPrint; if ($str =~ /=\?ISO\-2022\-JP\?Q\?(\S+\=*)\?=/i) { + eval q{ use MIME::QuotedPrint;}; $str =~ s/=\?ISO\-2022\-JP\?Q\?(\S+\=*)\?=/decode_qp($1)/gie; } } @@ -52,6 +74,10 @@ sub decode_mime_string } +# Descriptions: convert $str to Japanese EUC +# Arguments: STR($str) +# Side Effects: none +# Return Value: STR sub STR2EUC { my ($str) = @_; @@ -62,4 +88,27 @@ sub STR2EUC } +=head1 CODING STYLE + +See C<http://www.fml.org/software/FNF/> on fml coding style guide. + +=head1 AUTHOR + +Ken'ichi Fukamachi + +=head1 COPYRIGHT + +Copyright (C) 2001,2002 Ken'ichi Fukamachi + +All rights reserved. This program is free software; you can +redistribute it and/or modify it under the same terms as Perl itself. + +=head1 HISTORY + +Mail::ThreadTrack::Print::Utils appeared in fml5 mailing list driver package. +See C<http://www.fml.org/> for more details. + +=cut + + 1; |
