text_combined: skip montanaro dwooqfuuguserssourceforgenet update cvsrootspambayesspambayesspambayes directory sc8prcvs8sourceforgenettmpcvsserv20242spambayes modified files tag coresvr coreuipy proxyuipy userinterfacepy log message couple refactorings possible get rid holding state modulelevel global variable pop3 proxy index coreuipy rcs file cvsrootspambayesspambayesspambayesatticcoreuipyv retrieving revision 1128 retrieving revision 1129 diff c2 r1128 r1129 coreuipy 8 jun 2007 020951 0000 1128 coreuipy 8 jun 2007 120846 0000 1129 5458 import sys import import cgi import time 5457 7281 spambayescompatsets import set emailiterators import typed_subpart_iterator import userinterface spambayes import tokenizer spambayesoptions import options load_options get_pathname_option _ spambayes import i18n spambayes import storage spambayes import stats 7178 spambayescompatsets import set import userinterface spambayesoptions import options load_options get_pathname_option _ i18n yet spambayes import i18n spambayes import storage spambayes import stats 161165 selfstate state selfapp_for_version spambayes proxy selfprevious_sort none statecan_stop selfhtml_readonly false 158161 246351 return keys date prior start end def _sortmessagesself messages sort_order reversefalse sorts message appropriate attribute previous sort order reverse sort_order none sort_order received default sorting reverse order appearance complicated received info key messagessort selfprevious_sort sort_order messagesreverse selfprevious_sort none else selfprevious_sort received return messages tmplist getattrx1 sort_order x x messages tmplistsort reverse tmplistreverse return x key x tmplist def _appendmessagesself table keyedmessageinfo label sort_order reversefalse appends rows table messages table stripe 0 keyedmessageinfo self_sortmessageskeyedmessageinfo sort_order reverse nrows optionshtml_ui rows_per_section key messageinfo keyedmessageinfonrows unused unused messageinforeceived self_gettimerangeself_keytotimestampkey row selfhtmlreviewrowclone try score messageinfoscore except valueerror score none label _spam score none score optionshtml_ui spam_discard_level r_att getattrrow discard else r_att getattrrow optionshtml_ui default_spam_action elif label _ham score none score optionshtml_ui ham_discard_level r_att getattrrow discard else r_att getattrrow optionshtml_ui default_ham_action else r_att getattrrow optionshtml_ui default_unsure_action setattrr_att checked 1 rowoptionalheadersvalues make way real list header optionshtml_ui display_headers header headerlower text getattrmessageinfo sheader header header subject subject special links body user doesnt display subject link body h selfhtmlreviewrowlinkedheadervalueclone htexttitle messageinfobodysummary htexthref viewkeyscorpuss key label else h selfhtmlreviewrowheadervalueclone htext text rowoptionalheadersvalues h apart message headers may also wish display message score time message received optionshtml_ui display_score isinstancemessageinfoscore typesstringtypes presumably either err rowscore_ messageinfoscore else rowscore_ 2f messageinfoscore else del rowscore_ optionshtml_ui display_received_time rowreceived_ messageinforeceived else del rowreceived_ many characters cant go url cause problems etc use hex values subj_list c messageinfosubjectheader subj_listappends hexordc2 subj joinsubj_list rowclassifyhref showclueskeyssubjects key subj rowtokenshref showclueskeyssubjectstokens1 key subj setattrrow class stripe_on stripe_offstripe grr setattrrow onmouseout thisclassnamestripe_on thisclassnamestripe_offstripe row strrowreplacetype labelreplacekey key table row stripe stripe 1 def onreviewself params present list message retraining 242245 619631 self_writepostamblehelp_topicreview def _containsself b ignore_casefalse return true substring b part string assert isinstancea typesstringtypes assert isinstanceb typesstringtypes ignore_case alower b blower return afindb 0 def onviewself key corpus view message linked review page 513516 688755 selfwritehtml def _makemessageinfoself message given emailmessage return object subjectheader bodysummary header needed attributes objects passed appendmessages onreview passing emailmessage objects directly uses much memory remove notations displaying see 848365 remove subject annotations message review page messagedelnotations subjectheader messagesubject none headers subject subjectheader header optionshtml_ui display_headers headersheaderlower messageheader none score messageoptionsheaders score_header_name score score might log info end op scorefind op 0 score scoreop try score floatscore 100 except valueerror hmm score header contain floating point number whats going score err let user know something wrong else lookup fails means include_score option isnt activated choice either calculate pretty inefficient since already done admit dont know well go latter score try part typed_subpart_iteratormessage text plainnext text partget_payload except stopiteration try part typed_subpart_iteratormessage text htmlnext text partget_payload text unused tokenizercrack_html_styletext text unused tokenizercrack_html_commenttext text tokenizerhtml_resub text text _this message html bodyn text except stopiteration text _this message text body typetext type got ta right way text _this message digest messages lentext elif text none text _this message body else text textreplace else theyll quoted text resubrss r1 text eg multiple blank lines text textstrip class _messageinfo pass messageinfo _messageinfo headername headervalue headersitems headervalue self_trimheaderheadervalue 45 true setattrmessageinfo sheader headername headervalue messageinfoscore score messageinfobodysummary self_trimheadertext 200 return messageinfo def close_databaseself selfstateclose 573576 824827 645651 selfis_test false selfspamcorpus selfhamcorpus selfunknowncorpus none selfspam_trainer selfham_trainer none selfinit index proxyuipy rcs file cvsrootspambayesspambayesspambayesproxyuipyv retrieving revision 16422 retrieving revision 16423 diff c2 r16422 r16423 proxyuipy 8 jun 2007 020951 0000 16422 proxyuipy 8 jun 2007 120846 0000 16423 5458 true false 1 0 import import cgi import time 5457 7281 spambayescompatsets import set import tokenizer import userinterface spambayesoptions import options _ emailiterators import typed_subpart_iterator global state options offered configuration page 7178 spambayescompatsets import set import userinterface spambayesoptions import options _ state none options offered configuration page 174178 selfstate_recreator state_recreator ugly selfapp_for_version spambayes proxy selfprevious_sort none proxy_statecan_stop selfhtml_readonly false 171174 261365 return keys date prior start end def _sortmessagesself messages sort_order reversefalse sorts message appropriate attribute previous sort order reverse sort_order none sort_order received default sorting reverse order appearance complicated received info key messagessort selfprevious_sort sort_order messagesreverse selfprevious_sort none else selfprevious_sort received return messages tmplist getattrx1 sort_order x x messages tmplistsort reverse tmplistreverse return x key x tmplist def _appendmessagesself table keyedmessageinfo label sort_order reversefalse appends rows table messages table stripe 0 keyedmessageinfo self_sortmessageskeyedmessageinfo sort_order reverse nrows optionshtml_ui rows_per_section key messageinfo keyedmessageinfonrows unused unused messageinforeceived self_gettimerangeself_keytotimestampkey row selfhtmlreviewrowclone try score messageinfoscore except valueerror score none label _spam score none score optionshtml_ui spam_discard_level r_att getattrrow discard else r_att getattrrow optionshtml_ui default_spam_action elif label _ham score none score optionshtml_ui ham_discard_level r_att getattrrow discard else r_att getattrrow optionshtml_ui default_ham_action else r_att getattrrow optionshtml_ui default_unsure_action setattrr_att checked 1 rowoptionalheadersvalues make way real list header optionshtml_ui display_headers header headerlower text getattrmessageinfo sheader header header subject subject special links body user doesnt display subject link body h selfhtmlreviewrowlinkedheadervalueclone htexttitle messageinfobodysummary htexthref viewkeyscorpuss key label else h selfhtmlreviewrowheadervalueclone htext text rowoptionalheadersvalues h apart message headers may also wish display message score time message received optionshtml_ui display_score isinstancemessageinfoscore typesstringtypes presumably either err rowscore_ messageinfoscore else rowscore_ 2f messageinfoscore else del rowscore_ optionshtml_ui display_received_time rowreceived_ messageinforeceived else del rowreceived_ many characters cant go url cause problems etc use hex values subj_list c messageinfosubjectheader subj_listappends hexordc2 subj joinsubj_list rowclassifyhrefshowclueskeyssubjects key subj rowtokenshrefshowclueskeyssubjectstokens1 key subj setattrrow class stripe_on stripe_offstripe grr setattrrow onmouseout thisclassnamestripe_on thisclassnamestripe_offstripe row strrowreplacetype labelreplacekey key table row stripe stripe 1 def onreviewself params present list message retraining 257260 632644 self_writepostamblehelp_topicreview def _containsself b ignore_casefalse return true substring b part string assert isinstancea typesstringtypes assert isinstanceb typesstringtypes ignore_case alower b blower return afindb 0 def onviewself key corpus view message linked review page 527530 685752 self_writepostamble def _makemessageinfoself message given emailmessage return object subjectheader bodysummary header needed attributes objects passed appendmessages onreview passing emailmessage objects directly uses much memory remove notations displaying see 848365 remove subject annotations message review page messagedelnotations subjectheader messagesubject none headers subject subjectheader header optionshtml_ui display_headers headersheaderlower messageheader none score messageoptionsheaders score_header_name score score might log info end op scorefind op 0 score scoreop try score floatscore 100 except valueerror hmm score header contain floating point number whats going score err let user know something wrong else lookup fails means include_score option isnt activated choice either calculate pretty inefficient since already done admit dont know well go latter score try part typed_subpart_iteratormessage text plainnext text partget_payload except stopiteration try part typed_subpart_iteratormessage text htmlnext text partget_payload text unused tokenizercrack_html_styletext text unused tokenizercrack_html_commenttext text tokenizerhtml_resub text text _this message html bodyn text except stopiteration text _this message text body typetext type got ta right way text _this message digest messages lentext elif text none text _this message body else text textreplace else theyll quoted text resubrss r1 text eg multiple blank lines text textstrip class _messageinfo pass messageinfo _messageinfo headername headervalue headersitems headervalue self_trimheaderheadervalue 45 true setattrmessageinfo sheader headername headervalue messageinfoscore score messageinfobodysummary self_trimheadertext 200 return messageinfo def close_databaseself stateclose 571574 index userinterfacepy rcs file cvsrootspambayesspambayesspambayesuserinterfacepyv retrieving revision 16122 retrieving revision 16123 diff c2 r16122 r16123 userinterfacepy 8 jun 2007 020951 0000 16122 userinterfacepy 8 jun 2007 120846 0000 16123 8083 8084 import types import stringio emailiterators import typed_subpart_iterator import oe_mailbox 277280 278282 selfstats stats selfapp_for_version none subclasses must fill selfprevious_sort none def onclassifyself file text 12711273 12731448 return timemktimestart timemktimeend date def _sortmessagesself messages sort_order reversefalse sorts message appropriate attribute previous sort order reverse sort_order none sort_order received default sorting reverse order appearance complicated received info key messagessort selfprevious_sort sort_order messagesreverse selfprevious_sort none else selfprevious_sort received return messages tmplist getattrx1 sort_order x x messages tmplistsort reverse tmplistreverse return x key x tmplist def _appendmessagesself table keyedmessageinfo label sort_order reversefalse appends rows table messages table stripe 0 keyedmessageinfo self_sortmessageskeyedmessageinfo sort_order reverse nrows optionshtml_ui rows_per_section key messageinfo keyedmessageinfonrows unused unused messageinforeceived self_gettimerangeself_keytotimestampkey row selfhtmlreviewrowclone try score messageinfoscore except valueerror score none label _spam score none score optionshtml_ui spam_discard_level r_att getattrrow discard else r_att getattrrow optionshtml_ui default_spam_action elif label _ham score none score optionshtml_ui ham_discard_level r_att getattrrow discard else r_att getattrrow optionshtml_ui default_ham_action else r_att getattrrow optionshtml_ui default_unsure_action setattrr_att checked 1 rowoptionalheadersvalues make way real list header optionshtml_ui display_headers header headerlower text getattrmessageinfo sheader header header subject subject special links body user doesnt display subject link body h selfhtmlreviewrowlinkedheadervalueclone htexttitle messageinfobodysummary htexthref viewkeyscorpuss key label else h selfhtmlreviewrowheadervalueclone htext text rowoptionalheadersvalues h apart message headers may also wish display message score time message received optionshtml_ui display_score isinstancemessageinfoscore typesstringtypes presumably either err rowscore_ messageinfoscore else rowscore_ 2f messageinfoscore else del rowscore_ optionshtml_ui display_received_time rowreceived_ messageinforeceived else del rowreceived_ many characters cant go url cause problems etc use hex values subj_list c messageinfosubjectheader subj_listappends hexordc2 subj joinsubj_list rowclassifyhref showclueskeyssubjects key subj rowtokenshref showclueskeyssubjectstokens1 key subj setattrrow class stripe_on stripe_offstripe grr setattrrow onmouseout thisclassnamestripe_on thisclassnamestripe_offstripe row strrowreplacetype labelreplacekey key table row stripe stripe 1 def _containsself b ignore_casefalse return true substring b part string assert isinstancea typesstringtypes assert isinstanceb typesstringtypes ignore_case alower b blower return afindb 0 def _makemessageinfoself message given emailmessage return object subjectheader bodysummary header needed attributes objects passed appendmessages onreview passing emailmessage objects directly uses much memory remove notations displaying see 848365 remove subject annotations message review page messagedelnotations subjectheader messagesubject none headers subject subjectheader header optionshtml_ui display_headers headersheaderlower messageheader none score messageoptionsheaders score_header_name score score might log info end op scorefind op 0 score scoreop try score floatscore 100 except valueerror hmm score header contain floating point number whats going score err let user know something wrong else lookup fails means include_score option isnt activated choice either calculate pretty inefficient since already done admit dont know well go latter score try part typed_subpart_iteratormessage text plainnext text partget_payload except stopiteration try part typed_subpart_iteratormessage text htmlnext text partget_payload text unused tokenizercrack_html_styletext text unused tokenizercrack_html_commenttext text tokenizerhtml_resub text text _this message html bodyn text except stopiteration text _this message text body typetext type got ta right way text _this message digest messages lentext elif text none text _this message body else text textreplace else theyll quoted text resubrss r1 text eg multiple blank lines text textstrip class _messageinfo pass messageinfo _messageinfo headername headervalue headersitems headervalue self_trimheaderheadervalue 45 true setattrmessageinfo sheader headername headervalue messageinfoscore score messageinfobodysummary self_trimheadertext 200 return messageinfo _______________________________________________ spambayescheckins mailing list pnperxdpvsarswdlppythonorg httpmailpythonorgmailmanlistinfospambayescheckins tue 05 aug 2008 173358 0700 spambayescheckins spambayesspambayes coreuipy 1128 1129 proxyuipy 16422 16423 userinterfacepy 16122 16123