atocha: Frequently Asked Questions (FAQ)
Abstract
A list of some frequently asked questions, with answers.
htmlout is a simplistic library to perform HTML output from Python, similar to
Nevow's Stan library. It is also written by the author of Atocha, but never
has had the time to clean it up enough to want to share it. It is still
changing and requires some review before making it open source.
However, the renderers for htmlout that come with Atocha can serve as a nice
basis for creating other renderers which also use trees of nodes to create html
output.
No. You can use the text renderers that comes with Atocha or write your own
renderer if you want.
FormEncode is a nice effort, which aims at solving the very same problem as
this project. My personal views on FormEncode, with respect to Atocha:
- I don't like having to write validator classes, I like to put my validation
code inside my resource handler code, because it is pretty much always
different for every form, so there is not much opportunity for reuse anyway.
For the few cases where I do validate results the same way, I simply write a
function that uses the parser object;
- I find all the metaclass stuff in FormEncode entirely unnecessary and very
distracting. I value code that is really simple;
- I need to use an HTML output library that is a tree of nodes (htmlout) and
so I really needed to have decoupled renderer code that produces only nodes
rather than text;
- I don't know if the kind of per-error message with the ability to specify an
invalid replacement value for re-rendering can be produced as easily as with
Atocha (I would need to study FormEncode more to find out);
- When I built Atocha, I was having lots of trouble with types, and I wanted to
build my stuff on ultra-defensive programming, with lots of assertions, so
that I could easily find problems when they occur. I'm not sure how
FormEncode's type conditions are setup;
- I had a large codebase to port with minimal effort, so reinventing the wheel
was not entirely out of the question.
That being said, I did not really make a huge effort to try to use FormEncode,
at the time when I discovered it I had almost finished my library.