Changeset 31492 for main/trunk/greenstone2/perllib/plugins/CommonUtil.pm
- Timestamp:
- 2017-03-13T11:12:37+13:00 (7 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugins/CommonUtil.pm
r31491 r31492 1 1 ########################################################################### 2 2 # 3 # EncodingUtil.pm -- base class for file and directory plugins - aims to4 # handle all encoding stuff, to keep it in one place3 # CommonUtil.pm -- base class for file and directory plugins - aims to 4 # handle all encoding stuff, blocking stuff, to keep it in one place 5 5 # A component of the Greenstone digital library software 6 6 # from the New Zealand Digital Library Project at the … … 25 25 ########################################################################### 26 26 27 package EncodingUtil;27 package CommonUtil; 28 28 29 29 use strict; … … 39 39 40 40 BEGIN { 41 @ EncodingUtil::ISA = ( 'PrintInfo' );41 @CommonUtil::ISA = ( 'PrintInfo' ); 42 42 } 43 43 44 44 our $encoding_list = 45 45 [ { 'name' => "ascii", 46 'desc' => "{Base Plugin.encoding.ascii}" },46 'desc' => "{BaseImporter.encoding.ascii}" }, 47 47 { 'name' => "utf8", 48 'desc' => "{Base Plugin.encoding.utf8}" },48 'desc' => "{BaseImporter.encoding.utf8}" }, 49 49 { 'name' => "unicode", 50 'desc' => "{Base Plugin.encoding.unicode}" } ];50 'desc' => "{BaseImporter.encoding.unicode}" } ]; 51 51 52 52 … … 63 63 our $encoding_plus_auto_list = 64 64 [ { 'name' => "auto", 65 'desc' => "{Base Plugin.filename_encoding.auto}" },65 'desc' => "{BaseImporter.filename_encoding.auto}" }, 66 66 { 'name' => "auto-language-analysis", 67 'desc' => "{Base Plugin.filename_encoding.auto_language_analysis}" }, # textcat67 'desc' => "{BaseImporter.filename_encoding.auto_language_analysis}" }, # textcat 68 68 { 'name' => "auto-filesystem-encoding", 69 'desc' => "{Base Plugin.filename_encoding.auto_filesystem_encoding}" }, # locale69 'desc' => "{BaseImporter.filename_encoding.auto_filesystem_encoding}" }, # locale 70 70 { 'name' => "auto-fl", 71 'desc' => "{Base Plugin.filename_encoding.auto_fl}" }, # locale followed by textcat71 'desc' => "{BaseImporter.filename_encoding.auto_fl}" }, # locale followed by textcat 72 72 { 'name' => "auto-lf", 73 'desc' => "{Base Plugin.filename_encoding.auto_lf}" } ]; # texcat followed by locale73 'desc' => "{BaseImporter.filename_encoding.auto_lf}" } ]; # texcat followed by locale 74 74 75 75 push(@{$encoding_plus_auto_list},@{$encoding_list}); … … 77 77 my $arguments = 78 78 [ { 'name' => "block_exp", 79 'desc' => "{Base Plugin.block_exp}",79 'desc' => "{BaseImporter.block_exp}", 80 80 'type' => "regexp", 81 81 'deft' => "", 82 82 'reqd' => "no" }, 83 83 { 'name' => "no_blocking", 84 'desc' => "{Base Plugin.no_blocking}",84 'desc' => "{BaseImporter.no_blocking}", 85 85 'type' => "flag", 86 86 'reqd' => "no"}, 87 87 { 'name' => "filename_encoding", 88 'desc' => "{Base Plugin.filename_encoding}",88 'desc' => "{BaseImporter.filename_encoding}", 89 89 'type' => "enum", 90 90 'deft' => "auto", … … 93 93 ]; 94 94 95 my $options = { 'name' => " EncodingUtil",96 'desc' => "{ EncodingUtil.desc}",95 my $options = { 'name' => "CommonUtil", 96 'desc' => "{CommonUtil.desc}", 97 97 'abstract' => "yes", 98 98 'inherits' => "no", … … 140 140 my $filename_encoding = $self->guess_filesystem_encoding(); 141 141 142 # copied this from set_Source_metadata in Base Plugin142 # copied this from set_Source_metadata in BaseImporter 143 143 if ((defined $filename_encoding) && ($filename_encoding ne "ascii")) { 144 144 # Use filename_encoding to map raw filename to a Perl unicode-aware string … … 267 267 my $outhandle = $self->{'outhandle'}; 268 268 269 print $outhandle "****!!!!**** Base Plugin::filename_to_utf8_metadata now deprecated\n";269 print $outhandle "****!!!!**** BaseImporter::filename_to_utf8_metadata now deprecated\n"; 270 270 my ($cpackage,$cfilename,$cline,$csubr,$chas_args,$cwantarray) = caller(0); 271 271 print $outhandle "Calling method: $cfilename:$cline $cpackage->$csubr\n"; … … 363 363 { 364 364 if ($self->{'verbosity'}) { 365 gsprintf($outhandle, "Base Plugin: {ReadTextFile.unsupported_encoding}\n", $text, $best_encoding, "undef");365 gsprintf($outhandle, "BaseImporter: {ReadTextFile.unsupported_encoding}\n", $text, $best_encoding, "undef"); 366 366 } 367 367 $best_encoding = undef;
Note:
See TracChangeset
for help on using the changeset viewer.