/[mws]/trunk/MWS.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/MWS.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 25 by dpavlin, Sat May 8 16:06:58 2004 UTC revision 30 by dpavlin, Sun May 9 00:09:32 2004 UTC
# Line 31  our $VERSION = '1.00'; Line 31  our $VERSION = '1.00';
31    
32  my $folder;     # placeholder for folders  my $folder;     # placeholder for folders
33    
34  my $debug = 2;  my $debug = 1;
35    
36  sub new {  sub new {
37          my $class = shift;          my $class = shift;
# Line 42  sub new { Line 42  sub new {
42    
43          $self->{config} = new Config::IniFiles( -file => $config_file );          $self->{config} = new Config::IniFiles( -file => $config_file );
44    
45          my $index_file = $self->{config}->val('global', 'index') || croak "can't find [index] section in config file with path of index";          $self->{config_file} = $config_file;
46            $config_file =~ s/\.conf.*$//;
47            $self->{config_name} = $config_file;
48    
49            my $index_dir = $self->{config}->val('global', 'index') || croak "can't find [index] section in config file with path of index";
50    
51          $self->{mgr} = Mail::Box::Manager->new(access => 'r');          $self->{mgr} = Mail::Box::Manager->new(access => 'r');
52          $self->{index_file} = $index_file;          $self->{index_dir} = $index_dir;
53    
54          # placeholder for opened folders          # placeholder for opened folders
55          $self->{folder} = {};          $self->{folder} = {};
# Line 112  sub fmtdate { Line 116  sub fmtdate {
116                  push @out, sprintf($f, $v);                  push @out, sprintf($f, $v);
117          }          }
118    
119  print STDERR "fmtdate: ",join('|',@out),"\n";          print STDERR "fmtdate: ",join('|',@out),"\n" if ($debug == 2);
120    
121          return (wantarray ? @out : join("-",@out));          return (wantarray ? @out : join("-",@out));
122  }  }
# Line 331  sub plain_text_body { Line 335  sub plain_text_body {
335          }          }
336    
337          if (! $body) {          if (! $body) {
338                  $body = "[body of this message not found]\n" if ($debug == 2);                  $body = "[plain/text body not found]" if ($debug == 2);
339                  $body .= $message->decoded->string;                  print STDERR "plain/text body not found\n" if ($debug);
340                    return;
341          }          }
342    
343          # reformat with Text::Autoformat          # reformat with Text::Autoformat
344          my $wrap = $self->{wrap_margin};          my $wrap = $self->{wrap_margin};
345          if ($wrap && $body && $body =~ m/^.{$wrap}..*$/m) {          if ($wrap && $body && $body =~ m/^.{$wrap}..*$/m) {
346                  $body = autoformat($body, {right=>$wrap, all=>1});                  $body = autoformat($body, {right=>$wrap, all=>1});
                 print "reformatted [$wrap]:\n$body\n" if ($debug == 2);  
347                  $body .="\n[reformated using autoformat, margin at $wrap]" if ($debug == 2);                  $body .="\n[reformated using autoformat, margin at $wrap]" if ($debug == 2);
348          }          }
349    

Legend:
Removed from v.25  
changed lines
  Added in v.30

  ViewVC Help
Powered by ViewVC 1.1.26