Changeset 2420
- Timestamp:
- 01/23/08 23:33:53 (1 year ago)
- Files:
-
- Trunk/Scripts/Audio_scripts/UserSubmission/README.pm (modified) (5 diffs)
- Trunk/Scripts/Mirroring_scripts/RunDaily.pl (modified) (2 diffs)
- Trunk/Scripts/Mirroring_scripts/WebGUIForumUpdate.pm (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Trunk/Scripts/Audio_scripts/UserSubmission/README.pm
r2391 r2420 29 29 ### Constructor 30 30 #################################################################### 31 # !!!!!! 31 32 32 sub new { 33 33 my ($class, $parms, $ReadmeWithPath) = @_; 34 #my $self = _Process($parms, $AudioDirName, $SubDirectory);35 34 my $self = _ValidateREADME($parms, $ReadmeWithPath); 36 35 bless($self,$class); 37 36 return $self; 38 37 } 39 # !!!!!! 38 40 39 #################################################################### 41 40 ### Class Methods 42 41 #################################################################### 43 42 sub ValidateFileName { 44 # !!!!!!45 #my ($parms, $AudioDirParms) = @_;46 43 my ($parms, $AudioDirName) = @_; 47 44 my $debug = $$parms{"debug"}; 48 45 my $QuarantineDir = $$parms{"QuarantineDir"}; 49 #my $AudioDirName = $$AudioDirParms{"audio_dir_name"}; 50 # !!!!!! 46 51 47 my $readmePath = "$QuarantineDir/$AudioDirName"; 52 48 opendir(DIR, "$readmePath") || die ("Unable to open file: $readmePath"); … … 71 67 } 72 68 } 73 ####################################################################74 ### Instance Methods75 ####################################################################76 # !!!!!!no longer required ... not sure why I did this this way77 #sub _Process {78 # my ($parms, $AudioDirName, $SubDirectory) = @_;79 # my $debug = $$parms{"debug"};80 # my $QuarantineDir = $$parms{"QuarantineDir"};81 # my $ToBeProcessedDir = $$parms{"ToBeProcessedDir"};82 # # !!!!!!83 # my $readme;84 # #my $AudioDirName = $$AudioDirParms{"audio_dir_name"};85 # #my ($samplingrate, $samplingrateformat, $filetype, $dialect, $language, $audiorecordingsoftware);86 # # !!!!!!87 # if (!defined($SubDirectory)) {$SubDirectory=""};88 # if ($SubDirectory) { # call from Repository.pm89 # print "processing $ToBeProcessedDir/$AudioDirName/$SubDirectory/README\n" if $debug;90 # # !!!!!!91 # $readme = _ValidateREADME($parms, "$ToBeProcessedDir/$AudioDirName/$SubDirectory/README");92 # # !!!!!!93 # } else { # call from UserSubmission.pm94 # print "processing $QuarantineDir/$AudioDirName/README\n" if $debug;95 # # !!!!!!96 # $readme = _ValidateREADME($parms,"$QuarantineDir/$AudioDirName/README" );97 # # !!!!!!98 # }99 # close (README);100 # # !!!!!!101 # #return $samplingrate, $samplingrateformat, $filetype, $dialect, $language, $audiorecordingsoftware;102 # return $readme;103 # # !!!!!!104 #}105 # !!!!!!106 69 107 70 sub _ValidateREADME { 108 71 my ($parms, $ReadmeWithPath) = @_; 109 72 my $debug = $$parms{"debug"}; 110 # !!!!!!111 73 my (%readmecontents, $title); 112 74 … … 114 76 $readmecontents{'audiorecordingsoftware'}=""; 115 77 116 #my ($title, $samplingrate, $samplingrateformat,$dialect,$filetype, $language, $audiorecordingsoftware);117 # !!!!!!118 78 open(README, "$ReadmeWithPath") || die ("Unable to open file: $ReadmeWithPath"); 119 79 while (my $line = <README>) { … … 156 116 ($title, $readmecontents{'audiorecordingsoftware'}) =split(/\:/, $line); 157 117 #print "Audio Recording Software:$readmecontents{'audiorecordingsoftware'}\n" if $debug; 118 } elsif ($line =~ /Update WebGUI Forum: /i) { 119 # $line =~ s/ //g; # not required 120 ($title, $readmecontents{'updatewebguiforum'}) =split(/\:/, $line); 158 121 } 159 122 } 160 # !!!!!!161 #if ($debug) {162 # print "_ValidateREADME:\n";163 # print "samplingrate:$readmecontents{'samplingrate'} ;\n";164 # print "samplingrateformat:$readmecontents{'samplingrateformat'} ;\n";165 # print "filetype:$readmecontents{'filetype'} ;\n";166 # print "dialect:$readmecontents{'dialect'} ;\n" ;167 # print "language:$readmecontents{'language'} ;\n";168 # print "audiorecordingsoftware:$readmecontents{'audiorecordingsoftware'}:\n" ;169 #}170 #return $samplingrate, $samplingrateformat, $filetype, $dialect, $language, $audiorecordingsoftware;171 123 return \%readmecontents; 172 # !!!!!!173 124 } 174 # !!!!!! 125 175 126 sub getSamplingrate { 176 127 my $self = shift; … … 202 153 return $self->{'audiorecordingsoftware'}; 203 154 } 204 # !!!!!! 155 156 sub getUpdatewebguiforum { 157 my $self = shift; 158 return $self->{'updatewebguiforum'}; 159 } 205 160 1; Trunk/Scripts/Mirroring_scripts/RunDaily.pl
r2395 r2420 29 29 ### 0.1.6 - 2007.4.18 - accomodate svn repository changes 30 30 ### 0.1.7 - 2007.8.22 - add Flac audio processing 31 ### 0.1.8 - 2007.8.22 - addition of WebGUIF OrumUpdate module & convert README module to a class31 ### 0.1.8 - 2007.8.22 - addition of WebGUIForumUpdate module & convert README module to a class 32 32 #################################################################### 33 33 package RunDaily; … … 80 80 #################################################################### 81 81 UserSubmission::Main(\%parms) || confess "UserSubmissions error: $?"; 82 # !!!!!!! 83 #Repository::Main(\%parms) || confess "Repository error: $?"; 84 (my $ProcessedUserSubmissions = Repository::Main(\%parms)) || confess "Repository error: $?"; # watch ""||"" because it changes left-side to scalar context, and only last item in list is transferred! 85 # !!!!!! 82 (my $ProcessedUserSubmissions = 83 Repository::Main(\%parms)) || confess "Repository error: $?"; # watch ""||"" because it changes left-side to scalar context, and only last item in list is transferred! 86 84 AcousticModel::Create(\%parms) || confess "UserSubmissions error: $?"; 87 88 85 NightlyTest::Process(\%parms) || confess "UserSubmissions error: $?"; 89 86 TarFiles::Create($parms) || confess "UserSubmissions error: $?"; 90 87 UserMetrics::Process(\%parms) || confess "UserSubmissions error: $?"; 91 88 Rsync() || confess "UserSubmissions error: $?"; 92 # !!!!!!93 89 WebGUIForumUpdate::Main(\%parms, $ProcessedUserSubmissions, 'speechsubmission', 'xxxxx') || confess "UserSubmissions error: $?"; 94 # !!!!!! 90 95 91 print STDOUT "!!!!!!run_daily completed\n"; 96 92 #################################################################### Trunk/Scripts/Mirroring_scripts/WebGUIForumUpdate.pm
r2400 r2420 9 9 ### Command: perl ./WebGUIForumUpdate.pm ($parms, $ProcessedUserSubmissions) 10 10 ### 11 ### Copyright (C) 200 7Ken MacLean11 ### Copyright (C) 2008 Ken MacLean 12 12 ### 13 13 ### This program is free software; you can redistribute it and/or … … 47 47 my $path_original = $$ProcessedUserSubmissions{$AudioDirName}{"path_original"}; 48 48 my $readme = $$ProcessedUserSubmissions{$AudioDirName}{"readme"}; 49 if ($readme->getAudiorecordingsoftware() =~ /VoxForge Speech Submission Application/){49 if(($readme->getAudiorecordingsoftware() =~ /VoxForge Speech Submission Application/) or ($readme->getUpdatewebguiforum() =~ /y/i)){ 50 50 print STDERR "Update Forum with AudioDirName:$path_original/$AudioDirName\n" if $debug; 51 51 my ($content,$title)= getSubmissionContents($parms,$path_original,$AudioDirName,$readme); … … 63 63 #################################################################### 64 64 sub getUploadURL { 65 #my ($parms,$language) = @_;66 65 my ($parms,$readme) = @_; 67 66 my $debug = $$parms{"debug"}; … … 106 105 $content .= join(" ", @license); 107 106 $content =~ s/\n/<br>\n/g; 108 # !!!!!! no longer required 109 #$content =~ s/WARRANTY;/WARRANTY,/; # WebGUI does not like CAPITAL LETTERS followed by a semi-colon ...? 110 # !!!!!! 111 $content =~ s|<http://www.gnu.org/licenses/>|http://www.gnu.org/licenses/|; # more WebGUI arcana 107 $content =~ s|<http://www.gnu.org/licenses/>|http://www.gnu.org/licenses/|; # either webgui or libcurl issue 112 108 $content .= "<br><img src=\"http://www.repository.voxforge1.org/spicons/compressed.gif\">"; 113 109 $content .= "<a href=\"$RepositoryURL/$title.tgz\">$title.tgz</a><br>"; 114 # !!!!!!115 110 $content =~ s/;/,/g; # CURL submission options are separated by a semi-colon, therefore no semi-colons allowed in content submitted to WebGUI 116 # !!!!!!117 #return (\$content,\$title,\$language,$AudioRecordingSoftware);118 111 return (\$content,\$title); 119 112 } 120 113 121 114 sub getRepositoryURL { 122 #my ($parms,language) = @_;123 115 my ($parms,$readme) = @_; 124 116 my $debug = $$parms{"debug"}; … … 182 174 183 175 sub Upload { 184 #my ($parms,$content,$title,$language) = @_;185 176 my ($parms,$content,$title,$readme) = @_; 186 177 my $debug = $$parms{"debug"}; 187 178 my ($result, $err); 188 179 my $post = "func=editSave;assetId=new;class=WebGUI::Asset::Post::Thread;proceed=showConfirmation;title=$$title;content=$$content;contentType=text,subscribe=1;submit=save"; 189 #my $UploadURL = getUploadURL($parms,$language);190 180 my $UploadURL = getUploadURL($parms,$readme); 191 181