This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
`flexable` is template engine with simple data structure.
That is made up of str, unicode, dict, tuple, list and Element.

usage
merge structured values to xhtml template.

>>> t = Template()
>>> t.fromstring("<div/>")
>>> str(t)
'<div/>'

>>> t.merge('hello')
>>> str(t)
'<div>hello</div>'

>>> t = Template()
>>> t.fromstring("<div><span class="y"/></div>")
>>> t.merge({'y':['1', '2']})
>>> str(t)
'<div><span class="y">1</span><span class="y">2</span></div>'

>>> t = Template()
>>> t.fromstring("<div><span class="y"/></div>")
>>> t.merge({'y':[({'@id':'m1'}, '1'),
... ({'@id':'m2'}, '2')]})
>>> str(t)
'<div><span class="y" id="m1">1</span><span class="y" id="m2">2</span></div>'

>>> t.fromstring("<div><div class="box"><span class="x"/><span <br="">class='y'/></div></div>")
>>> t.merge({'box':[{'x':'1', 'y':'2'},
... {'x':'3', 'y':'4'}]})
>>> str(t)
'<div><div class="box"><span class="x">1</span><span <br="">class="y">2</span></div><div class="box"><span class="x">3</span><span <br="">class="y">4</span></div></div>'

>>> t.fromstring("<div/>")
>>> t.merge(ET.Element('span'))
>>> str(t)
'<div><span/></div>'

To use flexable as template engine for wsgi application, you can use
flexable.plugin:FlexablePlugin.
And that is python.template_engine entry point.

Example on TurboGears

controllers.py::

@expose(template="flexable:flexable_example.templates.example")
def example(self):
return dict(message="This is flexable message.",
contents=""" This is main contents from controller.
flexable is merge values to given html template with class attribute.
""")

flexable_example/templates/example.html::

<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<h1>Flexable Template</h1>
<span class="message"></span>
<p class="contents"></p>
<span class="widget"/>
</body>
</html>

you get:

<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<h1>Flexable Template</h1>
<span class="message">This is flexable message.</span>
<p class="contents"> This is main contents from controller.
flexable is merge values to given html template with class attribute.
</p>
</body>
</html>
Release History

Release History

0.3dev

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2dev

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1dev

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
flexable-0.3dev-py2.5.egg (12.9 kB) Copy SHA256 Checksum SHA256 2.5 Egg Jul 18, 2007
flexable-0.3dev.tar.gz (6.2 kB) Copy SHA256 Checksum SHA256 Source Jul 18, 2007

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting