The Artima Developer Community
Sponsored Link

Python Buzz Forum
PyMeld

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
Simon Willison

Posts: 282
Nickname: simonw
Registered: Jun, 2003

Simon Willison is a web technology enthusiast studying for a Computer Science degree at Bath Uni, UK
PyMeld Posted: Jul 1, 2003 10:41 PM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Simon Willison.
Original Post: PyMeld
Feed Title: Simon Willison: Python
Feed URL: http://simon.incutio.com/syndicate/python/rss1.0
Feed Description: Simon Willison's Python cateory
Latest Python Buzz Posts
Latest Python Buzz Posts by Simon Willison
Latest Posts From Simon Willison: Python

Advertisement

PyMeld is a concrete implementation of something I've been thinking about for months: A template system that takes an XHTML page as a template and manipulates it based on cloning and modifying elements within the template identified using their ID attribute. It's a very elegant solution that makes good use of Python's object overloading support to make manipulating templates as intuitive as possible. Maybe the same thing will be possible in PHP once the new overloading functions become part of the standard package.

If you decide to have a play with PyMeld you may run in to the limitation that, because class is a reserved word in Python, you can't set the class of an element using the standard page.someElementID.class = "something" syntax. You can however achieve the same thing using Python's setattr built in function: setattr(page.someElementID, 'class', 'something'). That tip comes courtesy of the module's author who sorted it out for me within about 10 minutes of my email query.

Read: PyMeld

Topic: A simple upload script Previous Topic   Next Topic Topic: Misc

Sponsored Links



Google
  Web Artima.com   

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