| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Various fixes to the test suite in the area of exception message rendering
to accommodate for variability in Python versions as well as Pygments.
builds on 9b8da4b1e2bdc025b643f2061aa32 which also
reduced some of the checks for exception message formatting.
also updates black to 22.3.0 as there seem to be some dependency
issues with the older version
Fixes: #360
Change-Id: Ib8916534699e7c57817cf82d53300e50d47d0d50
|
|
|
|
|
| |
Fixes: #349
Change-Id: I202c252a913fb72cc328a6e7f0f33174802487d3
|
|
|
|
|
|
| |
Fixes #352
Change-Id: I051ec20505464559e9399a8f1ac4a39dc323902a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mako now performs exception chaining using ``raise from``, correctly
identifying underlying exception conditions when it raises its own
exceptions. Pull request courtesy Ram Rachum.
Additionally includes cleanup of the test suite to include
better exception fixtures.
Closes: #319
Pull-request: https://github.com/sqlalchemy/mako/pull/319
Pull-request-sha: d06526ac3f80ca9d24cd8143d8afde254f80b094
Additionally:
Fixes: #348
Change-Id: Ibb2864de822bf4b63adf22a6bb32cf0758d296bd
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixed issue where control statements on multi lines with a backslash would
not parse correctly if the template itself contained CR/LF pairs as on
Windows. Pull request courtesy Charles Pigott.
A missing '\\' meant that it would actually allow
```
% if foo \r
bar:
```
in a template file and not match if the file actually had a `\r` char
Closes: #346
Pull-request: https://github.com/sqlalchemy/mako/pull/346
Pull-request-sha: e79ebabe3df7e59c9ea40e62406131e1a0c6c3b4
Change-Id: I179bdd661cecb1ffb3cf262e31183c8e83d98f12
|
|
|
|
|
|
|
|
| |
Closes: #342
Pull-request: https://github.com/sqlalchemy/mako/pull/342
Pull-request-sha: 21a068103481410cf4856fb07c19146dc684d460
Change-Id: I9027433ec23ee19c9d9a47015e0327acf409e2d8
|
|
|
|
|
|
|
|
|
|
|
| |
- 2021 copyright
- remove unneeded compat functions
- remove unneeded filter constructs
- bytestring_passthrough mode doesn't actually do anything,
as Py3k StringIO doesn't accept bytes in any case, remove this
- should we call ourselves 2.0 and do semver ?
Change-Id: I8a8cb5e78037b758e58c87d5d7b4f66b6c211419
|
|
|
|
|
|
|
|
|
|
|
| |
- remove python 2 support
- add github workflows
- remove disable unicode
- cleanup compat file
- modernize setup
- use pep517
Change-Id: Ic38dbf478046cec5d0815b468f0c235b4ea5e20c
|
|
|
|
|
|
|
|
| |
Fixed some issues with running the test suite which would be revealed by
running tests in random order.
Fixes: #338
Change-Id: I90c2a86f9279a265f64b75be3a7af314ab8772ba
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|