|
From: <jgr...@us...> - 2003-10-20 15:05:21
|
Update of /cvsroot/popfile/engine/UI
In directory sc8-pr-cvs1:/tmp/cvs-serv22773/UI
Modified Files:
HTML.pm
Log Message:
Create test suites for the utility scripts:
insert.pl
bayes.pl
pipe.pl
insert.pl:
Added code to detect errors (file does not exist,
bucket does not exist), output error messages and
return an error code.
Make sure that all POPFile modules are cleaned up
when done.
bayes.pl:
Added code to detect errors (file does not exist),
output error messages and return an error code.
Make sure that all POPFile modules are cleaned up
when done.
pipe.pl:
Make sure that all POPFile modules are cleaned up
when done.
Pass in \n as the end of line character so that the
STDOUT output will have the right end of line character
for the platform pipe.pl is being used on. If this
is not done then POPFile will use the standard network
line ending: \r\n.
Classifer/Bayes.pm:
Add reference to IO::Handle since we need it for
flush.
Add an optional $crlf option to classify_and_modify so
that it can be used with non-network streams that require
an EOL different from \r\n.
If classify_and_modify is told not to save the file in
the history then there's no need to save the file even
temporarily because the streaming parsing added in v0.20.0
doesn't need a copy of the message on disk.
write_line__ might now be passed an undef file handle so
don't try to write to it.
If we are not saving the classification to the history
then don't add the XPL header (or the equivalent link
in a quarantined message) since it wont work.
POPFile/Configuration.pm:
Add code to determine whether there has been a
configuration change. This is done to prevent the
configuration being saved when nothing has changed.
This is particularly needed by the scripts which wont
change the configuration and shouldn't have the code
of a save.
tests/TestInsertScript.tst:
Test suite for insert.pl.
tests/TestBayesScript.tst:
Test suite for bayes.pl.
tests/TestPipeScript.tst:
Test suite for pipe.pl.
Index: HTML.pm
===================================================================
RCS file: /cvsroot/popfile/engine/UI/HTML.pm,v
retrieving revision 1.217
retrieving revision 1.218
diff -C2 -d -r1.217 -r1.218
*** HTML.pm 15 Oct 2003 16:53:14 -0000 1.217
--- HTML.pm 20 Oct 2003 12:53:50 -0000 1.218
***************
*** 133,136 ****
--- 133,140 ----
$self->{last_login__} = '';
+ # Used to determine whehter the cache needs to be saved
+
+ $self->{save_cache__} = 0;
+
# Must call bless before attempting to call any methods
***************
*** 2487,2490 ****
--- 2491,2498 ----
my ( $self ) = @_;
+ if ( $self->{save_cache__} == 0 ) {
+ return;
+ }
+
open CACHE, '>' . $self->global_config_( 'msgdir' ) . 'history_cache';
print CACHE "___HISTORY__ __ VERSION__ 1\n";
***************
*** 3766,3769 ****
--- 3774,3778 ----
$added = 1;
delete $self->{history_pre_cache__}{$file};
+ $self->{save_cache__} = 1;
}
|