Ignore:
Timestamp:
2017-06-29T19:50:02+12:00 (7 years ago)
Author:
ak19
Message:
  1. Refactored ConvertBinaryFile:tmp_area_convert_file() to do the conversion command (final portion of the function) in a separate subroutine, the new run_conversion_command(), so that the new subclass UnknownConverterPlugin can override this method. 2. UnknownConverterPlugin currently does the unique portions of its previously overridden tmp_area_convert_file() in the new run_conversion_command() that it now overrides, since it inherits all of tmp_area_convert_file(). 3. Removed currently unused overridden read() method. Also removed some other unwanted things.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/ConvertBinaryFile.pm

    r31761 r31766  
    263263    my $ensure_path_absolute = 1; # true
    264264    &FileUtils::softLink($input_filename, $tmp_filename, $ensure_path_absolute);
     265
     266    my $output_filename = $self->run_conversion_command($tmp_dirname, $tmp_filename,
     267                            $utf8_tailname, $lc_suffix, $tailname, $suffix);
     268
     269    return $output_filename;
     270}
     271
     272# The latter half of tmp_area_convert_file: runs the conversion command and returns the output file name
     273# Split from tmp_area_convert_file because UnknownConverterPlugin can then inherit all of
     274# tmp_area_convert_file and only needs to override this part:
     275sub run_conversion_command {
     276    my $self = shift (@_);
     277    my ($tmp_dirname, $tmp_filename, $utf8_tailname, $lc_suffix, $tailname, $suffix) = @_;   
     278
     279    my $outhandle = $self->{'outhandle'};
     280    my $convert_to = $self->{'convert_to'};
     281    my $failhandle = $self->{'failhandle'};
     282
    265283    my $verbosity = $self->{'verbosity'};
    266284    if ($verbosity > 0) {
Note: See TracChangeset for help on using the changeset viewer.