Cheetah is an open source template engine and code generation tool.
yelp_cheetah is cheetah with everything we don't / shouldn't use removed.
- Fix build on pypy.
- Add error message for missing partial template
#extendsunder test. - Fix warnings in python3+.
- Drop support for python 2.
- Build abi3 wheels.
- Some optimizations of list comprehensions
- Lookup speed improvements
- Remove
enable_auto_selfsetting (alwaysFalse) - Remove
useNameMappersetting (alwaysTrue) - Add an
auto_selfkwarg togetVarandvarExistsdefaulting toTrue(will default toFalseand be removed in a future version).
enable_auto_selfsetting now defaults toFalse- Lookup involving partial templates calling partial templates is now optimized.
- Add a parsing hook for cheetah variables
$foo()barno longer compiles tofoo.bar- gettext parsing was removed -- it never worked properly. To get gettext
scannable compiled output, create a compiler, augment
._global_varswith the gettext functions. $()and$[]are now syntax errors -- use${}instead${ foo }is now a syntax error -- placeholders cannot start with whitespace- Escaped newlines in expressions are preserved
- Bug with comments in a multi-line expression fixed
- Fix several parsing issues around expressions
- Fix several parsing issues around
#def
- Add an
enable_auto_selfsetting (defaulted toTrue) which (when enabled) means$foocan mean eitherself.fooorNS['foo'](the behaviour prior to this version). In future versions, this will default toFalseand will eventually be eliminated.
- Introduce unused functions for lookup. These will be used for backwards / forwards compatibility in the next release.
- Remove
#calldirective (port to#withinstead)
- Use
io.StringIOas a replacement forDummyTransaction - Drop python2.6 support
- Require six>=1.4.0 (for six.PY2)
- Add setuptools extension to build templates. To use add
setup_requires=['yelp-cheetah']andyelp_cheetah={'directories': [...]}to automatically build templates in a package on installation.
- Remove
#setand#silent(replaced by#py)
- Fix regression introduced in 0.11.0:
$self.getVar('contains_underscore')
- Fix regression introduced in 0.11.0:
[$x for x in ...]
- Remove instrumentation added in 0.10.0
- Remove
useAutocallingsetting (always False) - Remove
useDottedNotationsetting (always False) - Remove
mainMethodNamesetting (always respond) - Remove
mainMethodNameForSubclassessetting (always writeBody) - Remove
valueForName(now unused) - Implement ContextManagerPartialTemplateTestCase
- Template now only takes a single argument
namespaceinstead of searchList - Support pypy for real
- Template.getVar / Template.varExists no longer support dots
- Added instrumentation to migrate away from autocall / autokey
- Tests pass under pypy (still slow)
- "Blinged" kwargs no longer supported:
$foo($bar='baz') => $foo(bar='baz')
#filterdirective is gone. Useself.set_filter(filter_fn)Template's signature is nowTemplate(search_list, filter_fn)- All templates now have
from __future__ import absolute_import
- removed macro support: use
#withinstead. - much-improved support for context managers.
- Raise on unknown settings
- Remove settings:
cheetahVarStartToken,commentStartToken,directiveStartToken,directiveEndToken - Fix indexing a return value #23
- Add
#pydirective. This will replace#silentand#setin a future version - Remove
<% ... %> - Optimize lookup of builtins, globals, and locals when detected.
- Cheetah classes now invariantly have
YelpCheetahTemplateas the classname - Variable lookup is now
locals(),globals(),builtins,self,searchList #extendsno longer supports#extends foo.fooand should instead be#extends foo
**KWSis no longer added to every template method definition
- Scan gettext variables in attributes
$translator.gettext(...) - Scan more types of gettext variables (
gettext,pgettext,npgettext). - Remove some runtime overhead of gettext variables
- Remove dollarsigns on
forlvalues - Remove
#set globaldirective - Remove
future_unicode_literalssetting - Disallow dollarsigns in
getVar/varExists
- Do not create
__init__.pyin__pycache__directories
- Invariantly create
__init__.pyin subdirectories
- dep argparse
cheetah-compiletakes directories
- Fix partial template testing infrastructure
- Disallow dollarsigns on
#def/#blockname - Disallow dollarsigns in function signatures
- Require argspec for
#def - Requres no argspec for
#block - Require no dollarsign in
#setlvalue - Disallow dollarsigns in macro arguments
- Disallow dollarsigns in
#attrlvalue - Forbid
@classmethod/@staticmethod - Remove
#set moduledirective - Add testing infrastructure for partial template testing
- Add
compile_directories
- Add
#withdirective - 100% test coverage
- Make filters simple functions instead of classes
- Add and make default
markupsafefilter
- Add
Cheetah.partial_template, a system for importable template functions.
- Rename
Cheetah.CompilerandCheetah.ParsertoCheetah.legacy_compilerandCheetah.legacy_parser - Remove
#encodingdirective, cheetah source is now invariantlyUTF-8
- Raise on unknown macros
- Remove
#echodirective - Remove
#* ... *#multiline comment syntax - Remove version checking code
- Remove
#argdirective - Remove
#closuredirective - Make compilation output deterministic
- Remove
<%=...%> - Remove ability to specify argspecs in
#implements - Remove multiple inheritance from
#extends - Remove
#compilerdirective - Remove global imports: (
sys,os,os.path,builtin,getmtime,exists,types) - Default
useDottedNotationto false - Remove
allowNestedDefScopessetting - Remove
useSearchListsetting - Remove
useKWsForPassingTranssetting - Remove
alwaysFilterNonesetting - Remove cheetah ternary
#if ... then ... else ...directive - Remove
namespaceargument fromTemplate.__init__ - Support Python 3
- Expose a global
__YELP_CHEETAH__ = Truein compiled source - Remove
autoImportForExtendssetting (always True) - Disable
#extendsof an imported name - Add setting
future_unicode_literalsfor togglingunicode_literalsin compiled source
- Removed Cheetah Analyzer
- Removed textmate highlight support
- Remove logging of placeholders
- Remove Django support
- Make useAutoCalling default to False
- Remove
#cachedirective - Remove Mondo
- Remove RecursiveNull
- Remove SiteHierarchy
- Remove turbocheetah
- Remove Servlet
- Remove silent placeholders (
$!placeholder) - Remove
#errorCatcherdirective - Remove WebWare support
- Remove FileUtils
- Remove hasName
- Remove Indenter
- Remove
#indentdirective - Remove cheetah eval
c'$var'syntax - Remove import hook, live compiling, compilation cache
- Remove CheetahWrapper
- Remove
#I18nmacro - Improve cmdline interface
- Remove several magical imports (
time,currentTime, etc.) - Remove
#unicodedirective - Remove
#breakpointdirective - Remove
#unlessdirective - Remove
#repeatdirective - Remove
#capturedirective - Improve compiling interface. There are now three functions: (
compile_source,compile_file,compile_to_class) - Remove
#defmacrodirective - Remove
#includedirective - Remove
getFileContents - Remove preprocessors
- Remove
addSrcTimeToOutputsetting - Remove
disabledDirectivessetting - Remove
pre/postParseDirectivehooks - Remove placeholder hooks
- Remove expression hooks
- Remove
I18NFunctionName - Remove
EmptySingleLineMethodssetting - Remove
allowWhitespaceAfterDirectiveStartToken - Remove
templateMetaclasssetting - Require
unicodefor compiling source - Remove
#transformdirective - Remove
Websafe,Markdown,CodeHighlight,Maxlen,Stripfilters - Remove aliases for
BaseFilter - Remove
namespacesargument forTemplateconstructor - Remove
#stopdirective - Remove
useFilterssetting (always True) - Remove
allowPlaceholderFilterArgssetting - Remove
encodingsetting - Remove
EOLSlurpfeature - Remove
#rawdirective - Remove C implementation of filters
- Remove
outputMethodsBeforeAttributessetting - Remove
defDocStrMsgsetting - Remove
handlerForExtendsDirectivesetting - Remove
__str__from all objects - Remove support for pypy (Delete python implementation of NameMapper)
- Remove
useStackFramessetting - Remove
#importsettingsdirective - Remove
#compiler-settings pythondirective - Remove
safeConvert - Remove
*imports - Raise on searchlist collisions
- Fix bug with macros causing out-of-bounds when near end of source
- Correct dependencies
- Before hacking