[Tracker-discuss] Auditor doesn't see everything...

skip at pobox.com skip at pobox.com
Sat Jun 9 14:55:06 CEST 2007


So I'm launching back into the Roundup side of my spam filtering.  I figured
all I should need is an auditor that raises a Reject exception when it
detects a spammy submission.  It took me awhile to figure out where to put a
"hello world" auditor so it would fire with the demo tracker, but I got to
that point and submitted a ticket with the following fields filled in:
Title, Priority, Change Note.  I also attached a small text file.  The
newvalues dictionary only contained three keys: "content", "type" and
"name".  All were related to the attached file.

Here's my simple auditor:

    def testaudit(db, cl, nodeid, newvalues):
	print "db:", db
	print "cl:", cl
	print "nodeid:", nodeid
	print "newvalues:", newvalues

    def init(db):
	db.file.audit('create', testaudit)
	print "initialized auditor", testaudit

Here's the output from my ticket submission:

    db: <back_anydbm instance at 2122cd8>
    cl: <hyperdb.Class "file">
    nodeid: None
    newvalues: {'content': 'Testing MathML\n--------------\n\nInline math: :latex-math:`n! + \\sin(x_n^2)`.  And displayed math:\n\n.. latex-math::\n\n   f(\\epsilon) = \\frac{1}{1 + \\exp\\left(\\frac{\\varepsilon}{k_\\text{B}T}\\right)}\n\n.. latex-math::\n\n   N = \\frac{\\text{number of apples}}{7}\n\n.. latex-math::\n\n   \\mathbf{M} = \\left(\\begin{matrix}a&b\\\\c&d\\end{matrix}\\right)\n\nWe have :latex-math:`|\\mathbf{M}| = ad - bc`.\n\n.. latex-math::\n\n   \\int_0^1 x^n dx = \\frac{1}{n + 1}\n\n.. latex-math::\n\n   \\sum_{n=1}^m n = \\frac{m(m+1)}{2}\n\n* tilde: :latex-math:`\\tilde{n}`\n* hat: :latex-math:`\\hat{H}`\n* bar: :latex-math:`\\bar{v}`\n\nQuantum mechanics:\n\n.. latex-math::\n\n   -\\frac{1}{2}\\nabla^2 \\psi + v \\psi = \\varepsilon \\psi\n\nMath split over two lines:\n\n.. latex-math::\n\n   g(\\alpha) = & (1 + \\alpha + \\alpha^2 + \\alpha^3 + \\alpha^4\\\\\n               & + \\alpha^5)\n\n.. latex-math::\n\n   f(x) = \\left\\{\n     \\begin{matrix}\n       1 - x, & x < 1 \\\\\n       0,     & x > 1\n     \\end{matrix}\\right.\n', 'type': 'text/plain', 'name': 'test.txt'}

Shouldn't the newvalues dictionary contain information about all the fields
in the form?

Thx,

Skip


More information about the Tracker-discuss mailing list