| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
The default template encoding is now utf-8. Previously, the encoding was
"ascii", which was standard throughout Python 2. This allows that
"magic encoding comment" for utf-8 templates is no longer required.
Fixes: #267
Change-Id: I411a75ebd6161e2517e06b5180a3571e5f5d923e
|
|
|
|
| |
Change-Id: Ia047c7052a6d242c2cf1c7a83981f1e38ea4d928
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Includes PR https://github.com/zzzeek/mako/pull/26 so [Travis CI passes](https://travis-ci.org/hugovk/mako/builds/329346809). The last two commits are unique to this PR.
---
Since Mako 1.0.0, Python 2.6 has been the minimum supported version:
> [general] Compatibility changes; in order to modernize the codebase, Mako is now dropping support for Python 2.4 and Python 2.5 altogether. The source base is now targeted at Python 2.6 and forwards.
http://docs.makotemplates.org/en/latest/changelog.html#change-b602a175c0ec26eaa4f42962d23cca96
This removes redundant code only relevant to Python 2.5 or earlier.
It also adds `python_requires` to setup.py, so pip won't install this version on Python 2.5 or earlier. For people with older versions, pip will install the next Mako version down.
Are all Python 3.x versions supported? If not, I'll add those to `python_requires` as well.
Change-Id: I624e1d56e79555c579278c7a5b4de9498179ffe9
Pull-request: https://github.com/zzzeek/mako/pull/27
|
|
|
|
|
|
|
|
| |
This works like error_handler but is specific to a template
when included in another using the include tag.
Change-Id: Ie5506a8cba42c71519c703eacc82050902b9ceba
Pull-request: https://bitbucket.org/zzzeek/mako/pull-requests/22
|
| |
|
|
|
|
| |
Signed-off-by: Cody Taylor <codemister99@yahoo.com>
|
|
|
|
| |
(cherry picked from commit 41be41e72522d71792bdbbdc391ad983af88d0a5)
|
|
|
|
|
| |
record all linenos fully and track printed line numbers accurately
wrt buffered lines and such.
|
|
|
|
|
|
|
| |
for the template and the module
- turn full_line_map into a list
- add another start source to help with when a render callable
begins
|
| |
|
|
|
|
|
|
| |
file warnings when running the tests under
various Pythons with warnings turned on.
[ticket:213]
|
|
|
|
|
| |
TemplateLookup, allows alternate Lexer classes
to be used.
|
| |
|
|
|
|
|
| |
having some weird unicode issues I can't debug; the meaning of
str.encode() seems to be changing globally somehow
|
|
|
|
|
| |
Changed keyword argument from futures to future_imports for clarity.
Added docstring describing use.
|
|
|
|
|
|
| |
Provide a list of names to import from __future__ to Template or
TemplateLookup, and it will render the import from __future__
statement at the top of the generated code so that it actually works.
|
| |
|
|
|
|
|
| |
- add conditionals to pygments-dependent tests that ensure
pygments 1.4, separate check for no pygments.
|
| |
|
|
|
|
|
|
| |
now succeed, as "pass" is added for these
when no statements are otherwise present.
Courtesy Ben Trofatter [ticket:146]
|
| |
|
| |
|
|
|
|
|
|
|
| |
TemplateLookup, allows a callable to be passed which
takes over the writing of the template's module source
file, so that special environment-specific steps
can be taken. [ticket:181]
|
|
|
|
| |
is now escaped with the HTML filter. [ticket:142]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
from having a url that normalizes to relative outside
of the root. That is, if the Lookup is based
at /home/mytemplates, an include that would place
the ultimate template at
/home/mytemplates/../some_other_directory,
i.e. outside of /home/mytemplates,
is disallowed. This usage was never intended
despite the lack of an explicit check.
The main issue this causes
is that module files can be written outside
of the module root (or raise an error, if file perms aren't
set up), and can also lead to the same template being
cached in the lookup under multiple, relative roots.
TemplateLookup instead has always supported multiple
file roots for this purpose.
[ticket:174]
|
| |
|
|
|
|
|
|
|
|
|
| |
because a string and an ascii encoded string are of course
different things, and we'd like render() by default to return a
string. So go the other way, use FEB in all cases,
add a new flag bytestring_passthrough which goes back to StringIO,
to support that one guy who wanted to force a bytestring through
in an expression.
|
|
|
|
|
|
|
|
| |
it's internal _data dictionary, now
include just what was specified to
render() as well as Mako builtins
'caller', 'capture'. The contents
of __builtin__ are no longer copied.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- The "output encoding" now defaults
to "ascii", whereas previously
it was set to None. This has the effect
of FastEncodingBuffer being used internally
by default when render() is called, instead
of cStringIO or StringIO, which are
slower, but allow bytestrings with
unknown encoding to pass right through.
It is of course not recommended to use
bytestrings of unknown encoding. Usage of
the "disable_unicode" mode also requires
that output_encoding be set to None.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
are considered "undefined", meaning they
are pulled from the context, has been
trimmed back to not include variables
declared inside of expressions (i.e. from
list comprehensions), as well as
in the argument list of lambdas. This
to better support the strict_undefined
feature.
|
|
|
|
|
|
|
| |
strict_undefined=True, will cause
variables not found in the context to
raise a NameError immediately, instead of
defaulting to the UNDEFINED value.
|
| |
|
|
|
|
|
|
|
| |
is passed only an absolute filename (i.e. with c:
drive etc.) and no URI - the URI is converted
to a forward-slash path and module_directory
is treated as a windows path. [ticket:128]
|
|
|
|
|
|
|
| |
inheriting template - the full set of render()
arguments are passed down through the inherits
chain. Undeclared arguments go into **pageargs
as usual. [ticket:116]
|
|
|
|
|
| |
% if: %endif, etc. [ticket:94]
- finished cleanup for codegen.py, [ticket:98]
|
|
|
|
|
|
| |
- Python 3 support is added ! See README.py3k
for installation and testing notes.
[ticket:119]
|
|
|
|
|
|
|
|
|
|
|
| |
- Source code escaping has been simplified.
In particular, module source files are now
generated with the Python "magic encoding
comment", and source code is passed through
mostly unescaped, except for that code which
is regenerated from parsed Python source.
This fixes usage of unicode in
<%namespace:defname> tags. [ticket:99]
|
|
|
|
|
|
|
| |
as ad-hoc
HTML file writing, consistently cleanup the modules/cache directories, use
nose skiptests for unsupported features.
|
| |
|
|
|