spamassassin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j.@apache.org
Subject svn commit: r398363 - in /spamassassin/trunk/masses/rule-qa: automc/gen_info_xml automc/ruleqa.cgi corpus-hourly
Date Sun, 30 Apr 2006 16:04:39 GMT
Author: jm
Date: Sun Apr 30 09:04:36 2006
New Revision: 398363

URL: http://svn.apache.org/viewcvs?rev=398363&view=rev
Log:
make mass-check log metadata visible through web UI -- in HTML comments at least, for now

Modified:
    spamassassin/trunk/masses/rule-qa/automc/gen_info_xml
    spamassassin/trunk/masses/rule-qa/automc/ruleqa.cgi
    spamassassin/trunk/masses/rule-qa/corpus-hourly

Modified: spamassassin/trunk/masses/rule-qa/automc/gen_info_xml
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/masses/rule-qa/automc/gen_info_xml?rev=398363&r1=398362&r2=398363&view=diff
==============================================================================
--- spamassassin/trunk/masses/rule-qa/automc/gen_info_xml (original)
+++ spamassassin/trunk/masses/rule-qa/automc/gen_info_xml Sun Apr 30 09:04:36 2006
@@ -107,7 +107,7 @@
     $info->{includes_net} = 1;
   }
 
-  $info->{xml_mclogmd} = '';
+  $info->{mclogmds} = '';
   $info->{submitters} = '';
   if (-f "$drdir/DETAILS.all") {
     read_submitters("$drdir/DETAILS.all", $info);
@@ -137,8 +137,8 @@
       $sub =~ s/ $//gs;
       $info->{submitters} = $sub;
     }
-    if (/^#\s+(<mclogmd>.*?<\/mclogmd>)/) {
-      $info->{xml_mclogmd} = XMLin($1); # incorporate raw XML
+    if (/^#\s*(<mclogmds>.*<\/mclogmds>)/) {
+      $info->{mclogmds} = XMLin($1); # incorporate raw XML
     }
     last if (!/^#/);        # don't want anything after the comments end
   }

Modified: spamassassin/trunk/masses/rule-qa/automc/ruleqa.cgi
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/masses/rule-qa/automc/ruleqa.cgi?rev=398363&r1=398362&r2=398363&view=diff
==============================================================================
--- spamassassin/trunk/masses/rule-qa/automc/ruleqa.cgi (original)
+++ spamassassin/trunk/masses/rule-qa/automc/ruleqa.cgi Sun Apr 30 09:04:36 2006
@@ -1157,6 +1157,40 @@
       $drtitle =~ s/\s+/ /gs;
       $drtitle =~ s/^(.{0,160}).*$/$1/gs;
 
+      my $mds_as_text = '';
+      if (defined $fastinfo->{mclogmds} && $fastinfo->{mclogmds}->{mclogmd})
{
+        # $mds_as_text = XMLout($fastinfo->{mclogmds});
+        # use Data::Dumper; $mds_as_text = Dumper($fastinfo->{mclogmds});
+
+        # 'mclogmd' => [
+        #    {
+        #      'daterev' => '20060430/r398298-n',
+        #      'mcstartdate' => '20060430T122405Z',
+        #      'mtime' => '1146404744',
+        #      'rev' => '398298',
+        #      'file' => 'ham-cthielen.log',
+        #      'fsize' => '3036336'
+        #    }, [...]
+
+        my $all = '';
+        foreach my $f (@{$fastinfo->{mclogmds}->{mclogmd}}) {
+          my $started = $f->{mcstartdate};
+          my $subtime = strftime "%Y%m%dT%H%M%SZ", gmtime $f->{mtime};
+
+          $all .= qq{
+          
+            <p> <b>$f->{file}</b>:
+                started: $started;
+                submitted: $subtime;
+                size: $f->{fsize} bytes
+            </p>
+
+          };
+        }
+
+        $mds_as_text = qq{ <span class="mclogmds"> $all </span> };
+      }
+
       $txt = qq{
 
           <td class=daterevtd>
@@ -1187,6 +1221,9 @@
           </td>
           <td class=daterevtd colspan=1>
               <em><mcsubmitters>$fastinfo->{submitters}</mcsubmitters></em>
+              <!--
+              $mds_as_text
+              -->
           </td>
 
       };

Modified: spamassassin/trunk/masses/rule-qa/corpus-hourly
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/masses/rule-qa/corpus-hourly?rev=398363&r1=398362&r2=398363&view=diff
==============================================================================
--- spamassassin/trunk/masses/rule-qa/corpus-hourly (original)
+++ spamassassin/trunk/masses/rule-qa/corpus-hourly Sun Apr 30 09:04:36 2006
@@ -341,9 +341,7 @@
     open(OUT, "> $tmpfname") or warn "cannot write to $tmpfname";
     print OUT "# ham results used for $daterev $class $age: " . join(" ", @ham) . "\n";
     print OUT "# spam results used for $daterev $class $age: " . join(" ", @spam) . "\n";
-    for (@ham, @spam) {
-      print OUT "# ".log_metadata_xml($daterev, $_);
-    }
+    print OUT "# ".log_metadata_xml($daterev, @ham, @spam)."\n";
 
     push (@tmps, $tmpfname);
 
@@ -473,22 +471,23 @@
 }
 
 sub log_metadata_xml {
-  my $daterev = shift;
-  my $f = shift;
+  my ($daterev, @files) = @_;
+  my $str = '';
 
   # this is extracted into the info.xml file later by the gen_info_xml script
-
-  my $str = qq{
-    <mclogmd>
-      <daterev>$daterev</daterev>
-      <rev>$revision{$f}</rev>
-      <fsize>$filesize{$f}</fsize>
-      <mcstartdate>$dateline{$f}</mcstartdate>
-      <mtime>$mtime{$f}</mtime>
-    </mclogmd>
-  };
+  foreach my $f (@files) {
+    $str .= qq{
+      <mclogmd file='$f'>
+        <daterev>$daterev</daterev>
+        <rev>$revision{$f}</rev>
+        <fsize>$filesize{$f}</fsize>
+        <mcstartdate>$dateline{$f}</mcstartdate>
+        <mtime>$mtime{$f}</mtime>
+      </mclogmd>
+    };
+  }
 
   $str =~ s/\s+/ /gs;  # on a single line please
-  return $str;
+  return '<mclogmds>'.$str.'</mclogmds>';
 }
 



Mime
View raw message