Changeset 2785 for trunk/gsdl/perllib/plugins/BasPlug.pm
- Timestamp:
- 2001-10-09T17:21:29+13:00 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/BasPlug.pm
r2755 r2785 142 142 143 143 $self->{'textcat'} = new textcat(); 144 145 $self->{'num_processed'} = 0; 146 $self->{'num_not_processed'} = 0; 147 $self->{'num_blocked'} = 0; 148 $self->{'num_archives'} = 0; 144 149 145 150 # general options available to all plugins … … 175 180 sub init { 176 181 my $self = shift (@_); 177 my ($verbosity, $outhandle, $fail logname) = @_;182 my ($verbosity, $outhandle, $failhandle) = @_; 178 183 179 184 # verbosity is passed through from the processor 180 185 $self->{'verbosity'} = $verbosity; 181 186 182 # as is the outhandle ...187 # as are the outhandle and failhandle 183 188 $self->{'outhandle'} = $outhandle if defined $outhandle; 184 $self->{'fail logname'} = $faillogname;189 $self->{'failhandle'} = $failhandle; 185 190 186 191 # set process_exp and block_exp to defaults unless they were … … 258 263 259 264 my $filename = &util::filename_cat($base_dir, $file); 260 return 0 if $self->{'block_exp'} ne "" && $filename =~ /$self->{'block_exp'}/; 265 if ($self->{'block_exp'} ne "" && $filename =~ /$self->{'block_exp'}/) { 266 $self->{'num_blocked'} ++; 267 return 0; 268 } 261 269 if ($filename !~ /$self->{'process_exp'}/ || !-f $filename) { 262 270 return undef; … … 298 306 if (!length ($text)) { 299 307 print $outhandle "$plugin_name: ERROR: $file contains no text\n" if $self->{'verbosity'}; 308 309 my $failhandle = $self->{'failhandle'}; 310 print $failhandle "$file: " . ref($self) . ": file contains no text\n"; 311 $self->{'num_not_processed'} ++; 312 300 313 return 0; 301 314 } … … 316 329 # process the document 317 330 $processor->process($doc_obj); 331 332 $self->{'num_processed'} ++; 318 333 319 334 return 1; # processed the file … … 671 686 } 672 687 688 sub compile_stats { 689 my $self = shift(@_); 690 my ($stats) = @_; 691 692 $stats->{'num_processed'} += $self->{'num_processed'}; 693 $stats->{'num_not_processed'} += $self->{'num_not_processed'}; 694 695 } 696 697 673 698 1;
Note:
See TracChangeset
for help on using the changeset viewer.