Ignore:
Timestamp:
2004-08-06T16:38:44+12:00 (20 years ago)
Author:
chi
Message:

Minor changes to layout of code.

File:
1 edited

Legend:

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

    r7829 r7904  
    8383    }
    8484    $options =~ s/\$/\\\$/g;
    85    
     85
    8686    eval ("\$plugobj = new \$pluginname($options)");
    8787    die "$@" if $@;
     
    100100sub begin {
    101101    my ($pluginfo, $base_dir, $processor, $maxdocs) = @_;
     102   
    102103
    103104    map { $_->begin($pluginfo, $base_dir, $processor, $maxdocs); } @$pluginfo;
     
    106107sub read {
    107108    my ($pluginfo, $base_dir, $file, $metadata, $processor, $maxdocs, $gli, $aux) = @_;
     109 
    108110
    109111    $maxdocs = -1 unless defined $maxdocs && $maxdocs =~ /\d/;
    110112    $gli = 0 unless defined $gli;
    111113
     114 
    112115    my $rv = 0;
    113116    my $glifile = $file;
     117   
    114118    $glifile =~ s/^[\/\\]+//; # file sometimes starts with a / so get rid of it
    115119    # Announce to GLI that we are handling a file
    116120    print STDERR "<File n='$glifile'>\n" if $gli;
    117121
     122 
    118123    # the .kill file is a handy (if not very elegant) way of aborting
    119124    # an import.pl or buildcol.pl process
     
    134139    $rv = $plugobj->read($pluginfo, $base_dir, $file,
    135140                 $metadata, $processor, $maxdocs, $gli, $aux);
    136     if (defined $rv) {
     141        if (defined $rv) {
    137142        if ($rv == -1) {
    138         # an error has occurred
     143            # an error has occurred
    139144        $had_error = 1;
    140145        print STDERR "<ProcessingError n='$glifile'>\n" if $gli;
    141146        } else {
    142         return $rv;
     147            return $rv;
    143148        }
    144149    } # else undefined - was not recognised by the plugin
    145150    }
    146    
     151
    147152    if ($had_error) {
    148153    # was recognised but couldn't be processed
     
    152157    # tell the GLI that it was not processed
    153158    print STDERR "<NonProcessedFile n='$glifile'>\n" if $gli;
    154    
     159     
    155160    $file =~ s/.*?([^\\\/]+)$/$1/;
    156161    gsprintf($failhandle, "$file: {plugin.no_plugin_could_process_this_file}\n");
Note: See TracChangeset for help on using the changeset viewer.