Ignore:
Timestamp:
2003-12-19T15:16:29+13:00 (20 years ago)
Author:
jmt12
Message:

When -gli argument is provided to calling script these modules will now output gli specific, non-language nor verbosity specific, messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugin.pm

    r5682 r6332  
    9292
    9393sub read {
    94     my ($pluginfo, $base_dir, $file, $metadata, $processor, $maxdocs, $aux) = @_;
     94    my ($pluginfo, $base_dir, $file, $metadata, $processor, $maxdocs, $gli, $aux) = @_;
    9595
    9696    $maxdocs = -1 unless defined $maxdocs && $maxdocs =~ /\d/;
     97    $gli = 0 unless defined $gli;
     98
    9799    my $rv = 0;
     100
     101    # Announce to GLI that we are handling a file
     102    print STDERR "<File n='$file'>\n" if $gli;
    98103
    99104    # the .kill file is a handy (if not very elegant) way of aborting
     
    109114    foreach $plugobj (@$pluginfo) {
    110115    $rv = $plugobj->read($pluginfo, $base_dir, $file,
    111                  $metadata, $processor, $maxdocs, $aux);
     116                 $metadata, $processor, $maxdocs, $gli, $aux);
    112117    return $rv if defined $rv;
    113118    }
     
    130135# are only output after import.pl -
    131136sub write_stats {
    132     my ($pluginfo, $statshandle, $faillog) = @_;
     137    my ($pluginfo, $statshandle, $faillog, $gli) = @_;
     138
     139    $gli = 0 unless defined $gli;
    133140
    134141    foreach $plugobj (@$pluginfo) {
     
    138145    my $total = $stats->{'num_processed'} + $stats->{'num_blocked'} +
    139146    $stats->{'num_not_processed'};
     147
     148    print STDERR "<ImportComplete c='$stats->{'num_processed'}' p='$stats->{'num_processed'}'>\n" if $gli;
    140149
    141150    if ($total == 1) {
Note: See TracChangeset for help on using the changeset viewer.