On Fri, Mar 25, 2011 at 07:10:19AM -0600, Aaron Toponce wrote:
> Now to start working on the verification process. I figure I can use
> $display_filter for that, and just not filter anything, but execute another
> Python script.

So, now I'm working on the verification script, and I'm struggling getting
it to work with $display_filter. It's a Python script. When the script
doesn't have anything in it, the message isn't displayed. This isn't what I
would expect. I would expect the message to still display, unless the
script has logic that performs otherwise.

I haven't tested this with a shell script just running sed against the
file, so maybe I should try that. However, it seems that I have to reprint
the entire message with Python (which is fine, because I want to add lines
to the output, based on some logic in the Python script). Here's the
relevent logic:

original = sys.stdin.readlines()
email = StringIO.StringIO(''.join(original))
message = rfc822.Message(email)

# ... snip several lines of code ...

for line in original:
if len(line) == 1 and len(token_status) > 0:
print
for status in token_status:
print status
token_status = []
else:
print line,

The "original" variable is the original message, read from STDIN, as
$display_filter does. The "email" variable is the message, converted to a
file-type object, so I can use the rcf822 module, getting access to the
headers easily. The "for" loop at the end is reprinting the mail, putting
the status of "hashcash" in the "status" variable in the message, right
after the headers, and before the body of the mail. I'm looking for a blank
line, as per RFC822 (and subsequent follow-up RFCs), there bust exist a
blank line before the body after the headers. I'm looking for this line to
print my message to the user.

The problem I'm experiencing, I think, is with the $PAGER. Everything
displays fine, except when I wish to PGUP/PGDN the message doesn't display
correctly, and gets all jumbled up. I'm assuming it has something to do
with writing the message line-by-line, but I'm not sure.

Can someone help me with this? I've attached what I've come up with so
far, and I believe all logic is sound, minus writing the masseg to screen
(which I would think you write the message, THEN the $PAGER displays it,
keeping everything in tact- guess not).

Any hlep would be appreciated. Thanks in advance!

--
. o .   o . o   . . o   o . .   . o .
. . o   . o o   o . o   . o o   . . o
o o o   . o .   . o o   o o .   o o o

Attachment: signature.asc
Description: Digital signature

Reply via email to