Changeset 32305 for main/trunk/greenstone2/perllib
- Timestamp:
- 2018-07-27T18:31:59+12:00 (6 years ago)
- Location:
- main/trunk/greenstone2/perllib/plugins
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugins/PDFv2Plugin.pm
r32303 r32305 31 31 no strict 'subs'; # allow filehandles to be variables and viceversa 32 32 33 use ConvertBinaryFile; 34 use PDFBoxConverter; 33 35 use ReadTextFile; 36 34 37 use unicode; 35 38 use Mojo::DOM; # for HTML parsing 36 39 37 use PDFBoxConverter;38 use ConvertBinaryFile;39 40 40 41 @PDFv2Plugin::ISA = ('ConvertBinaryFile', 'PDFBoxConverter', 'ReadTextFile'); … … 124 125 push(@{$hashArgOptLists->{"OptList"}},$options); 125 126 126 my $pdfbox_converter_self = new PDFBoxConverter($pluginlist, $inputargs, $hashArgOptLists); 127 # the 1 at the end of the first constructor call is to allow extra arguments to remain after 128 # parsing. There should be no extra args after the final constructor call, because all args 129 # should have been parsed by then, so don't pass 1 to the last constructor. 130 my $pdfbox_converter_self = new PDFBoxConverter($pluginlist, $inputargs, $hashArgOptLists, 1); 127 131 my $cbf_self = new ConvertBinaryFile($pluginlist, $inputargs, $hashArgOptLists); 128 132 my $self = BaseImporter::merge_inheritance($pdfbox_converter_self, $cbf_self); # this param order seems necessary to preserve the default/user-selected value for the convert_to option -
main/trunk/greenstone2/perllib/plugins/UnknownConverterPlugin.pm
r32028 r32305 95 95 push(@{$hashArgOptLists->{"OptList"}},$options); 96 96 97 my $unknown_converter_self = new UnknownPlugin($pluginlist, $inputargs, $hashArgOptLists );97 my $unknown_converter_self = new UnknownPlugin($pluginlist, $inputargs, $hashArgOptLists, 1); 98 98 my $cbf_self = new ConvertBinaryFile($pluginlist, $inputargs, $hashArgOptLists); 99 99 … … 104 104 $self = bless $self, $class; 105 105 106 my $outhandle = $self->{'outhandle'}; 107 if(!defined $self->{'convert_to'}) { 108 $self->{'convert_to'} = "text"; # why do I have to set a value for convert_to here, when a default's already set in $convert_to_list declaration???? 109 } 110 #print STDERR "\n\n**** convert_to is |" . $self->{'convert_to'} . "|\n\n"; 106 if ($self->{'info_only'}) { 107 108 # If running pluginfo, we don't need to go further. Copied from other plugins like PDFPlug 109 # Returning here when running pluginfo also means that it doesn't matter that convert_to 110 # is not yet set to its default value at this stage: no warnings at gli start (when pluginfo 111 # is run) about convert_to being undefined 112 113 # don't worry about any options etc 114 return $self; 115 } 116 117 my $outhandle = $self->{'outhandle'}; 111 118 112 119 # Convert_To set up, including secondary_plugins for processing the text or html generated
Note:
See TracChangeset
for help on using the changeset viewer.