The Artima Developer Community
Sponsored Link

Python Buzz Forum
Miniature Java template compiler

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Phillip Pearson

Posts: 1083
Nickname: myelin
Registered: Aug, 2003

Phillip Pearson is a Python hacker from New Zealand
Miniature Java template compiler Posted: Aug 11, 2003 4:25 AM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Phillip Pearson.
Original Post: Miniature Java template compiler
Feed Title: Second p0st
Feed URL: http://www.myelin.co.nz/post/rss.xml
Feed Description: Tech notes and web hackery from the guy that brought you bzero, Python Community Server, the Blogging Ecosystem and the Internet Topic Exchange
Latest Python Buzz Posts
Latest Python Buzz Posts by Phillip Pearson
Latest Posts From Second p0st

Advertisement
Why are there so many Java templating engines, when JSP is right there for you to use? I'm starting to understand -- JSP has a strange 'feel'. It should be possible to do FreeEnergy with the include directive though. Hmm.

The start of an experiment:

#!/usr/local/bin/python

import sys
html = open(sys.argv[1]).read()

while 1:
    x = html.split('<%', 1)
    if x[0]:
        print 'out.write("%s");' % x[0].replace('\\', '\\\\').replace('"', '\"').replace('\n', '\\n')
    if len(x) == 1: break
    code, html = x[1].split('%>', 1)
    if code:
        if code[0] == '=': code = 'out.write(%s)' % code[1:]
        print code


More on this later.

Comment

Read: Miniature Java template compiler

Topic: Auto-discovery of trackback urls in python Previous Topic   Next Topic Topic: Twisted Howto: Asynchronous XMLRPC

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use