[Spambayes-checkins] spambayes/Outlook2000 manager.py,1.4,1.5
Tim Peters
tim_one@users.sourceforge.net
Sat, 19 Oct 2002 15:39:44 -0700
Update of /cvsroot/spambayes/spambayes/Outlook2000
In directory usw-pr-cvs1:/tmp/cvs-serv17127
Modified Files:
manager.py
Log Message:
Folded the very long lines.
Index: manager.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/manager.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** manager.py 19 Oct 2002 22:30:02 -0000 1.4
--- manager.py 19 Oct 2002 22:39:41 -0000 1.5
***************
*** 13,17 ****
# Suck in CDO type lib
! win32com.client.gencache.EnsureModule('{3FA7DEA7-6438-101B-ACC1-00AA00423326}', 0, 1, 21, bForDemand = True)
try:
--- 13,18 ----
# Suck in CDO type lib
! win32com.client.gencache.EnsureModule('{3FA7DEA7-6438-101B-ACC1-00AA00423326}',
! 0, 1, 21, bForDemand=True)
try:
***************
*** 27,31 ****
self.verbose = verbose
if not os.path.isabs(config_base):
! config_base = os.path.join( os.path.dirname(this_filename), config_base)
config_base = os.path.abspath(config_base)
self.ini_filename = config_base + "_bayes_customize.ini"
--- 28,33 ----
self.verbose = verbose
if not os.path.isabs(config_base):
! config_base = os.path.join(os.path.dirname(this_filename),
! config_base)
config_base = os.path.abspath(config_base)
self.ini_filename = config_base + "_bayes_customize.ini"
***************
*** 52,61 ****
def WorkerThreadEnding(self):
! assert self._tls.has_key(thread.get_ident()), "WorkerThreadStarting hasn't been called for this thread"
del self._tls[thread.get_ident()]
pythoncom.CoUninitialize()
def GetOutlookForCurrentThread(self):
! assert self._tls.has_key(thread.get_ident()), "WorkerThreadStarting hasn't been called for this thread"
existing = self._tls[thread.get_ident()].get("outlook")
if not existing:
--- 54,65 ----
def WorkerThreadEnding(self):
! assert self._tls.has_key(thread.get_ident()), \
! "WorkerThreadStarting hasn't been called for this thread"
del self._tls[thread.get_ident()]
pythoncom.CoUninitialize()
def GetOutlookForCurrentThread(self):
! assert self._tls.has_key(thread.get_ident()), \
! "WorkerThreadStarting hasn't been called for this thread"
existing = self._tls[thread.get_ident()].get("outlook")
if not existing:
***************
*** 66,70 ****
def LoadBayes(self):
if not os.path.exists(self.ini_filename):
! raise ManagerError("The file '%s' must exist before the database '%s' can be opened or created" % (self.ini_filename, self.bayes_filename))
bayes = None
try:
--- 70,76 ----
def LoadBayes(self):
if not os.path.exists(self.ini_filename):
! raise ManagerError("The file '%s' must exist before the "
! "database '%s' can be opened or created" % (
! self.ini_filename, self.bayes_filename))
bayes = None
try:
***************
*** 81,85 ****
bayes = self.bayes
if self.verbose:
! print "Bayes database initialized with %d spam and %d good messages" % (bayes.nspam, bayes.nham)
self.bayes = bayes
self.bayes_dirty = False
--- 87,92 ----
bayes = self.bayes
if self.verbose:
! print ("Bayes database initialized with "
! "%d spam and %d good messages" % (bayes.nspam, bayes.nham))
self.bayes = bayes
self.bayes_dirty = False
***************
*** 89,98 ****
ret = cPickle.load(open(self.config_filename,'rb'))
if self.verbose > 1:
! print "Loaded configuration from '%s':" % (self.config_filename,)
ret._dump()
except (AttributeError, ImportError):
ret = _ConfigurationRoot()
if self.verbose > 1:
! print "FAILED to load configuration from '%s - using default:" % (self.config_filename,)
import traceback
traceback.print_exc()
--- 96,106 ----
ret = cPickle.load(open(self.config_filename,'rb'))
if self.verbose > 1:
! print "Loaded configuration from '%s':" % self.config_filename
ret._dump()
except (AttributeError, ImportError):
ret = _ConfigurationRoot()
if self.verbose > 1:
! print ("FAILED to load configuration from '%s "
! "- using default:" % self.config_filename)
import traceback
traceback.print_exc()
***************
*** 107,111 ****
bayes = self.bayes
if self.verbose:
! print "Saving bayes database with %d spam and %d good messages" % (bayes.nspam, bayes.nham)
print " ->", self.bayes_filename
cPickle.dump(bayes, open(self.bayes_filename,"wb"), 1)
--- 115,120 ----
bayes = self.bayes
if self.verbose:
! print ("Saving bayes database with %d spam and %d good messages" %
! (bayes.nspam, bayes.nham))
print " ->", self.bayes_filename
cPickle.dump(bayes, open(self.bayes_filename,"wb"), 1)