[Spambayes-checkins] spambayes/spambayes UserInterface.py, 1.38,
1.39
Tony Meyer
anadelonbrin at users.sourceforge.net
Sun Dec 21 21:31:42 EST 2003
Update of /cvsroot/spambayes/spambayes/spambayes
In directory sc8-pr-cvs1:/tmp/cvs-serv5012/spambayes
Modified Files:
UserInterface.py
Log Message:
Move OE specific stuff out from UserInterface.py to oe_mailbox.py.
Make PyChecker more happy.
Index: UserInterface.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/UserInterface.py,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** UserInterface.py 16 Dec 2003 05:06:34 -0000 1.38
--- UserInterface.py 22 Dec 2003 02:31:39 -0000 1.39
***************
*** 519,562 ****
DBX one is very quick (just a matter of checking the first few
bytes), and should not alter the overall performance."""
!
! dbxStream = StringIO.StringIO(content)
! header = oe_mailbox.dbxFileHeader(dbxStream)
!
! if header.isValid() and header.isMessages():
! file_info_len = oe_mailbox.dbxFileHeader.FH_FILE_INFO_LENGTH
! fh_entries = oe_mailbox.dbxFileHeader.FH_ENTRIES
! fh_ptr = oe_mailbox.dbxFileHeader.FH_TREE_ROOT_NODE_PTR
!
! info = oe_mailbox.dbxFileInfo(dbxStream,
! header.getEntry(file_info_len))
! entries = header.getEntry(fh_entries)
! address = header.getEntry(fh_ptr)
!
! if address and entries:
! tree = oe_mailbox.dbxTree(dbxStream, address, entries)
! dbxBuffer = ""
!
! for i in range(entries):
! address = tree.getValue(i)
! messageInfo = oe_mailbox.dbxMessageInfo(dbxStream,
! address)
!
! if messageInfo.isIndexed(\
! oe_mailbox.dbxMessageInfo.MI_MESSAGE_ADDRESS):
! address = oe_mailbox.dbxMessageInfo.MI_MESSAGE_ADDRESS
! messageAddress = \
! messageInfo.getValueAsLong(address)
! message = oe_mailbox.dbxMessage(dbxStream,
! messageAddress)
!
! # This fakes up a from header to conform to mbox
! # standards. It would be better to extract this
! # data from the message itself, as this will
! # result in incorrect tokens.
! dbxBuffer += "From spambayes at spambayes.org %s\n%s" \
! % (strftime("%a %b %d %H:%M:%S MET %Y",
! gmtime()), message.getText())
! content = dbxBuffer
! dbxStream.close()
return content
--- 519,523 ----
DBX one is very quick (just a matter of checking the first few
bytes), and should not alter the overall performance."""
! content = oe_mailbox.convertToMbox(content)
return content
***************
*** 651,654 ****
--- 612,618 ----
html.mainContent.configFormContent = ""
html.mainContent.optionsPathname = optionsPathname
+ return self._buildConfigPageBody(html, parm_map)
+
+ def _buildConfigPageBody(self, html, parm_map):
configTable = None
section = None
***************
*** 716,723 ****
# Tim thinks that Yes/No makes more sense than True/False
if options.is_boolean(sect, opt):
! if val == False:
! val = "No"
! elif val == True:
val = "Yes"
newOption.val_label = str(val)
newOption.input_box.value = str(val)
--- 680,687 ----
# Tim thinks that Yes/No makes more sense than True/False
if options.is_boolean(sect, opt):
! if val is True:
val = "Yes"
+ elif val is False:
+ val = "No"
newOption.val_label = str(val)
newOption.input_box.value = str(val)
More information about the Spambayes-checkins
mailing list