On 6/1/05, Sells, Fred <[EMAIL PROTECTED]> wrote: > The idea of PTL seems cool, but I'm having some trouble. Eclipse does not > recognize it as Python unless I mistakenly name it xxx.py when I create it, > then rename it to xxx.ptl. Even then Eclipse barfs on the [html] part of > "def foo [html] (a,b,c):" > I've also spent too much time (IMO) tracking down my bugs related to content > that needs to be wrapped in a call to "htmltext()"
You shouldn't need to wrap things in htmltext in [html] template code. > So after all that, my question to those more experienced is: > (1) Should I use PTL, or use straignt Python (.py files) with perhaps some > use of the quixote utility functions. PTL is really quite handy, especially the automatic quoting stuff. > (2) If PTL, is there any way to get Eclipse/PyDev to parse it? I don't know anything about those programs, but you should be able to just tell it to look for *.ptl in addition to *.py. It won't like [html] but that should be ok. > (3) Are there other alternatives/add on's that have been very useful. durus is nice. Try the quixote.ca page? > htmltext(body) You should return html from [html] templates. Why not place _BODY directly in _q_index? Then you can substitute in your params by just writing util.getWeekdayMonthDayYear(util.getNextSaturday() where you need it, eg: def _q_index [html] (self): """<html> blah blah next saturday is:""" util.getWeekdayMonthDayYear(util.getNextSaturday() """blah blah </html>""" > def _q_lookup(self, component): > if component in ["beginnew", "viewhistory"]: > page = self.getUnderConstructionPage(__file__, component) Why not put beginnew = viewhistory = UnderConstruction() in the class def, and then put those in _q_exports? > else: > page = self.getUndefinedLinkPage(__file__, component) If you want a special page to be displayed for an unknown path, you can use one of the error handlers in publish for that... _______________________________________________ Quixote-users mailing list [email protected] http://mail.mems-exchange.org/mailman/listinfo/quixote-users
