Changeset 10425


Ignore:
Timestamp:
2005-08-05T15:13:10+12:00 (19 years ago)
Author:
chi
Message:

Modification of the way passing argument and option lists for the secondary plugin.

Location:
trunk/gsdl/perllib/plugins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/PSPlug.pm

    r10274 r10425  
    7373    push(@$inputargs,"-title_sub");
    7474    push(@$inputargs,'^(Page\s+\d+)?(\s*1\s+)?');
    75 
     75   
    7676    if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
    7777    if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
    78 
     78   
    7979    my $self = (defined $hashArgOptLists)? new ConvertToPlug($pluginlist,$inputargs,$hashArgOptLists): new ConvertToPlug($pluginlist,$inputargs);
    80 
    8180
    8281    my $secondary_plugin_options = $self->{'secondary_plugin_options'};
     
    9291    #$self->{'input_encoding'} = "utf8";
    9392    #$self->{'extract_language'} = 1;
    94     #push(@$text_options, "-input_encoding", "utf8");
    95     #push(@$text_options,"-extract_language");
     93    push(@$text_options, "-input_encoding", "utf8");
     94    push(@$text_options,"-extract_language");
    9695    push(@$text_options , "-title_sub", '^(Page\s+\d+)?(\s*1\s+)?');
    9796
    9897    $self = bless $self, $class;
    9998
    100     $self->load_secondary_plugins($class,$secondary_plugin_options);
     99    $self->load_secondary_plugins($class,$secondary_plugin_options, $hashArgOptLists);
    101100
    102101    return $self;
     
    124123   
    125124    my ($language, $encoding) = $self->textcat_get_language_encoding ($conv_filename);
    126    
    127 #    print STDERR "*** Plug encoding = $encoding\n";
    128125   
    129126    # read in file ($text will be in utf8)
     
    134131    unicode::ensure_utf8(\$text);
    135132   
    136     #print STDERR "*** Text =$text\n";
    137133    # Write it out again!
    138134    $self->utf8_write_file (\$text, $conv_filename);
  • trunk/gsdl/perllib/plugins/RTFPlug.pm

    r10272 r10425  
    5757    if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
    5858    if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
     59 
     60    my $self = (defined $hashArgOptLists)? new ConvertToPlug($pluginlist,$inputargs,$hashArgOptLists): new ConvertToPlug($pluginlist,$inputargs);
    5961
    60     my $self = (defined $hashArgOptLists)? new ConvertToPlug($pluginlist,$inputargs,$hashArgOptLists): new ConvertToPlug($pluginlist,$inputargs);
     62    my $secondary_plugin_options = $self->{'secondary_plugin_options'};
     63    if (!defined $secondary_plugin_options->{'TEXTPlug'}) {
     64    $secondary_plugin_options->{'TEXTPlug'} = [];
     65    }
     66    if (!defined $secondary_plugin_options->{'HTMLPlug'}) {
     67    $secondary_plugin_options->{'HTMLPlug'} = [];
     68    }
     69    my $text_options = $secondary_plugin_options->{'TEXTPlug'};
     70    my $html_options = $secondary_plugin_options->{'HTMLPlug'};
     71   
     72    #$self->{'input_encoding'} = "utf8";
     73    #$self->{'extract_language'} = 1;
     74    push(@$text_options, "-input_encoding", "utf8");
     75    push(@$text_options,"-extract_language");
     76   
    6177
    6278    $self = bless $self, $class;
    6379
    64     my $secondary_plugin_options = $self->{'secondary_plugin_options'};
    65     $self->load_secondary_plugins($class,$secondary_plugin_options);
     80    $self->load_secondary_plugins($class,$secondary_plugin_options, $hashArgOptLists);
    6681
    6782    return $self;
Note: See TracChangeset for help on using the changeset viewer.