[albatross-users] Re: Albatross-users digest, Vol 1 #176 - 14 msgs
Eric S. Johansson
esj at harvee.org
Wed Jul 2 07:34:20 EST 2003
Matt Goodall wrote:
> Hi Eric,
>
> I realise you have posted quite a bit to the list recently (which is
> definitely not a problem!) and got some answers but could you quickly
> and clearly summarize the problems you are still facing with Albatross.
> Perhaps we could then address each issue again and see if we can help you.
>
> Cheers, Matt
>
thank you Matt, if the rest of you folks can take another long-winded
description, here's a big chunk of the problem I'm trying to code up.
If you go to:
harvee.org/cgi-bin/correct.cgi
Login with username: albatross password: albatross
you'll see what I'm trying reimplement. The reason for the reimplementation is
that I will be doing something similar with the spam dumpster and I also need to
create something totally unrelated which is the user configuration editing tool.
by the way, don't worry about pushing on the buttons because I've filtered out
any real action from albatross.
The vast majority of the web page is quite simple. The "refresh display" link
just refers to the CGI so that you can refresh the list of currently trapped
spam below. The number of messages contained in the spamtrap is obviously
dynamically created at p. construction time. The button "spam on top/bottom" is
simultaneously state information and user information. I set the value of the
button to display the sort order for the list. One of my first attempts at
converting to albatross forced me to change the message and just set the text to
spam on top/bottom and have the button become "click to reverse sorting". I
then used a hidden variable to store the state sort of direction.
I would like to figure out how to store the sort state direction information so
that it would persist even though someone refreshes the display.
On the top and bottom of the spamtrap display are to train buttons. We've gone
around the barn a few times on the vocabulary for the buttons and I'm probably
going to make it "process spamtrap" although there is a vocal minority that
prefers "lather, rinse, repeat".
Now we come to the messy part, the spamtrap display. This is what prompted my
question about displaying two-dimensional data. Internally, I need to look at
all messages in the spamtrap, read the messages, extract all fields and correct
for errors created by spammers, sort the list, truncate to the display size, and
build the display list.
The easy forms of the display list are either tuples of all the display elements
or dictionaries of the same. I've implemented an object model version but it's
not significantly better than the straight iterative form.
as you can see, each line consists of:
* a checkbox which is checked or unchecked automatically
* a background color set according to score
* destination mailbox
* from address
* subject
the subject field is also a link which takes you to another CGI which displays
the contents of the message. This is useful when trying to evaluate whether or
not a message truly is spam.
You will also notice that as you check and uncheck each line, the color changes
from yellow to red and back again.
the last piece is the periodic refresh. it's a JavaScript clock that counts
down and reloads the page. It's not perfect because tries to repost data from
the last time a button was pressed. Obviously, I need to figure out what's the
right way to do the refresh. Also, I would like to make the countdown time
dynamic based on the users configuration at some point.
as I said in my other piece, what has consistently tripped me up is the
difference between the Python data model and the albatross data model. Bridging
the gap is essential in enabling new users to be successful with albatross.
---eric
More information about the Albatross-users
mailing list