/[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 23 by dpavlin, Sat May 8 02:21:50 2004 UTC revision 27 by dpavlin, Sat May 8 20:34:26 2004 UTC
# 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 330  sub plain_text_body { Line 334  sub plain_text_body {
334                  }                  }
335          }          }
336    
337            if (! $body) {
338                    $body = "[plain/text body not found]" if ($debug == 2);
339                    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) {
                 $body =~ s/[\r\n]/\n/gs;  
346                  $body = autoformat($body, {right=>$wrap, all=>1});                  $body = autoformat($body, {right=>$wrap, all=>1});
347                  $body .="\n[reformated using autoformat, margin at $wrap]" if ($debug == 2);                  $body .="\n[reformated using autoformat, margin at $wrap]" if ($debug == 2);
348          }          }

Legend:
Removed from v.23  
changed lines
  Added in v.27

  ViewVC Help
Powered by ViewVC 1.1.26