Changeset 31957

Show
Ignore:
Timestamp:
08.09.2017 19:35:17 (3 months ago)
Author:
ak19
Message:

Tidying up. 1. Shifting informative error message to strings.properties. 2. Commenting out unnecessary message that was printed out for debugging when things went well. 3. To use gsprintf passing in STDERR/STDOUT as a parameter when use strict is on, need to make some exceptions to strict.

Location:
main/trunk/greenstone2/perllib
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/downloaders/WebDownload.pm

    r31920 r31957  
    135135     
    136136    # if ($strResponse ne ""){print "$strResponse\n";} 
    137      print STDERR "Finish download from $self->{'url'}\n"; 
     137     print STDERR "Finished downloading from $self->{'url'}\n"; 
    138138 
    139139    print STDERR "<<Finished>>\n"; 
  • main/trunk/greenstone2/perllib/downloaders/WgetDownload.pm

    r31956 r31957  
    3434use BaseDownload; 
    3535use strict; 
     36no strict 'subs'; # make an exception so we can use variables as filehandles to pass STDERR/STDOUT to functions, needed for gsprintf() 
    3637use Cwd; 
    3738use util; 
     
    468469              } else { # $! contains message "An existing connection was forcibly closed by remote host" where "remote" is a reference to the sockets to our wget child process, 
    469470                    # NOT to the remote web server we're downloading from. In such a case, the error code is ECONNRESET, and it's not an error, despite $len being undefined. 
    470                 print STDERR "WgetDownload: wget finished\n"; 
     471                #print STDERR "WgetDownload: wget finished\n"; 
    471472              } 
    472473            } 
     
    474475            # Finished reading from this filehandle $fh because we read 0 bytes. 
    475476            # wget finished, terminate naturally 
    476             print STDERR "WgetDownload: wget finished\n"; 
    477             #print STDOUT "\nPerl: open3 command, input streams closed. Wget terminated naturally.\n"; 
     477            #print STDERR "WgetDownload: wget finished\n"; #print STDOUT "\nPerl: open3 command, input streams closed. Wget terminated naturally.\n"; 
    478478            } 
    479479 
     
    495495        $num_consecutive_timedouts = 0; 
    496496 
    497         print STDERR "WARNING from WgetDownload: wget timed out $NUM_TRIES times waiting for a response\n"; 
    498         print STDERR "\tThe URL may be inaccessible or the proxy configuration is wrong or incomplete.\n"; 
     497        &gsprintf::gsprintf(STDERR, "{WgetDownload.wget_timed_out_warning}\n", $NUM_TRIES); 
    499498    } 
    500499 
     
    732731        $num_consecutive_timedouts = 0; 
    733732 
    734         #print STDERR "WARNING from WgetDownload: wget timed out $NUM_TRIES times waiting for a response\n"; 
    735         #print STDERR "\tThe URL may be inaccessible or the proxy configuration is wrong or incomplete.\n"; 
     733        #&gsprintf::gsprintf(STDERR, "{WgetDownload.wget_timed_out_warning}\n", $NUM_TRIES); 
    736734    } 
    737735 
  • main/trunk/greenstone2/perllib/strings.properties

    r31899 r31957  
    13541354WgetDownload.user_password:User password 
    13551355WgetDownload.no_check_certificate:No check certificate 
     1356WgetDownload.wget_timed_out_warning:WARNING: wget timed out %s times waiting for a response.\n\tThe URL may be inaccessible or the proxy configuration is wrong or incomplete.\n 
    13561357 
    13571358Z3950Download.desc:A module for downloading from Z3950 repositories