This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Project Description
=========================
Choco Templates for Python
=========================

Choco is a template library written in Python. It provides a familiar, non-XML
syntax which compiles into Python modules for maximum performance. Choco's
syntax and API borrows from the best ideas of many others, including Django
templates, Cheetah, Myghty, and Genshi. Conceptually, Choco is an embedded
Python (i.e. Python Server Page) language, which refines the familiar ideas
of componentized layout and inheritance to produce one of the most
straightforward and flexible models available, while also maintaining close
ties to Python calling and scoping semantics.

Nutshell
========

::

<%inherit file="base.html"/>
<%
rows = [[v for v in range(0,10)] for row in range(0,10)]
%>
<table>
% for row in rows:
${makerow(row)}
% endfor
</table>

<%def name="makerow(row)">
<tr>
% for name in row:
<td>${name}</td>\
% endfor
</tr>
</%def>

UI
============



UI tag is inspired by EmberJs Handlebarjs tempalte.


index.html
----------------


::

This is an UI Page
<%@ PostView(post_id)/>



ui/post.html
----------------


::

This is a Post View

Name: ${post.title}
Content: ${post.content}


.. code:: python


def create_ui_container():
from choco.ui import UIContainer, UIModule
ui_container = UIContainer(["template/ui"])

class PostView(UIModule):

default_template = "post.html"

def initialize(self):
self.thing = Thing("Post")

def render(self, post_id):
post = self.thing.getByPostId(post_id)
return {
"post": post
}
ui_container.put_ui("PostView", PostView)
return ui_container

tl2 = lookup.TemplateLookup(directories=["template"], ui_container=create_ui_container())
t12.get_template("index.html").render(post_id=122)





Philosophy
===========

Python is a great scripting language. Don't reinvent the wheel...your templates can handle it !



License
========

Choco is licensed under an MIT-style license (see LICENSE).
Other incorporated projects may be licensed under different licenses.
All licenses allow for non-commercial and commercial use.
Release History

Release History

1.0.5

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

1.0.5.dev0

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

1.0.4

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

1.0.4.dev0

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

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
Choco-1.0.5.tar.gz (214.5 kB) Copy SHA256 Checksum SHA256 Source May 28, 2016
Choco-1.0.5.zip (254.8 kB) Copy SHA256 Checksum SHA256 Source May 28, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS 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