voxforge.org
VoxForge Dev

Changeset 2420

Show
Ignore:
Timestamp:
01/23/08 23:33:53 (1 year ago)
Author:
kmaclean
Message:

changes to automate a portion of the processing of mojomove411 submissions

Files:

Legend:

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

    r2391 r2420  
    2929### Constructor 
    3030#################################################################### 
    31 # !!!!!! 
     31 
    3232sub new { 
    3333        my ($class, $parms, $ReadmeWithPath) = @_; 
    34         #my $self = _Process($parms, $AudioDirName, $SubDirectory); 
    3534        my $self = _ValidateREADME($parms, $ReadmeWithPath); 
    3635        bless($self,$class); 
    3736        return $self; 
    3837} 
    39 # !!!!!! 
     38 
    4039#################################################################### 
    4140### Class Methods 
    4241#################################################################### 
    4342sub ValidateFileName {  
    44         # !!!!!! 
    45         #my ($parms, $AudioDirParms) = @_; 
    4643        my ($parms, $AudioDirName) = @_;                 
    4744                my $debug = $$parms{"debug"}; 
    4845                my $QuarantineDir = $$parms{"QuarantineDir"};            
    49         #my $AudioDirName =  $$AudioDirParms{"audio_dir_name"};          
    50         # !!!!!! 
     46 
    5147        my $readmePath = "$QuarantineDir/$AudioDirName";                 
    5248        opendir(DIR, "$readmePath") || die ("Unable to open file: $readmePath"); 
     
    7167        } 
    7268} 
    73 #################################################################### 
    74 ### Instance Methods 
    75 #################################################################### 
    76 # !!!!!!no longer required ... not sure why I did this this way 
    77 #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.pm 
    89 #               print  "processing $ToBeProcessedDir/$AudioDirName/$SubDirectory/README\n" if $debug;    
    90 #               # !!!!!! 
    91 #               $readme = _ValidateREADME($parms, "$ToBeProcessedDir/$AudioDirName/$SubDirectory/README"); 
    92 #               # !!!!!! 
    93 #       } else { # call from UserSubmission.pm 
    94 #               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 # !!!!!! 
    10669 
    10770sub _ValidateREADME { 
    10871        my ($parms, $ReadmeWithPath) = @_;       
    10972                my $debug = $$parms{"debug"}; 
    110         # !!!!!! 
    11173        my (%readmecontents, $title);    
    11274 
     
    11476        $readmecontents{'audiorecordingsoftware'}=""; 
    11577         
    116         #my ($title, $samplingrate, $samplingrateformat,$dialect,$filetype, $language, $audiorecordingsoftware); 
    117         # !!!!!! 
    11878        open(README, "$ReadmeWithPath") || die ("Unable to open file: $ReadmeWithPath");                 
    11979        while (my $line = <README>) { 
     
    156116                        ($title, $readmecontents{'audiorecordingsoftware'}) =split(/\:/, $line); 
    157117                        #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); 
    158121                }  
    159122        } 
    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; 
    171123        return \%readmecontents; 
    172         # !!!!!! 
    173124} 
    174 # !!!!!! 
     125 
    175126sub getSamplingrate { 
    176127        my $self = shift; 
     
    202153        return $self->{'audiorecordingsoftware'}; 
    203154} 
    204 # !!!!!! 
     155 
     156sub getUpdatewebguiforum { 
     157        my $self = shift; 
     158        return $self->{'updatewebguiforum'}; 
     159
    2051601; 
  • Trunk/Scripts/Mirroring_scripts/RunDaily.pl

    r2395 r2420  
    2929### 0.1.6 - 2007.4.18 - accomodate svn repository changes 
    3030### 0.1.7 - 2007.8.22 - add Flac audio processing 
    31 ### 0.1.8 - 2007.8.22 - addition of WebGUIFOrumUpdate module & convert README module to a class 
     31### 0.1.8 - 2007.8.22 - addition of WebGUIForumUpdate module & convert README module to a class 
    3232#################################################################### 
    3333package RunDaily; 
     
    8080#################################################################### 
    8181UserSubmission::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! 
    8684AcousticModel::Create(\%parms) || confess "UserSubmissions error: $?"; 
    87  
    8885NightlyTest::Process(\%parms) || confess "UserSubmissions error: $?"; 
    8986TarFiles::Create($parms) || confess "UserSubmissions error: $?"; 
    9087UserMetrics::Process(\%parms) || confess "UserSubmissions error: $?"; 
    9188Rsync() || confess "UserSubmissions error: $?"; 
    92 # !!!!!! 
    9389WebGUIForumUpdate::Main(\%parms, $ProcessedUserSubmissions, 'speechsubmission', 'xxxxx') || confess "UserSubmissions error: $?"; 
    94 # !!!!!! 
     90 
    9591print STDOUT "!!!!!!run_daily completed\n"; 
    9692#################################################################### 
  • Trunk/Scripts/Mirroring_scripts/WebGUIForumUpdate.pm

    r2400 r2420  
    99### Command: perl ./WebGUIForumUpdate.pm ($parms, $ProcessedUserSubmissions) 
    1010###     
    11 ### Copyright (C) 2007 Ken MacLean 
     11### Copyright (C) 2008 Ken MacLean 
    1212### 
    1313### This program is free software; you can redistribute it and/or 
     
    4747                my $path_original = $$ProcessedUserSubmissions{$AudioDirName}{"path_original"}; 
    4848                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)){                   
    5050                        print STDERR "Update Forum with AudioDirName:$path_original/$AudioDirName\n" if $debug; 
    5151                        my ($content,$title)= getSubmissionContents($parms,$path_original,$AudioDirName,$readme); 
     
    6363#################################################################### 
    6464sub getUploadURL { 
    65         #my ($parms,$language) = @_; 
    6665        my ($parms,$readme) = @_;        
    6766                my $debug = $$parms{"debug"}; 
     
    106105        $content .= join(" ",  @license); 
    107106        $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 
    112108        $content .= "<br><img src=\"http://www.repository.voxforge1.org/spicons/compressed.gif\">"; 
    113109        $content .= "<a href=\"$RepositoryURL/$title.tgz\">$title.tgz</a><br>"; 
    114         # !!!!!! 
    115110        $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); 
    118111        return (\$content,\$title); 
    119112} 
    120113 
    121114sub getRepositoryURL { 
    122         #my ($parms,language) = @_; 
    123115        my ($parms,$readme) = @_;        
    124116                my $debug = $$parms{"debug"}; 
     
    182174 
    183175sub Upload { 
    184         #my ($parms,$content,$title,$language) = @_; 
    185176        my ($parms,$content,$title,$readme) = @_; 
    186177                my $debug = $$parms{"debug"}; 
    187178        my ($result, $err); 
    188179        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); 
    190180        my $UploadURL = getUploadURL($parms,$readme);    
    191181