0
I Use This!
Activity Not Available
Analyzed 10 months ago. based on code collected 10 months ago.

Project Summary

The main functions and classes of the ctemplate library are wrapped as native Python objects. This enables quick prototyping and testing of a ctemplate system.

Run python internal help() for an API overview: $ python -c "import ctemplate; help(ctemplate)"

Example

# loads example.tpl in current directory
template = ctemplate.Template("example.tpl", ctemplate.DO_NOT_STRIP)
dictionary = ctemplate.Dictionary("my example dict")
dictionary.SetValue("VALUE1", "TEST1")
# dict setters call SetValue() automatically
dictionary["VALUE2"] = "TEST2"
# all objects except booleans are converted to strings with str()
dictionary["NUMBER"] = 87411 # stores "87411"
dictionary["TUPLE"] = (1, 2, 3) # stores "(1, 2, 3)"
# Sections
dictionary.ShowSection("A_SECTION")
# boolean True calls ShowSection() automatically
dictionary["IN_CA"] = True
# boolean False is ignored (ie. this statement has no effect)
dictionary["IGNORED"] = False
# And of course the expand function
print template.Expand(dictionary)

Tags

template templating wrapper python ctemplate

In a Nutshell, python-ctemplate...

This Project has No vulnerabilities Reported Against it

Did You Know...

  • ...
    Black Duck offers a free trial so you can discover if there are open source vulnerabilities in your code
  • ...
    by exploring contributors within projects, you can view details on every commit they have made to that project
  • ...
    there are over 3,000 projects on the Open Hub with security vulnerabilities reported against them
  • ...
    anyone with an Open Hub account can update a project's tags

Languages

Languages?height=75&width=75
C++
82%
Python
10%
Make
6%
HTML
2%

30 Day Summary

Apr 10 2016 — May 10 2016

12 Month Summary

May 10 2015 — May 10 2016

Ratings

Be the first to rate this project
Click to add your rating
   Spinner
Review this Project!