Changeset 17207


Ignore:
Timestamp:
2008-09-08T11:35:57+12:00 (16 years ago)
Author:
kjdon
Message:

BasDownload renamed to BaseDownload, also tidied up the constructors

Location:
gsdl/trunk/perllib/downloaders
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/downloaders/BaseDownload.pm

    r17206 r17207  
    11###########################################################################
    22#
    3 # BasDownload.pm -- base class for all the Download modules
     3# BaseDownload.pm -- base class for all the Download modules
    44# A component of the Greenstone digital library software
    55# from the New Zealand Digital Library Project at the
     
    2424###########################################################################
    2525
    26 package BasDownload;
     26package BaseDownload;
    2727
    2828eval {require bytes};
     
    4141my $arguments = [];
    4242
    43 my $options = { 'name'     => "BasDownload",
    44         'desc'     => "{BasDownload.desc}",
     43my $options = { 'name'     => "BaseDownload",
     44        'desc'     => "{BaseDownload.desc}",
    4545        'abstract' => "yes",
    4646        'inherits' => "no" };
     
    5353    my $strDownloadName = (defined $downloadlist->[0]) ? $downloadlist->[0] : $class;
    5454
    55     if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
    56     if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
     55    push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
     56    push(@{$hashArgOptLists->{"OptList"}},$options);
    5757
    5858    my $self = {};
     
    7878    my $classTempClass = bless $self, $class;
    7979    print STDERR "<BadDownload d=$self->{'download_name'}>\n";
    80     &gsprintf(STDERR, "\n{BasDownload.bad_general_option}\n", $self->{'download_name'});
     80    &gsprintf(STDERR, "\n{BaseDownload.bad_general_option}\n", $self->{'download_name'});
    8181    $classTempClass->print_txt_usage("");  # Use default resource bundle
    8282    die "\n";
     
    233233      my ($strFunctionName,$strError) = @_;
    234234    {
    235     print "Error occoured in BasDownload.pm\n".
     235    print "Error occoured in BaseDownload.pm\n".
    236236        "In Function: ".$strFunctionName."\n".
    237237        "Error Message: ".$strError."\n";
  • gsdl/trunk/perllib/downloaders/MediaWikiDownload.pm

    r14248 r17207  
    9494    push(@$getlist, $class);
    9595
    96     if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
    97     if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
    98 
    99      my $self = (defined $hashArgOptLists)? new WgetDownload($getlist,$inputargs,$hashArgOptLists): new WgetDownload($getlist,$inputargs);
     96    push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
     97    push(@{$hashArgOptLists->{"OptList"}},$options);
     98
     99     my $self = new WgetDownload($getlist,$inputargs,$hashArgOptLists);
    100100   
    101101    return bless $self, $class;
  • gsdl/trunk/perllib/downloaders/OAIDownload.pm

    r16791 r17207  
    9696    push(@$getlist, $class);
    9797
    98     if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
    99     if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
    100 
    101     my $self = (defined $hashArgOptLists)? new WgetDownload($getlist,$inputargs,$hashArgOptLists): new WgetDownload($getlist,$inputargs);
     98    push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
     99    push(@{$hashArgOptLists->{"OptList"}},$options);
     100
     101    my $self = new WgetDownload($getlist,$inputargs,$hashArgOptLists);
    102102
    103103    if ($self->{'info_only'}) {
  • gsdl/trunk/perllib/downloaders/SRWDownload.pm

    r12902 r17207  
    4141}
    4242
    43 my $arguments;
     43my $arguments = [
     44         ];
    4445
    4546my $options = { 'name'     => "SRWDownload",
     
    5657    push(@$getlist, $class);
    5758
    58     if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
    59     if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
    60 
    61     my $self = (defined $hashArgOptLists)? new Z3950Download($getlist,$inputargs,$hashArgOptLists): new Z3950Download($getlist,$inputargs);
     59    push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
     60    push(@{$hashArgOptLists->{"OptList"}},$options);
     61
     62    my $self = new Z3950Download($getlist,$inputargs,$hashArgOptLists);
    6263
    6364    if ($self->{'info_only'}) {
  • gsdl/trunk/perllib/downloaders/WebDownload.pm

    r14657 r17207  
    8686    push(@$getlist, $class);
    8787
    88     if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
    89     if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
    90 
    91      my $self = (defined $hashArgOptLists)? new WgetDownload($getlist,$inputargs,$hashArgOptLists): new WgetDownload($getlist,$inputargs);
     88    push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
     89    push(@{$hashArgOptLists->{"OptList"}},$options);
     90
     91    my $self = new WgetDownload($getlist,$inputargs,$hashArgOptLists);
    9292   
    9393    return bless $self, $class;
  • gsdl/trunk/perllib/downloaders/WgetDownload.pm

    r16791 r17207  
    3232$SIG{__WARN__} = sub {warn($_[0]) unless ($_[0] =~ /Subroutine\s+\S+\sredefined/)};
    3333
    34 use BasDownload;
     34use BaseDownload;
    3535use strict;
    3636use IPC::Open2;
     
    3838
    3939sub BEGIN {
    40     @WgetDownload::ISA = ('BasDownload');
     40    @WgetDownload::ISA = ('BaseDownload');
    4141}
    4242
     
    8080    push(@$getlist, $class);
    8181
    82     if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
    83     if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
    84 
    85     my $self = (defined $hashArgOptLists)? new BasDownload($getlist,$inputargs,$hashArgOptLists): new BasDownload($getlist,$inputargs);
     82    push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
     83    push(@{$hashArgOptLists->{"OptList"}},$options);
     84
     85    my $self = new BaseDownload($getlist,$inputargs,$hashArgOptLists);
    8686
    8787    return bless $self, $class;
  • gsdl/trunk/perllib/downloaders/Z3950Download.pm

    r13019 r17207  
    3434use strict;
    3535
    36 use BasDownload;
     36use BaseDownload;
    3737use IPC::Open2;
    3838
    3939sub BEGIN {
    40     @Z3950Download::ISA = ('BasDownload');
     40    @Z3950Download::ISA = ('BaseDownload');
    4141}
    4242
     
    8383    push(@$getlist, $class);
    8484
    85     if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
    86     if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
    87 
    88     my $self = (defined $hashArgOptLists)? new BasDownload($getlist,$inputargs,$hashArgOptLists): new BasDownload($getlist,$inputargs);
     85    push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
     86    push(@{$hashArgOptLists->{"OptList"}},$options);
     87
     88    my $self = new BaseDownload($getlist,$inputargs,$hashArgOptLists);
    8989
    9090    if ($self->{'info_only'}) {
Note: See TracChangeset for help on using the changeset viewer.