[Spambayes-checkins] spambayes pop3proxy.py,1.95,1.96
Richie Hindle
richiehindle at users.sourceforge.net
Sat Aug 30 18:29:09 EDT 2003
Update of /cvsroot/spambayes/spambayes
In directory sc8-pr-cvs1:/tmp/cvs-serv10637
Modified Files:
pop3proxy.py
Log Message:
The pop3proxy_service shutdown code now goes through the same
shutdown procedure as the web UI's Shutdown button.
Resolved an ugly cyclic dependency problem between pop3proxy and
smtpproxy.
Index: pop3proxy.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/pop3proxy.py,v
retrieving revision 1.95
retrieving revision 1.96
diff -C2 -d -r1.95 -r1.96
*** pop3proxy.py 30 Aug 2003 22:45:04 -0000 1.95
--- pop3proxy.py 31 Aug 2003 00:29:07 -0000 1.96
***************
*** 93,97 ****
from email.Header import Header
- import smtpproxy
import spambayes.message
from spambayes import Dibbler
--- 93,96 ----
***************
*** 739,742 ****
--- 738,742 ----
# SMTP proxy information in their configuration, then nothing will
# happen.
+ import smtpproxy
servers, proxyPorts = smtpproxy.LoadServerInfo()
smtpproxy.CreateProxies(servers, proxyPorts, state)
***************
*** 750,756 ****
def stop(state):
! state.bayes.store()
! # should we be calling socket.shutdown(2) and close_when_done() for each
! # BayesProxy object?
# ===================================================================
--- 750,760 ----
def stop(state):
! # Shutdown as though through the web UI. This will save the DB, allow
! # any open proxy connections to complete, etc.
! from urllib2 import urlopen
! from urllib import urlencode
! urlopen('http://localhost:%d/save' % state.uiPort,
! urlencode({'how': 'Save & shutdown'})).read()
!
# ===================================================================
More information about the Spambayes-checkins
mailing list