[Spambayes-checkins] spambayes/scripts sb_filter.py,1.17,1.18
Skip Montanaro
montanaro at users.sourceforge.net
Fri Jun 3 03:13:19 CEST 2005
Update of /cvsroot/spambayes/spambayes/scripts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20591
Modified Files:
sb_filter.py
Log Message:
If database doesn't exist, initialize it. Closes the ancient #759917.
Index: sb_filter.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/scripts/sb_filter.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** sb_filter.py 1 Apr 2005 04:11:22 -0000 1.17
--- sb_filter.py 3 Jun 2005 01:13:17 -0000 1.18
***************
*** 151,155 ****
os.path.expanduser('~/.hammierc')])
self.dbname, self.usedb = storage.database_type([])
! self.h = None
def open(self, mode):
--- 151,155 ----
os.path.expanduser('~/.hammierc')])
self.dbname, self.usedb = storage.database_type([])
! self.mode = self.h = None
def open(self, mode):
***************
*** 172,176 ****
self.open('n')
self.close()
- print >> sys.stderr, "Created new database in", self.dbname
def filter(self, msg):
--- 172,175 ----
***************
*** 231,237 ****
h.dbname, h.usedb = storage.database_type(opts)
! if create_newdb:
h.newdb()
! sys.exit(0)
if actions == []:
--- 230,238 ----
h.dbname, h.usedb = storage.database_type(opts)
! if create_newdb or not os.path.exists(h.dbname):
h.newdb()
! print >> sys.stderr, "Created new database in", h.dbname
! if create_newdb:
! sys.exit(0)
if actions == []:
More information about the Spambayes-checkins
mailing list