You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2005/12/10 03:41:06 UTC
svn commit: r355699 - in /spamassassin/trunk:
lib/Mail/SpamAssassin/ArchiveIterator.pm masses/mass-check
masses/rule-qa/automc/ruleqa.cgi
Author: jm
Date: Fri Dec 9 18:41:02 2005
New Revision: 355699
URL: http://svn.apache.org/viewcvs?rev=355699&view=rev
Log:
working --showdots for scan stage
Modified:
spamassassin/trunk/lib/Mail/SpamAssassin/ArchiveIterator.pm
spamassassin/trunk/masses/mass-check
spamassassin/trunk/masses/rule-qa/automc/ruleqa.cgi
Modified: spamassassin/trunk/lib/Mail/SpamAssassin/ArchiveIterator.pm
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/lib/Mail/SpamAssassin/ArchiveIterator.pm?rev=355699&r1=355698&r2=355699&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/ArchiveIterator.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/ArchiveIterator.pm Fri Dec 9 18:41:02 2005
@@ -187,6 +187,12 @@
Note that if C<opt_want_date> is set to 0, the received date scalar will be
undefined.
+=item scan_progress_sub
+
+Reference to a subroutine which will be called intermittently during
+the 'scan' phase of the mass-check. No guarantees are made as to
+how frequently this may happen, mind you.
+
=back
=cut
@@ -914,6 +920,7 @@
sub scan_file {
my ($self, $class, $mail) = @_;
+ $self->bump_scan_progress();
if (!$self->{determine_receive_date}) {
push(@{$self->{$class}}, scan_index_pack(AI_TIME_UNKNOWN, $class, "f", $mail));
return;
@@ -959,6 +966,7 @@
}
foreach my $file (@files) {
+ $self->bump_scan_progress();
if ($file =~ /\.(?:gz|bz2)$/) {
die "archive-iterator: compressed mbox folders are not supported at this time\n";
}
@@ -1005,6 +1013,7 @@
$where = tell INPUT;
}
if ($header) {
+ $self->bump_scan_progress();
$info->{$offset} = Mail::SpamAssassin::Util::receive_date($header);
}
}
@@ -1049,6 +1058,8 @@
}
foreach my $file (@files) {
+ $self->bump_scan_progress();
+
if ($folder =~ /\.(?:gz|bz2)$/) {
die "archive-iterator: compressed mbx folders are not supported at this time\n";
}
@@ -1091,6 +1102,7 @@
$header .= $_;
}
+ $self->bump_scan_progress();
$info->{"$file.$offset"} = Mail::SpamAssassin::Util::receive_date($header);
# go onto the next message
@@ -1118,6 +1130,16 @@
if (defined $AICache) {
$AICache = $AICache->finish();
}
+ }
+}
+
+############################################################################
+
+sub bump_scan_progress {
+ my ($self) = @_;
+ if (exists $self->{scan_progress_sub}) {
+ return unless ($self->{scan_progress_counter}++ % 50 == 0);
+ $self->{scan_progress_sub}->();
}
}
Modified: spamassassin/trunk/masses/mass-check
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/masses/mass-check?rev=355699&r1=355698&r2=355699&view=diff
==============================================================================
--- spamassassin/trunk/masses/mass-check (original)
+++ spamassassin/trunk/masses/mass-check Fri Dec 9 18:41:02 2005
@@ -33,8 +33,8 @@
is a comma-separated list of facilities)
--progress show progress updates during check
--noisy show noisier progress updates during check
- --rewrite=OUT save rewritten message to OUT (default is /tmp/out)
--showdots print a dot for each scanned message
+ --rewrite=OUT save rewritten message to OUT (default is /tmp/out)
--rules=RE Only test rules matching the given regexp RE
--restart=N restart all of the children after processing N messages
--deencap=RE Extract SpamAssassin-encapsulated spam mails only if they
@@ -289,12 +289,19 @@
'opt_after' => $opt_after,
'opt_before' => $opt_before,
'opt_restart' => $opt_restart,
+ 'scan_progress_sub' => \&scan_progress_cb
});
if ($opt_progress) {
status('starting scan stage');
}
+sub scan_progress_cb {
+ if ($opt_showdots) {
+ print STDERR '.';
+ }
+}
+
$iter->set_functions(\&wanted, \&result);
$iter->run(@targets);
@@ -329,6 +336,8 @@
###########################################################################
sub init_results {
+ print STDERR "\n" if ($opt_showdots);
+
if ($opt_progress) {
# make it a local variable for now
$total_messages = $Mail::SpamAssassin::ArchiveIterator::MESSAGES;
Modified: spamassassin/trunk/masses/rule-qa/automc/ruleqa.cgi
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/masses/rule-qa/automc/ruleqa.cgi?rev=355699&r1=355698&r2=355699&view=diff
==============================================================================
--- spamassassin/trunk/masses/rule-qa/automc/ruleqa.cgi (original)
+++ spamassassin/trunk/masses/rule-qa/automc/ruleqa.cgi Fri Dec 9 18:41:02 2005
@@ -49,7 +49,7 @@
$s{defcorpus} = get_url_switch('s_defcorpus', 1);
$s{html} = get_url_switch('s_html', 0);
$s{net} = get_url_switch('s_net', 0);
-$s{zero} = get_url_switch('s_zero', 0);
+$s{zero} = get_url_switch('s_zero', 1);
$s{new} = get_url_switch('s_new', 1);
$s{detail} = get_url_switch('s_detail', 0);
@@ -266,12 +266,6 @@
<div class=updateform>
<form action="!THISURL!" method=GET>
- <h4> Which Corpus? </h4>
- <input type=checkbox name=s_defcorpus !s_defcorpus!> Show default non-net ruleset and corpus, set 0<br/>
- <input type=checkbox name=s_net !s_net!> Show frequencies from network tests, set 1<br/>
- <input type=checkbox name=s_html !s_html!> Show frequencies for mails containing HTML only, set 0<br/>
- <br/>
-
<table style="padding-left: 0px" class=datetable>
<tr>
@@ -309,6 +303,13 @@
</table>
<br/>
+
+ <h4> Which Corpus? </h4>
+ <input type=checkbox name=s_defcorpus !s_defcorpus!> Show default non-net ruleset and corpus, set 0<br/>
+ <input type=checkbox name=s_net !s_net!> Show frequencies from network tests, set 1<br/>
+ <input type=checkbox name=s_html !s_html!> Show frequencies for mails containing HTML only, set 0<br/>
+ <br/>
+
<h4> Which Rules?</h4>
Show only these rules (space separated, or regexp with '/' prefix):<br/>
<input type=textfield size=60 name=rule value="!rule!"><br/>