text_combined: skip montanaro dwooqfuuguserssourceforgenet update cvsrootspambayesspambayesspambayes directory sc8prcvs8sourceforgenettmpcvsserv7512spambayes modified files optionspy proxyuipy userinterfacepy dnscachepy storagepy added files corepluginpy coreuipy xmlrpcpluginpy log message merge coresvr branch head adds new app scriptscore_serverpy attendant bits xmlrpc plugin web interface straight pop3 proxy server index optionspy rcs file cvsrootspambayesspambayesspambayesoptionspyv retrieving revision 1141 retrieving revision 1142 diff c2 r1141 r1142 optionspy 26 mar 2007 075713 0000 1141 optionspy 10 jun 2007 152736 0000 1142 653656 653671 path do_not_restore core_spam_cache _spam cache directory corespamcache _directory spambayes cache spam exist created path do_not_restore core_ham_cache _ham cache directory corehamcache _directory spambayes cache ham exist created path do_not_restore core_unknown_cache _unknown cache directory coreunknowncache _directory spambayes cache unclassified messages exist created path do_not_restore cache_messages _cache messages true _you disable pop3proxy caching messages 12801283 12951309 rww_ww restore plugin xmlrpc_path _xmlrpc path sbrpc _the path respond rw restore xmlrpc_host _xmlrpc host localhost _the host listen server restore xmlrpc_port _xmlrpc port 8001 _the port listen rd restore index proxyuipy rcs file cvsrootspambayesspambayesspambayesproxyuipyv retrieving revision 164 retrieving revision 165 diff c2 r164 r165 proxyuipy 28 nov 2005 105418 0000 164 proxyuipy 10 jun 2007 152736 0000 165 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 111115 like hese options offered advanced configuration page adv_map 108112 like options offered advanced configuration page adv_map 174178 selfstate_recreator state_recreator ugly selfapp_for_version spambayes proxy selfprevious_sort none proxy_statecan_stop selfhtml_readonly false 171174 221241 selfwrite_ok return home def _keytotimestampself key given message key seen corpus returns timestamp message time message received date header return longkey10 def _gettimerangeself timestamp given unix timestamp returns 3tuple start timestamp given day end timestamp given day formatted date given day timelocaltimetimestamp start this0 this1 this2 0 0 0 this6 this7 this8 end timelocaltimetimemktimestart 366060 end end0 end1 end2 0 0 0 end6 end7 end8 date timestrftimea b start return timemktimestart timemktimeend date def _buildreviewkeysself timestamp builds ordered list untrained message keys ready output 217220 278382 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 619626 shoptionalheaders h selfhtmlheaderheaderclone header optionshtml_ui display_headers hheaderlinkhref reviewsortsheader headerlower hheadername headertitle shoptionalheaders h optionshtml_ui display_score 497504 shoptionalheaders h selfhtmlheaderheaderclone disp_header optionshtml_ui display_headers hheaderlinkhref reviewsortsheader disp_headerlower hheadername disp_headertitle shoptionalheaders h optionshtml_ui display_score 649661 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 702769 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 161 retrieving revision 162 diff c2 r161 r162 userinterfacepy 28 nov 2005 105312 0000 161 userinterfacepy 10 jun 2007 152736 0000 162 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 820823 822827 elif parmshow _save experimental options pmap experimental_ini_map elif parmshow _save plugin options pmap selfplugin_ini_map del parmshow html self_gethtmlclone 12511252 12551448 linesappendjoincur_line return lines def _keytotimestampself key given message key seen corpus returns timestamp message time message received date header return longkey10 def _gettimerangeself timestamp given unix timestamp returns 3tuple start timestamp given day end timestamp given day formatted date given day timelocaltimetimestamp start this0 this1 this2 0 0 0 this6 this7 this8 end timelocaltimetimemktimestart 366060 end end0 end1 end2 0 0 0 end6 end7 end8 date timestrftimea b start 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 index dnscachepy rcs file cvsrootspambayesspambayesspambayesdnscachepyv retrieving revision 13 retrieving revision 14 diff c2 r13 r14 dnscachepy 13 aug 2006 020543 0000 13 dnscachepy 10 jun 2007 152736 0000 14 2329 kcheckforpruneevery20 kmaxttl60 60 24 7 one week kprunethreshold1500 may go slightly numbers chosen random kprunedownto1000 2332 kcheckforpruneevery20 kmaxttl60 60 24 7 one week servers always return ttl zero well hold onto data bit longer kminttl24 60 60 1 one day kprunethreshold5000 may go slightly numbers chosen random kprunedownto2500 8997 selfdnstimeout10 servers always return ttl zero cases turning bit probably reasonable selfminttl0 end usersettable attributes 9295 160164 cselfcachesanswerqtype canswerquestionremoveanswer lencanswerquestion0 del canswerquestion 158162 cselfcachesanswerqtype canswerquestionremoveanswer canswerquestion del canswerquestion 180184 cselfcachesanswerqtype canswerquestionremoveanswer lencanswerquestion0 del canswerquestion 178182 cselfcachesanswerqtype canswerquestionremoveanswer canswerquestion del canswerquestion 218233 pass else assert lenanswers0 ind0 guarantee expire already done ind sysstderr lookup failure question answers del cachetolookinquestion else 250275 except dnsbasednserrordetail detailargs0timeout print error fixmedetail print question wasqueryquestion print origianal question wasquestion print type wasqtype objs lookupresultqtypenonequestionselfcacheerrorsecsnownow cachetolookinquestionobjs add format return return selfformatforreturnobjs except socketgaierrordetail print dns connection failure selfqueryobjns detail print defaults dnsdefaults objs answer replyanswers answertypenameqtype pydns returns ttls longs rfc 1035 says ttl value signed 32bit value must positive safe coerce python integer anyone sets time live 2311 seconds 68 years change drunk arguably ought impose maximum rather continuing longs intlong returns long recent versions python ttlmaxminintanswerttlkmaxttlselfminttl rfc 2308 says cache nxdomain minimum minimum field soa record ttl 250275 except dnsbasednserrordetail detailargs0timeout print sysstderr error fixme detail print sysstderr question queryquestion print sysstderr original question question print sysstderr type qtype objs lookupresultqtypenonequestionselfcacheerrorsecsnownow cachetolookinquestionobjs add format return return selfformatforreturnobjs except socketgaierrordetail print sysstderr dns connection failure selfqueryobjns detail print sysstderr defaults dnsdefaults objs answer replyanswers answertypenameqtype pydns returns ttls longs rfc 1035 says ttl value signed 32bit value must positive safe coerce python integer anyone sets time live 2311 seconds 68 years change drunk arguably ought impose maximum rather continuing longs intlong returns long recent versions python ttlmaxminintanswerttlkmaxttlkminttl rfc 2308 says cache nxdomain minimum minimum field soa record ttl 279288 objsappenditem lenobjs0 cachetolookinquestionobjs return selfformatforreturnobjs probably servfail like lenreplyauthority0 objs lookupresultqtypenonequestionselfcacheerrorsecsnownow cachetolookinquestionobjs 279288 objsappenditem objs cachetolookinquestionobjs return selfformatforreturnobjs probably servfail like replyauthority objs lookupresultqtypenonequestionselfcacheerrorsecsnownow cachetolookinquestionobjs 319329 wwwseeputoforcom wwwcompletegarbagetv wwwtradelinkllccom print checking host nowtimetime ipsclookuphost print ipstimetimenow nowtimetime ipsclookuphost print ipstimetimenow ips 319329 wwwseeputoforcom wwwcompletegarbagetv wwwtradelinkllccom print sysstderr checking host nowtimetime ipsclookuphost print sysstderr ipstimetimenow nowtimetime ipsclookuphost print sysstderr ipstimetimenow ips 331340 nowtimetime nameclookupipqtypeptr print nametimetimenow nowtimetime nameclookupipqtypeptr print nametimetimenow else print unknown cclose 331340 nowtimetime nameclookupipqtypeptr print sysstderr nametimetimenow nowtimetime nameclookupipqtypeptr print sysstderr nametimetimenow else print sysstderr unknown cclose index storagepy rcs file cvsrootspambayesspambayesspambayesstoragepyv retrieving revision 163 retrieving revision 164 diff c2 r163 r164 storagepy 11 may 2007 002308 0000 163 storagepy 10 jun 2007 152736 0000 164 721726 import zodb zodbfilestorage import filestorage selfstorage filestorageselfdb_filename read_onlyselfmoder def loadself 721731 import zodb zodbfilestorage import filestorage try selfstorage filestorageselfdb_filename read_onlyselfmoder except ioerror msg print sysstderr could create filestorage selfdb_filename raise def loadself 774778 zodbposexception import readonlyerror assert selfclosed false cant store closed database optionsglobals verbose 779783 zodbposexception import readonlyerror assert selfclosed cant store closed database optionsglobals verbose _______________________________________________ spambayescheckins mailing list pnperxdpvsarswdlppythonorg httpmailpythonorgmailmanlistinfospambayescheckins tue 05 aug 2008 173546 0700 spambayescheckins spambayesspambayes corepluginpy 11 12 coreuipy 11 12 xmlrpcpluginpy 11 12 optionspy 1141 1142 proxyuipy 164 165 userinterfacepy 161 162 dnscachepy 13 14 storagepy 163 164