Ignore:
Timestamp:
2004-12-01T16:14:11+13:00 (19 years ago)
Author:
kjdon
Message:

added some changes made by Emanuel Dejanu (Simple Words)

File:
1 edited

Legend:

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

    r8678 r8716  
    143143sub get_arguments
    144144{
    145     local $self = shift(@_);
    146     local $optionlistref = $self->{'option_list'};
    147     local @optionlist = @$optionlistref;
    148     local $pluginoptions = pop(@$optionlistref);
    149     local $pluginarguments = $pluginoptions->{'args'};
     145    my $self = shift(@_);
     146    my $optionlistref = $self->{'option_list'};
     147    my @optionlist = @$optionlistref;
     148    my $pluginoptions = pop(@$optionlistref);
     149    my $pluginarguments = $pluginoptions->{'args'};
    150150    return $pluginarguments;
    151151}
     
    154154sub print_xml_usage
    155155{
    156     local $self = shift(@_);
     156    my $self = shift(@_);
    157157
    158158    # XML output is always in UTF-8
     
    166166sub print_xml
    167167{
    168     local $self = shift(@_);
    169 
    170     local $optionlistref = $self->{'option_list'};
    171     local @optionlist = @$optionlistref;
    172     local $pluginoptions = pop(@$optionlistref);
     168    my $self = shift(@_);
     169
     170    my $optionlistref = $self->{'option_list'};
     171    my @optionlist = @$optionlistref;
     172    my $pluginoptions = pop(@$optionlistref);
    173173    return if (!defined($pluginoptions));
    174174
     
    197197sub print_txt_usage
    198198{
    199     local $self = shift(@_);
     199    my $self = shift(@_);
    200200
    201201    # Print the usage message for a plugin (recursively)
    202     local $descoffset = $self->determine_description_offset(0);
     202    my $descoffset = $self->determine_description_offset(0);
    203203    $self->print_plugin_usage($descoffset, 1);
    204204}
     
    207207sub determine_description_offset
    208208{
    209     local $self = shift(@_);
    210     local $maxoffset = shift(@_);
    211 
    212     local $optionlistref = $self->{'option_list'};
    213     local @optionlist = @$optionlistref;
    214     local $pluginoptions = pop(@$optionlistref);
     209    my $self = shift(@_);
     210    my $maxoffset = shift(@_);
     211
     212    my $optionlistref = $self->{'option_list'};
     213    my @optionlist = @$optionlistref;
     214    my $pluginoptions = pop(@$optionlistref);
    215215    return $maxoffset if (!defined($pluginoptions));
    216216
    217217    # Find the length of the longest option string of this plugin
    218     local $pluginargs = $pluginoptions->{'args'};
     218    my $pluginargs = $pluginoptions->{'args'};
    219219    if (defined($pluginargs)) {
    220     local $longest = &PrintUsage::find_longest_option_string($pluginargs);
     220    my $longest = &PrintUsage::find_longest_option_string($pluginargs);
    221221    if ($longest > $maxoffset) {
    222222        $maxoffset = $longest;
     
    233233sub print_plugin_usage
    234234{
    235     local $self = shift(@_);
    236     local $descoffset = shift(@_);
    237     local $isleafclass = shift(@_);
    238 
    239     local $optionlistref = $self->{'option_list'};
    240     local @optionlist = @$optionlistref;
    241     local $pluginoptions = pop(@$optionlistref);
     235    my $self = shift(@_);
     236    my $descoffset = shift(@_);
     237    my $isleafclass = shift(@_);
     238
     239    my $optionlistref = $self->{'option_list'};
     240    my @optionlist = @$optionlistref;
     241    my $pluginoptions = pop(@$optionlistref);
    242242    return if (!defined($pluginoptions));
    243243
    244     local $pluginname = $pluginoptions->{'name'};
    245     local $pluginargs = $pluginoptions->{'args'};
    246     local $plugindesc = $pluginoptions->{'desc'};
     244    my $pluginname = $pluginoptions->{'name'};
     245    my $pluginargs = $pluginoptions->{'args'};
     246    my $plugindesc = $pluginoptions->{'desc'};
    247247
    248248    # Produce the usage information using the data structure above
     
    257257    if (defined($pluginargs)) {
    258258    # Calculate the column offset of the option descriptions
    259     local $optiondescoffset = $descoffset + 2;  # 2 spaces between options & descriptions
     259    my $optiondescoffset = $descoffset + 2;  # 2 spaces between options & descriptions
    260260
    261261    if ($isleafclass) {
     
    486486
    487487    $self->extra_metadata ($doc_obj, $doc_obj->get_top_section(), $metadata);
    488 
     488   
    489489    # do plugin specific processing of doc_obj
    490     return -1  unless defined ($self->process (\$text, $pluginfo, $base_dir, $file, $metadata, $doc_obj, $gli));
    491    
     490    unless (defined ($self->process (\$text, $pluginfo, $base_dir, $file, $metadata, $doc_obj, $gli))) {
     491    $text = '';
     492    undef $text;
     493    return -1;
     494    }
     495    $text='';
     496    undef $text;
     497
    492498    # do any automatic metadata extraction
    493499    $self->auto_extract_metadata ($doc_obj);
     
    495501    # add an OID
    496502    # see if there is a plugin-specific set_OID function...
    497     if (defined ($self->can(set_OID))) {
     503    if (defined ($self->can('set_OID'))) {
    498504    # it will need $doc_obj to set the Identifier metadata...
    499505    $self->set_OID($doc_obj);
     
    507513
    508514    $self->{'num_processed'} ++;
    509 
     515    undef $doc_obj;
    510516    return 1; # processed the file
    511517}
Note: See TracChangeset for help on using the changeset viewer.