skip montanaro dwooqfuuguserssourceforgenet update cvsrootspambayesspambayesspambayes directory sc8prcvs8sourceforgenettmpcvsserv31847spambayes modified files xmlrpcpluginpy log message add train train_mime methods xmlrpc plugin come marian neagul index xmlrpcpluginpy rcs file cvsrootspambayesspambayesspambayesxmlrpcpluginpyv retrieving revision 12 retrieving revision 13 diff c2 r12 r13 xmlrpcpluginpy 10 jun 2007 152736 0000 12 xmlrpcpluginpy 14 jul 2007 231309 0000 13 3740 3747 __author__ skip montanaro __credits__ spambayes folk module part spambayes project copyright 2002 python software foundation covered python software foundation license import threading import xmlrpclib 7082 def _dispatchself method params method score score_mime return getattrself methodparams else raise xmlrpclibfault404 supported method def scoreself form_dict extra_tokens attachments score dictionary extra tokens mime_message form_to_mimeform_dict extra_tokens attachments mime_message unicodemime_messageencodeutf8 return selfscore_mimemime_message utf8 77170 def _dispatchself method params method score score_mime train train_mime return getattrself methodparams else raise xmlrpclibfault404 supported method def trainself form_dict extra_tokens attachments is_spamtrue newdict k form_dictitems typekunicode k kencodeutf8 newdicti k mime_message form_to_mimenewdict extra_tokens attachments mime_message unicodemime_messageas_string utf8encodeutf8 selftrain_mimemime_message utf8 is_spam return def train_mimeself msg_text encoding is_spam selfstatebayes none selfstatecreate_workers get msg_text canonical string representation make sure unicode object isinstancemsg_text str msg_text unicodemsg_text encoding encode utf8 isinstancemsg_text unicode msg_text msg_textencodeutf8 msg message_from_stringmsg_text _classspambayesmessagesbheadermessage tokens tokenizemsg is_spam desired_corpus spamcorpus else desired_corpus hamcorpus hasattrself desired_corpus corpus getattrself desired_corpus else hasattrself state corpus getattrselfstate desired_corpus setattrself desired_corpus corpus selfmsg_name_func selfstategetnewmessagename else isspam fn storageget_pathname_optionstorage spam_cache else fn storageget_pathname_optionstorage ham_cache storageensuredirfn optionsstorage cache_use_gzip factory filecorpusgzipfilemessagefactory else factory filecorpusfilemessagefactory age optionsstorage cache_expiry_days246060 corpus filecorpusexpiryfilecorpusage factory fn 0123456789 cachesize20 setattrself desired_corpus corpus class uniquenamerobject count 1 def generate_nameself selfcount 1 return 1010dd longtimetime selfcount namer uniquenamer selfmsg_name_func namergenerate_name key selfmsg_name_func mime_message unicodemsgas_string utf8encodeutf8 msg corpusmakemessagekey mime_message msgsetidkey corpusaddmessagemsg msgremembertrainedis_spam selfstatsrecordtrainingnot is_spam is_spam selfstatebayesnspam 1 else selfstatebayesnham 1 def train_spamself form_dict extra_tokens attachments pass def train_hamself form_dict extra_tokens attachments pass def scoreself form_dict extra_tokens attachments score dictionary extra tokens newdict k form_dictitems isinstancekunicode k kencodeutf8 newdicti k mime_message form_to_mimenewdict extra_tokens attachments mime_message unicodemime_messageas_string utf8encodeutf8 return selfscore_mimemime_message utf8 _______________________________________________ spambayescheckins mailing list pnperxdpvsarswdlppythonorg httpmailpythonorgmailmanlistinfospambayescheckins tue 05 aug 2008 181046 0700 spambayescheckins spambayesspambayes xmlrpcpluginpy1213