[Spambayes-checkins] spambayes/spambayes UserInterface.py, 1.19,
1.20
Richie Hindle
richiehindle at users.sourceforge.net
Sat Aug 30 15:35:18 EDT 2003
Update of /cvsroot/spambayes/spambayes/spambayes
In directory sc8-pr-cvs1:/tmp/cvs-serv17685
Modified Files:
UserInterface.py
Log Message:
[ 797776 ] Update the web UI's Upload form to reflect the fact that
you can now upload Outlook Express DBX files.
Index: UserInterface.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/UserInterface.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** UserInterface.py 28 Aug 2003 21:17:29 -0000 1.19
--- UserInterface.py 30 Aug 2003 21:35:16 -0000 1.20
***************
*** 296,300 ****
# Attempt to convert the content from a DBX file to a standard mbox
if file:
! content = self._convertOutlookExpressToMbox(content)
# Convert platform-specific line endings into unix-style.
--- 296,300 ----
# Attempt to convert the content from a DBX file to a standard mbox
if file:
! content = self._convertToMbox(content)
# Convert platform-specific line endings into unix-style.
***************
*** 329,338 ****
self._writePostamble()
! def _convertOutlookExpressToMbox(self, content):
! """Check if the uploaded mailbox file is an Outlook Express DBX one.
!
In such a case we use the module oe_mailbox to convert the DBX
! content into a standard mbox file. When the file is not a DBX one,
! this method returns the original content. Testing if the file is a
DBX one is very quick (just a matter of checking the first few
bytes), and should not alter the overall performance."""
--- 329,339 ----
self._writePostamble()
! def _convertToMbox(self, content):
! """Check if the given buffer is in a non-mbox format, and convert it
! into mbox format if so. If it's already an mbox, return it unchanged.
!
! Currently, the only supported non-mbox format is Outlook Express DBX.
In such a case we use the module oe_mailbox to convert the DBX
! content into a standard mbox file. Testing if the file is a
DBX one is very quick (just a matter of checking the first few
bytes), and should not alter the overall performance."""
***************
*** 434,438 ****
form = self.html.upload.clone()
del form.submit_classify
! return self._buildBox("Train on a given message", 'message.gif', form)
def reReadOptions(self):
--- 435,440 ----
form = self.html.upload.clone()
del form.submit_classify
! return self._buildBox("Train on a message, mbox file or dbx file",
! 'message.gif', form)
def reReadOptions(self):
More information about the Spambayes-checkins
mailing list