Changeset 5682 for trunk/gsdl/perllib/plugin.pm
- Timestamp:
- 2003-10-20T15:08:01+13:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugin.pm
r3402 r5682 27 27 28 28 require util; 29 use gsprintf; 29 30 30 31 my $stats = {'num_processed' => 0, … … 33 34 'num_archives' => 0 34 35 }; 36 37 38 sub gsprintf 39 { 40 return &gsprintf::gsprintf(@_); 41 } 42 35 43 36 44 sub load_plugins { … … 54 62 if (-e $colplugname) { require $colplugname; } 55 63 elsif (-e $mainplugname) { require $mainplugname; } 56 else { die "ERROR - couldn't find plugin \"$pluginname\"\n"; } 64 else { &gsprintf(STDERR, "{plugin.could_not_find_plugin}\n", $pluginname) && die "\n"; 65 # die "ERROR - couldn't find plugin \"$pluginname\"\n"; 66 } 57 67 58 68 # create a plugin object … … 90 100 # an import.pl or buildcol.pl process 91 101 if (-e &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, ".kill")) { 92 print $outhandle "Process killed by .kill file\n"; 102 &gsprintf($outhandle, "{plugin.kill_file}\n"); 103 # print $outhandle "Process killed by .kill file\n"; 93 104 die "\n"; 94 105 } … … 103 114 104 115 if ($verbosity >= 2) { 105 print $outhandle "WARNING - no plugin could process $file\n"; 116 &gsprintf($outhandle, "{plugin.no_plugin_could_process}\n", $file); 117 # print $outhandle "WARNING - no plugin could process $file\n"; 106 118 } 107 119 108 120 $file =~ s/.*?([^\\\/]+)$/$1/; 109 print $failhandle "$file: no plugin could process this file\n"; 121 &gsprintf($failhandle, "$file: {plugin.no_plugin_could_process_this_file}\n"); 122 # print $failhandle "$file: no plugin could process this file\n"; 110 123 $stats->{'num_not_processed'} ++; 111 124 … … 127 140 128 141 if ($total == 1) { 129 print $statshandle "* 1 document was considered for processing\n"; 142 &gsprintf($statshandle, "* {plugin.one_considered}\n"); 143 # print $statshandle "* 1 document was considered for processing\n"; 130 144 } else { 131 print $statshandle "* $total documents were considered for processing\n"; 145 &gsprintf($statshandle, "* {plugin.n_considered}\n", $total); 146 # print $statshandle "* $total documents were considered for processing\n"; 132 147 } 133 148 if ($stats->{'num_archives'}) { 134 print $statshandle " (including the contents of " . $stats->{'num_archives'} . 135 " ZIP/TAR archive"; 136 if ($stats->{'num_archives'} == 1) {print $statshandle ")\n";} 137 else {print $statshandle "s)\n";} 149 # print $statshandle " (including the contents of " . $stats->{'num_archives'} . 150 # " ZIP/TAR archive"; 151 if ($stats->{'num_archives'} == 1) { 152 &gsprintf($statshandle, " ({plugin.including_archive})\n"); 153 # print $statshandle ")\n";} 154 } 155 else { 156 &gsprintf($statshandle, " ({plugin.including_archives})\n", $stats->{'num_archives'}); 157 # print $statshandle "s)\n";} 158 } 138 159 } 139 160 if ($stats->{'num_processed'} == 1) { 140 print $statshandle "* 1 was processed and included in the collection\n"; 161 &gsprintf($statshandle, "* {plugin.one_included}\n"); 162 # print $statshandle "* 1 was processed and included in the collection\n"; 141 163 } else { 142 print $statshandle "* " . $stats->{'num_processed'} . " were processed and included in the collection\n"; 164 &gsprintf($statshandle, "* {plugin.n_included}\n", $stats->{'num_processed'}); 165 # print $statshandle "* " . $stats->{'num_processed'} . " were processed and included in the collection\n"; 143 166 } 144 167 if ($stats->{'num_not_processed'}) { 145 168 if ($stats->{'num_not_processed'} == 1) { 146 print $statshandle "* 1 was rejected."; 169 &gsprintf($statshandle, "* {plugin.one_rejected}\n"); 170 # print $statshandle "* 1 was rejected."; 147 171 } else { 148 print $statshandle "* " . $stats->{'num_not_processed'} . " were rejected."; 149 } 150 print $statshandle " See $faillog for a list of rejected documents\n"; 172 &gsprintf($statshandle, "* {plugin.n_rejected}\n", $stats->{'num_not_processed'}); 173 # print $statshandle "* " . $stats->{'num_not_processed'} . " were rejected."; 174 } 175 &gsprintf($statshandle, " {plugin.see_faillog}\n", $faillog); 176 # print $statshandle " See $faillog for a list of rejected documents\n"; 151 177 } 152 178 }
Note:
See TracChangeset
for help on using the changeset viewer.