[Spambayes-checkins] spambayes/spambayes CorePlugin.py, 1.1.2.3, 1.1.2.4 XMLRPCPlugin.py, 1.1.2.9, 1.1.2.10
Skip Montanaro
montanaro at users.sourceforge.net
Thu Jun 7 04:50:17 CEST 2007
Update of /cvsroot/spambayes/spambayes/spambayes
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv17014
Modified Files:
Tag: CORESVR
CorePlugin.py XMLRPCPlugin.py
Log Message:
a couple small cleanups suggested by pylint
Index: CorePlugin.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/Attic/CorePlugin.py,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -d -r1.1.2.3 -r1.1.2.4
*** CorePlugin.py 2 Jun 2007 21:42:08 -0000 1.1.2.3
--- CorePlugin.py 7 Jun 2007 02:50:13 -0000 1.1.2.4
***************
*** 3,8 ****
"""
- import sys
-
__author__ = "Skip Montanaro <skip at pobox.com"
__credits__ = "The Spambayes folk."
--- 3,6 ----
***************
*** 12,15 ****
--- 10,14 ----
self.name = name
self.ui = ui
+ self.state = None
class PluginUI:
Index: XMLRPCPlugin.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/Attic/XMLRPCPlugin.py,v
retrieving revision 1.1.2.9
retrieving revision 1.1.2.10
diff -C2 -d -r1.1.2.9 -r1.1.2.10
*** XMLRPCPlugin.py 6 Jun 2007 23:29:13 -0000 1.1.2.9
--- XMLRPCPlugin.py 7 Jun 2007 02:50:13 -0000 1.1.2.10
***************
*** 40,47 ****
import xmlrpclib
from email import Message, message_from_string
! from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
! from CorePlugin import Plugin, PluginUI
! from spambayes.OptionsClass import *
from spambayes.Options import _, options
from spambayes.tokenizer import tokenize
--- 40,46 ----
import xmlrpclib
from email import Message, message_from_string
! from SimpleXMLRPCServer import SimpleXMLRPCServer
! from spambayes.CorePlugin import Plugin, PluginUI
from spambayes.Options import _, options
from spambayes.tokenizer import tokenize
***************
*** 92,95 ****
--- 91,99 ----
if self.state.bayes is None:
self.state.create_workers()
+ # Get msg_text into canonical string representation.
+ # Make sure we have a unicode object...
+ if isinstance(msg_text, str):
+ msg_text = unicode(msg_text, encoding)
+ # ... then encode it as utf-8.
if isinstance(msg_text, unicode):
msg_text = msg_text.encode("utf-8")
More information about the Spambayes-checkins
mailing list