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
#extends
under test. - Fix warnings in python3+.
- Drop support for python 2.
- Build abi3 wheels.
- Some optimizations of list comprehensions
- Lookup speed improvements
- Remove
enable_auto_self
setting (alwaysFalse
) - Remove
useNameMapper
setting (alwaysTrue
) - Add an
auto_self
kwarg togetVar
andvarExists
defaulting toTrue
(will default toFalse
and be removed in a future version).
enable_auto_self
setting now defaults toFalse
- Lookup involving partial templates calling partial templates is now optimized.
- Add a parsing hook for cheetah variables
$foo()bar
no longer compiles tofoo.bar
- gettext parsing was removed -- it never worked properly. To get gettext
scannable compiled output, create a compiler, augment
._global_vars
with 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_self
setting (defaulted toTrue
) which (when enabled) means$foo
can mean eitherself.foo
orNS['foo']
(the behaviour prior to this version). In future versions, this will default toFalse
and will eventually be eliminated.
- Introduce unused functions for lookup. These will be used for backwards / forwards compatibility in the next release.
- Remove
#call
directive (port to#with
instead)
- Use
io.StringIO
as 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
#set
and#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
useAutocalling
setting (always False) - Remove
useDottedNotation
setting (always False) - Remove
mainMethodName
setting (always respond) - Remove
mainMethodNameForSubclasses
setting (always writeBody) - Remove
valueForName
(now unused) - Implement ContextManagerPartialTemplateTestCase
- Template now only takes a single argument
namespace
instead 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')
#filter
directive 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
#with
instead. - much-improved support for context managers.
- Raise on unknown settings
- Remove settings:
cheetahVarStartToken
,commentStartToken
,directiveStartToken
,directiveEndToken
- Fix indexing a return value #23
- Add
#py
directive. This will replace#silent
and#set
in a future version - Remove
<% ... %>
- Optimize lookup of builtins, globals, and locals when detected.
- Cheetah classes now invariantly have
YelpCheetahTemplate
as the classname - Variable lookup is now
locals()
,globals()
,builtins
,self
,searchList
#extends
no longer supports#extends foo.foo
and should instead be#extends foo
**KWS
is 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
for
lvalues - Remove
#set global
directive - Remove
future_unicode_literals
setting - Disallow dollarsigns in
getVar
/varExists
- Do not create
__init__.py
in__pycache__
directories
- Invariantly create
__init__.py
in subdirectories
- dep argparse
cheetah-compile
takes directories
- Fix partial template testing infrastructure
- Disallow dollarsigns on
#def
/#block
name - Disallow dollarsigns in function signatures
- Require argspec for
#def
- Requres no argspec for
#block
- Require no dollarsign in
#set
lvalue - Disallow dollarsigns in macro arguments
- Disallow dollarsigns in
#attr
lvalue - Forbid
@classmethod
/@staticmethod
- Remove
#set module
directive - Add testing infrastructure for partial template testing
- Add
compile_directories
- Add
#with
directive - 100% test coverage
- Make filters simple functions instead of classes
- Add and make default
markupsafe
filter
- Add
Cheetah.partial_template
, a system for importable template functions.
- Rename
Cheetah.Compiler
andCheetah.Parser
toCheetah.legacy_compiler
andCheetah.legacy_parser
- Remove
#encoding
directive, cheetah source is now invariantlyUTF-8
- Raise on unknown macros
- Remove
#echo
directive - Remove
#* ... *#
multiline comment syntax - Remove version checking code
- Remove
#arg
directive - Remove
#closure
directive - Make compilation output deterministic
- Remove
<%=...%>
- Remove ability to specify argspecs in
#implements
- Remove multiple inheritance from
#extends
- Remove
#compiler
directive - Remove global imports: (
sys
,os
,os.path
,builtin
,getmtime
,exists
,types
) - Default
useDottedNotation
to false - Remove
allowNestedDefScopes
setting - Remove
useSearchList
setting - Remove
useKWsForPassingTrans
setting - Remove
alwaysFilterNone
setting - Remove cheetah ternary
#if ... then ... else ...
directive - Remove
namespace
argument fromTemplate.__init__
- Support Python 3
- Expose a global
__YELP_CHEETAH__ = True
in compiled source - Remove
autoImportForExtends
setting (always True) - Disable
#extends
of an imported name - Add setting
future_unicode_literals
for togglingunicode_literals
in compiled source
- Removed Cheetah Analyzer
- Removed textmate highlight support
- Remove logging of placeholders
- Remove Django support
- Make useAutoCalling default to False
- Remove
#cache
directive - Remove Mondo
- Remove RecursiveNull
- Remove SiteHierarchy
- Remove turbocheetah
- Remove Servlet
- Remove silent placeholders (
$!placeholder
) - Remove
#errorCatcher
directive - Remove WebWare support
- Remove FileUtils
- Remove hasName
- Remove Indenter
- Remove
#indent
directive - Remove cheetah eval
c'$var'
syntax - Remove import hook, live compiling, compilation cache
- Remove CheetahWrapper
- Remove
#I18n
macro - Improve cmdline interface
- Remove several magical imports (
time
,currentTime
, etc.) - Remove
#unicode
directive - Remove
#breakpoint
directive - Remove
#unless
directive - Remove
#repeat
directive - Remove
#capture
directive - Improve compiling interface. There are now three functions: (
compile_source
,compile_file
,compile_to_class
) - Remove
#defmacro
directive - Remove
#include
directive - Remove
getFileContents
- Remove preprocessors
- Remove
addSrcTimeToOutput
setting - Remove
disabledDirectives
setting - Remove
pre
/post
ParseDirective
hooks - Remove placeholder hooks
- Remove expression hooks
- Remove
I18NFunctionName
- Remove
EmptySingleLineMethods
setting - Remove
allowWhitespaceAfterDirectiveStartToken
- Remove
templateMetaclass
setting - Require
unicode
for compiling source - Remove
#transform
directive - Remove
Websafe
,Markdown
,CodeHighlight
,Maxlen
,Strip
filters - Remove aliases for
BaseFilter
- Remove
namespaces
argument forTemplate
constructor - Remove
#stop
directive - Remove
useFilters
setting (always True) - Remove
allowPlaceholderFilterArgs
setting - Remove
encoding
setting - Remove
EOLSlurp
feature - Remove
#raw
directive - Remove C implementation of filters
- Remove
outputMethodsBeforeAttributes
setting - Remove
defDocStrMsg
setting - Remove
handlerForExtendsDirective
setting - Remove
__str__
from all objects - Remove support for pypy (Delete python implementation of NameMapper)
- Remove
useStackFrames
setting - Remove
#importsettings
directive - Remove
#compiler-settings python
directive - 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