Changeset 2630
- Timestamp:
- 07/13/08 22:20:56 (3 months ago)
- Files:
-
- Trunk/Scripts/Audio_scripts/UserSubmission/README.pm (modified) (1 diff)
- Trunk/Scripts/Mirroring_scripts/WebGUIForum.pm (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Trunk/Scripts/Audio_scripts/UserSubmission/README.pm
r2628 r2630 140 140 if ($audio_dir_name =~ /voxforgeivr/i) { 141 141 $readmecontents{'language'} = 'EN'; 142 # !!!!!! 143 $readmecontents{'updatewebguiforum'} = 'yes'; 142 144 } else { 143 145 confess "no language defined\n"; 144 146 } 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 150 153 # !!!!!! need unit tests to figure this out .... 151 154 # trying to rewrite README file without the "Update WebGUI Forum:" line Trunk/Scripts/Mirroring_scripts/WebGUIForum.pm
r2622 r2630 32 32 use URI::Escape; 33 33 use Encode; 34 # !!!!!!35 34 use lib '../Audio_scripts'; 36 35 use UserSubmission::README(); # Import nothing 37 36 use UserSubmission::PROMPTS(); 38 37 use UserSubmission::LICENSE(); 39 # !!!!!!40 38 #################################################################### 41 39 ### Declarations 42 40 #################################################################### 43 41 my $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 # !!!!!!51 42 my $tarfile = undef; # not uploading a tarfile to WebGUI forum 52 43 #################################################################### … … 67 58 my $readme = $$ProcessedUserSubmissions{$AudioDirName}{"readme"}; 68 59 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 # !!!!!! 70 64 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);76 65 my ($content,$title)= getSubmissionContents($parms,$path_original ,$AudioDirName,$readme,$tarfile); 77 # !!!!!!78 66 Upload($parms,$browser,$content,$title,$readme,$tarfile); 79 67 } else { … … 81 69 } 82 70 } 83 #$command = ("rm my_cookies.txt"); print "$command\n" if $debug;system($command) == 0 or die "system $command failed: $?";84 71 print "\nWebGUIForumUpdate.pm completed!\n****************************************************\n\n"; 85 72 } … … 91 78 my ($parms,$readme) = @_; 92 79 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); 110 82 return $parms->getwebguiUploadURL; 111 # !!!!!!112 83 } 113 84 114 85 sub getSubmissionContents { 115 # !!!!!!116 #my ($parms,$readmepath,$promptspath,$licensepath,$AudioDirName,$readme,$tarfile) = @_;117 86 my ($parms,$path_original ,$AudioDirName,$readme,$tarfile) = @_; 118 # !!!!!!119 87 my $debug = $$parms{"debug"}; 120 88 my ($content); … … 189 157 $content .= "<a href=\"" . getRepositoryURL($parms,$readme) . "/$title.tgz\">$title.tgz</a><br>"; 190 158 } 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 WebGUI196 #$content =~ s/&/and/g; # CURL (or WebGUI) doesn't like ampersands??197 # !!!!!!198 199 159 return (\$content,\$title); 200 160 } … … 203 163 my ($parms,$readme) = @_; 204 164 my $debug = $$parms{"debug"}; 205 # !!!!!!206 #my $RepositoryURL;207 165 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); 215 168 my $RepositoryURL = $parms->getwebguiRepositoryURL . "/$AudioRateDir"; 216 169 return $RepositoryURL; 217 # !!!!!!218 170 } 219 171 … … 221 173 my ($parms, $browser, $username, $identifier) = @_; 222 174 my $debug = $$parms{"debug"}; 223 # !!!!!!224 175 my $LoginURL = $parms->getwebguiLoginURL; 225 # !!!!!!226 176 my $result = $browser->post( 227 177 "$LoginURL",