[Tess-developers] TheSpamSecretary TheSpamSecretary.py,1.16,1.17
Brought to you by:
kwerle
|
From: <kw...@us...> - 2003-11-12 08:03:35
|
Update of /cvsroot/tess/TheSpamSecretary
In directory sc8-pr-cvs1:/tmp/cvs-serv15539
Modified Files:
TheSpamSecretary.py
Log Message:
Tweak to display of database (--showbad, etc). Better handling of mime mail. Slight change to miniumum spam value so as not to dump friend's email
Index: TheSpamSecretary.py
===================================================================
RCS file: /cvsroot/tess/TheSpamSecretary/TheSpamSecretary.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** TheSpamSecretary.py 18 Jun 2003 23:34:55 -0000 1.16
--- TheSpamSecretary.py 12 Nov 2003 08:03:07 -0000 1.17
***************
*** 46,49 ****
--- 46,50 ----
import user
+ import md5
import StringIO
import multifile
***************
*** 157,161 ****
return .4
if (bad_count == 0):
! return .0101
if (good_count == 0):
return .99
--- 158,162 ----
return .4
if (bad_count == 0):
! return .0089
if (good_count == 0):
return .99
***************
*** 255,259 ****
keys.sort()
for someKey in keys:
! print("%s: %s" % (someKey, someDict[someKey]))
print("Message count: %s" % someDict['TeSSFileCount'])
--- 256,263 ----
keys.sort()
for someKey in keys:
! try:
! print("%s: %s" % (someKey, someDict[someKey]))
! except KeyError:
! sys.stderr.write("Could not find the value for key %s\n" % someKey)
print("Message count: %s" % someDict['TeSSFileCount'])
***************
*** 497,502 ****
self.scanURLs(outputData.getvalue(), self.tempDict)
outputData = self.stripComments(outputData.getvalue())
! #else:
! # print("NO DECODE")
#print(outputData.getvalue())
self.addTokensFromTextToDict(outputData.getvalue(), self.tempDict)
--- 501,516 ----
self.scanURLs(outputData.getvalue(), self.tempDict)
outputData = self.stripComments(outputData.getvalue())
! else:
! try:
! someData = StringIO.StringIO()
! hashCounter = md5.new()
! mimetools.decode(multiFile, someData, onePart.getencoding())
! hashCounter.update(someData.getvalue())
! if (self.debugFilter):
! sys.stdout.write("Hash value is: %s\n" % hashCounter.hexdigest())
! self.addTokensFromTextToDict(hashCounter.hexdigest(), self.tempDict, "MIMEFILEHASH:")
! except:
! sys.stdout.write("Bad multipart of type %s\n" % onePart.gettype())
!
#print(outputData.getvalue())
self.addTokensFromTextToDict(outputData.getvalue(), self.tempDict)
|