voxforge.org
VoxForge Dev

Changeset 2630

Show
Ignore:
Timestamp:
07/13/08 22:20:56 (3 months ago)
Author:
kmaclean
Message:

moved location of condition to determine when to submit a submission to the webgui forum to the README class; set submission from voxforgeIVR to always update the English forum.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Trunk/Scripts/Audio_scripts/UserSubmission/README.pm

    r2628 r2630  
    140140                if ($audio_dir_name =~ /voxforgeivr/i) { 
    141141                        $readmecontents{'language'} = 'EN'; 
     142        # !!!!!!                         
     143                        $readmecontents{'updatewebguiforum'} = 'yes';            
    142144                } else { 
    143145                        confess "no language defined\n"; 
    144146                } 
    145                 # !!!!!! 
    146                 # if you have bulk updates for *one* language, with no Language set in the README (usually older submissions) set it here: 
    147                 #$readmecontents{'language'} = "DE"; 
    148                 # !!!!!! 
    149         } 
     147        } 
     148        if($readmecontents{'audiorecordingsoftware'} =~ /VoxForge Speech Submission Application/) { 
     149                $readmecontents{'updatewebguiforum'} = 'yes'; 
     150        } 
     151        # !!!!!!! 
     152         
    150153        # !!!!!! need unit tests to figure this out .... 
    151154        # trying to rewrite README file without the "Update WebGUI Forum:" line  
  • Trunk/Scripts/Mirroring_scripts/WebGUIForum.pm

    r2622 r2630  
    3232use URI::Escape; 
    3333use Encode; 
    34 # !!!!!! 
    3534use lib '../Audio_scripts'; 
    3635use UserSubmission::README();                  # Import nothing 
    3736use UserSubmission::PROMPTS(); 
    3837use UserSubmission::LICENSE(); 
    39 # !!!!!! 
    4038#################################################################### 
    4139###  Declarations                                                           
    4240#################################################################### 
    4341my $command; 
    44 # !!!!!! 
    45 #my $LoginURL ='http://www.voxforge.org'; 
    46 #my $englishURL = 'http://www.voxforge.org/home/downloads/speech/english';  
    47 #my $dutchURL = 'http://www.voxforge.org/home/downloads/speech/dutch'; 
    48 #my $germanURL = 'http://www.voxforge.org/home/downloads/speech/german-speech-files'; 
    49 #my $russianURL = 'http://www.voxforge.org/home/downloads/speech/russian'; 
    50 # !!!!!! 
    5142my $tarfile = undef; # not uploading a tarfile to WebGUI forum 
    5243#################################################################### 
     
    6758                my $readme = $$ProcessedUserSubmissions{$AudioDirName}{"readme"}; 
    6859                print "!!!!!!WeguiForumUpdate?:$readme->getUpdatewebguiforum()\n"; 
    69                 if(($readme->getAudiorecordingsoftware() =~ /VoxForge Speech Submission Application/) or ($readme->getUpdatewebguiforum() =~ /y|yes/i)){                         
     60                # !!!!!! 
     61                # if(($readme->getAudiorecordingsoftware() =~ /VoxForge Speech Submission Application/) or ($readme->getUpdatewebguiforum() =~ /y|yes/i)){                       
     62                if($readme->getUpdatewebguiforum() =~ /y|yes/i){                         
     63                # !!!!!! 
    7064                        print STDERR "Update Forum with AudioDirName:$path_original/$AudioDirName\n" if $debug; 
    71                         # !!!!!! 
    72                         #my $readmepath = "$path_original/$AudioDirName/etc/README"; 
    73                         #my $promptspath = "$path_original/$AudioDirName/etc/prompts-original"; 
    74                         #my $licensepath = "$path_original/$AudioDirName/LICENSE"; 
    75                         #my ($content,$title)= getSubmissionContents($parms,$readmepath,$promptspath,$licensepath,$AudioDirName,$readme,$tarfile); 
    7665                        my ($content,$title)= getSubmissionContents($parms,$path_original ,$AudioDirName,$readme,$tarfile); 
    77                         # !!!!!! 
    7866                        Upload($parms,$browser,$content,$title,$readme,$tarfile); 
    7967                } else { 
     
    8169                } 
    8270        } 
    83         #$command = ("rm my_cookies.txt"); print "$command\n" if $debug;system($command) == 0 or die "system $command failed: $?"; 
    8471        print "\nWebGUIForumUpdate.pm completed!\n****************************************************\n\n"; 
    8572} 
     
    9178        my ($parms,$readme) = @_;        
    9279                my $debug = $$parms{"debug"}; 
    93         # !!!!!! 
    94         #       my $UploadURL; 
    95         # remember to change LoginURL above if changing here: 
    96         #if ($readme->getLanguage() =~ /EN/) { 
    97         #       $UploadURL =$englishURL; 
    98         #} elsif ($readme->getLanguage() =~ /NL/) { 
    99         #       $UploadURL =$dutchURL; 
    100         #} elsif ($readme->getLanguage() =~ /DE/) { 
    101         #       $UploadURL =$germanURL;  
    102         #} elsif ($readme->getLanguage() =~ /RU/) { 
    103         #       $UploadURL =$russianURL;         
    104         #} else { 
    105         #       $UploadURL =$englishURL;         
    106         #} 
    107         #return $UploadURL; 
    108         my $language = $readme->getLanguage; 
    109         $parms->setWebguiForumLanguage($language); 
     80        #my $language = $readme->getLanguage; 
     81        $parms->setWebguiForumLanguage($readme->getLanguage); 
    11082        return $parms->getwebguiUploadURL; 
    111         # !!!!!! 
    11283} 
    11384 
    11485sub getSubmissionContents { 
    115         # !!!!!! 
    116         #my ($parms,$readmepath,$promptspath,$licensepath,$AudioDirName,$readme,$tarfile) = @_; 
    11786        my ($parms,$path_original ,$AudioDirName,$readme,$tarfile) = @_; 
    118         # !!!!!! 
    11987                my $debug = $$parms{"debug"}; 
    12088        my ($content); 
     
    189157                $content .= "<a href=\"" . getRepositoryURL($parms,$readme) . "/$title.tgz\">$title.tgz</a><br>"; 
    190158        } 
    191         # !!!!!! 
    192         # CURL expects URL encoded data for get; but does not need it for a post! 
    193         # therefore, don't need to use: "use URI::Escape;" 
    194         #                               encoded_string = uri_escape(raw_string); 
    195         #$content =~ s/;/,/g; # CURL submission options are separated by a semi-colon, therefore no semi-colons allowed in content submitted to WebGUI  
    196         #$content =~ s/&/and/g; # CURL (or WebGUI) doesn't like ampersands??  
    197         # !!!!!! 
    198  
    199159        return (\$content,\$title); 
    200160} 
     
    203163        my ($parms,$readme) = @_;        
    204164                my $debug = $$parms{"debug"}; 
    205         # !!!!!! 
    206         #my $RepositoryURL; 
    207165        my $AudioRateDir = $readme->getSamplingrate() . "_" . $readme->getSamplingrateformat() ; 
    208         #if ($readme->getLanguage() =~ /EN/) { 
    209         #       $RepositoryURL ="http://www.repository.voxforge1.org/downloads/SpeechCorpus/Trunk/Audio/Original/$AudioRateDir"; 
    210         #} else { 
    211         #       $RepositoryURL ="http://www.repository.voxforge1.org/downloads/SpeechCorpus/Trunk/Audio/Original/$AudioRateDir"; 
    212         #} 
    213         my $language = $readme->getLanguage; 
    214         $parms->setWebguiForumLanguage($language); 
     166        #my $language = $readme->getLanguage; 
     167        $parms->setWebguiForumLanguage($readme->getLanguage); 
    215168        my $RepositoryURL =  $parms->getwebguiRepositoryURL . "/$AudioRateDir";  
    216169        return $RepositoryURL; 
    217         # !!!!!! 
    218170} 
    219171 
     
    221173        my ($parms, $browser, $username, $identifier) = @_; 
    222174                my $debug = $$parms{"debug"}; 
    223         # !!!!!! 
    224175        my $LoginURL = $parms->getwebguiLoginURL; 
    225         # !!!!!!         
    226176        my $result = $browser->post( 
    227177      "$LoginURL",