Changeset 7904 for trunk/gsdl/perllib/plugin.pm
- Timestamp:
- 2004-08-06T16:38:44+12:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugin.pm
r7829 r7904 83 83 } 84 84 $options =~ s/\$/\\\$/g; 85 85 86 86 eval ("\$plugobj = new \$pluginname($options)"); 87 87 die "$@" if $@; … … 100 100 sub begin { 101 101 my ($pluginfo, $base_dir, $processor, $maxdocs) = @_; 102 102 103 103 104 map { $_->begin($pluginfo, $base_dir, $processor, $maxdocs); } @$pluginfo; … … 106 107 sub read { 107 108 my ($pluginfo, $base_dir, $file, $metadata, $processor, $maxdocs, $gli, $aux) = @_; 109 108 110 109 111 $maxdocs = -1 unless defined $maxdocs && $maxdocs =~ /\d/; 110 112 $gli = 0 unless defined $gli; 111 113 114 112 115 my $rv = 0; 113 116 my $glifile = $file; 117 114 118 $glifile =~ s/^[\/\\]+//; # file sometimes starts with a / so get rid of it 115 119 # Announce to GLI that we are handling a file 116 120 print STDERR "<File n='$glifile'>\n" if $gli; 117 121 122 118 123 # the .kill file is a handy (if not very elegant) way of aborting 119 124 # an import.pl or buildcol.pl process … … 134 139 $rv = $plugobj->read($pluginfo, $base_dir, $file, 135 140 $metadata, $processor, $maxdocs, $gli, $aux); 136 141 if (defined $rv) { 137 142 if ($rv == -1) { 138 143 # an error has occurred 139 144 $had_error = 1; 140 145 print STDERR "<ProcessingError n='$glifile'>\n" if $gli; 141 146 } else { 142 147 return $rv; 143 148 } 144 149 } # else undefined - was not recognised by the plugin 145 150 } 146 151 147 152 if ($had_error) { 148 153 # was recognised but couldn't be processed … … 152 157 # tell the GLI that it was not processed 153 158 print STDERR "<NonProcessedFile n='$glifile'>\n" if $gli; 154 159 155 160 $file =~ s/.*?([^\\\/]+)$/$1/; 156 161 gsprintf($failhandle, "$file: {plugin.no_plugin_could_process_this_file}\n");
Note:
See TracChangeset
for help on using the changeset viewer.