ANNOUNCE: JOTWeb 1.11, preview of new web application system.

Sean Reifschneider jafo-pythonlist at tummy.com
Wed Jun 18 08:52:28 CEST 2003


On Wed, Jun 18, 2003 at 07:09:42AM +1000, Tim Churches wrote:
>Just out of interest, what didn't you like about Albatross (
>http://www.object-craft.com.au/projects/albatross/ )? Superficially at
>least, Albatross seems to look a lot like JotWEB, in its templating

I didn't like that, at least as far as the documentation indicates to
me, Albatross web pages have this context that has to be set up and
maintained for each of the pages.  There's a fairly similar set of 10
lines of code that need to be set up for each page that you want to be
dynamic.

For example, in JOTWeb to display a page with the current time in it,
you would have a "code.py" file that contains:

   def currenttime():
      import time
      return(time.strftime('%H:%M:%S'))

And call that from an HTML file using:

   The current time is: <span tal:replace="code/currenttime"></span>

As a comparison, it seems to be that this code in Albatross would be a
python module containing:

   #!/usr/bin/python
   import os
   from albatross import SimpleContext

   ctx = SimpleContext('.')
   templ = ctx.load_template('time.html')

   import time
   ctx.locals.currenttime = time.strftime('%H:%M:%S')

   templ.to_html(ctx)

   print 'Content-Type: text/html'
   print
   ctx.flush_content()

Then the HTML of:

   The current time is: <al-value expr="currentime">

It just seems like you have to cut and paste a lot of code in Albatross
for every page you want to display.  But it's not just cut and paste,
because you have to customize some parts of it (while leaving other
parts alone).  JOTWeb tends to do a lot of that sort of stuff for you
behind the scenes so that you don't have to think about them.

Sean
-- 
 The early bird may get the worm, but the second mouse gets the cheese.
Sean Reifschneider, Inimitably Superfluous <jafo at tummy.com>
tummy.com, ltd. - Linux Consulting since 1995.  Qmail, Python, SysAdmin
      Back off man. I'm a scientist.   http://HackingSociety.org/





More information about the Python-list mailing list