| 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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While I can believe that the standard exception might not have worked
with some ancient version of pytest, it certainly works just fine now.
This saves people from importing nose which kills pytest
via DeprecationWarnings these days.
Closes: #316
Pull-request: https://github.com/sqlalchemy/mako/pull/316
Pull-request-sha: 90dfcfc3d0351ab9bf8125e8c2adb45c57059a6d
Change-Id: Ie816acd325c6783e08801bc83de37dbe6b4581e5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replaced usage of the long-superseded "parser.suite" module in the
mako.util package for parsing the python magic encoding comment with the
"ast.parse" function introduced many years ago in Python 2.5, as
"parser.suite" is emitting deprecation warnings in Python 3.9.
Additionally repair two error-detection unit tests that were using a
"print" statement despite the tests running under Python 3; while the
tests were passing they were no longer testing the right thing.
Fixes: #310
Change-Id: Id436e2c6620438ef16b3f188b989233c82972b29
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mako 1.1 now supports Python versions:
* 2.7
* 3.4 and higher
This includes that setup.py no longer includes any conditionals, allowing
for a pure Python wheel build, however this is not necessarily part of the
Pypi release process as of yet. The test suite also raises for Python
deprecation warnings.
Fixes: #249
Replaced usage of ``inspect.getfullargspec()`` with the vendored version
used by SQLAlchemy, Alembic to avoid future deprecation warnings. Also
cleans up an additional version of the same function that's apparently
been floating around for some time.
Fixes: #295
Change-Id: I98274c16b6022289d1890f4daf532bab323ab112
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Using URIs as entrered will make the stack trace arguably more readable than
using the module name which is the URI with non-word characters replaced by
underscores.
This change also fixes a mistake where a mods cache hit would not update
template_filename, causing a stale filename to be displayed if the stack
trace alternates between different templates. There now is a test case for
this.
Closes: #298
Pull-request: https://github.com/sqlalchemy/mako/pull/298
Pull-request-sha: ea35208d504932561711cdb574ec1f7def1e7060
Change-Id: Ieb606f6b6b7f4602d4d56694dd0bccf6dc287d20
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In some situations, it is inconvenient to pass default_filters in the
Template constructor depending on the template in question. It might be
easier in such situations to express page filters in the template itself.
However, dropping the existing default_filters (either explicitly set or the
default of ["str"] resp. ["unicode"]) might break existing templates.
The code change here comes to the rescue in such situations. Existing
templates keep working as they are, but editors of templates get a tool to
replace the default filters for specific templates. They do take on the
responsibility of turning all encountered inputs into strings, lest they
fail along the lines of https://github.com/sqlalchemy/mako/issues/272.
This change should be sufficiently backwards compatible to not cause any
concerns. Sure, technically a "n" filter at page tag level was treated as a
no-op so far. So theoretically existing templates could break. But there
was no incentive to have such an "n" filter at the page tag level, and the
expressed semantics of the "n" filter is to suppress default filters, so
semantically anyone relying on it being a no-op in that situation was using
unsupported hacks anyway.
Closes: #299
Pull-request: https://github.com/sqlalchemy/mako/pull/299
Pull-request-sha: f8d5a22db3230634d2b42c59909985f31875a9f5
Change-Id: Ide030975229c1df7c0cef534976f740a03c17ca6
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Improved the line-number tracking for source lines inside of Python ``<%
... %>`` blocks, such that text- and HTML-formatted exception traces such
as that of :func:`.html_error_template` now report the correct source line
inside the block, rather than the first line of the block itself.
Exceptions in ``<%! ... %>`` blocks which get raised while loading the
module are still not reported correctly, as these are handled before the
Mako code is generated. Pull request courtesy Martin von Gagern.
Closes: #297
Pull-request: https://github.com/sqlalchemy/mako/pull/297
Pull-request-sha: 60ad749604f8de0a9b8133430995045a93d0939c
Change-Id: I2086e4370e8e2db7099de01743840286f0160efc
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As this is an old module that keeps changing with new Python
releases, combined with the fact that we no longer use "import *",
remove all unused functions from this module so that the list
of imports we are maintaining is much shorter.
Python 3.8 is also added to tox.ini with more adjustments to
test_exceptions to accommodate for quoting differences.
Fixes: #296
Change-Id: I0cea7d21ecb2be9335e0845ae7fbd06d468a137b
|
|
|
|
| |
Change-Id: Ia047c7052a6d242c2cf1c7a83981f1e38ea4d928
|
|
|
|
|
|
|
|
|
|
| |
Added a default encoding of "utf-8" when the :class:`.RichTraceback`
object retrieves Python source lines from a Python traceback; as these
are bytes in Python 3 they need to be decoded so that they can be
formatted in the template.
Fixes: #293
Change-Id: I41a5c09422d6500c7cab2423ed14ac951a64e2f4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Change-Id: Ibdfe5b2f2f3d1426921bcadf6740ae065ed0833b
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
| |
changes in pygments formatting; we might be losing
a bit of what was tested here originally but we still assert pygments
is taking place.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This allows the lexer to correctly handle strings like:
${'backslash quote right-curly is \\\'}'}
And also allows users to use the bitwise-or operator to mean bitwise or
simply by enclosing the expression inside parens:
${(0x5432 | 0x8000)}
or by using it in the middle of a dictionary literal:
${ {'foo-val': 0x43 | 0x100, 'bar-val': 0x22 | 0x100}[thing+'-val']}
or inside brackets:
${ big_lookup_dict[index_low | (indexhigh << 3)] }
Basically, only "top level" uses of the vertical bar mean pipe.
(Note that currently, any non-top-level use of the vertical bar in
an expression just results in a syntax error in the generated python,
so no working code is affected by this change)
|
|\ \
| |/
|/|
| | |
pr16
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If mako templates contain something like "_('Köln')", babel extractor converts
it to pure ASCII so that resulting .po file would contain "K\xf6ln". Not all
translation tools and translations are ready for such kind of escape sequences.
Babel allows message ids to be non-ascii, the plugin just has to return Unicode
objects instead of ASCII strings (and that's exactly how Babel built-in Python
and JavaScript extractors work).
This fix ensures mako extractor doesn't excape non-ascii symbols, works well
both for Unicode and non-unicode input (there is a test for cp1251 encoding),
and also provides a workaround for babel charset detector python-babel/babel#274.
|
| |
| |
| |
| |
| |
| | |
- posixpath.join does not handle windows paths very well.
Now all tests pass on py27 & py34 on windows.
|
| | |
|
| |
| |
| |
| | |
spaces inside curly brackets.
|
| |
| |
| |
| | |
error.
|
| | |
|
| | |
|
| | |
|
|/
|
|
| |
Signed-off-by: Cody Taylor <codemister99@yahoo.com>
|
|
|
|
| |
(cherry picked from commit 41be41e72522d71792bdbbdc391ad983af88d0a5)
|
| |
|
|
|
|
|
| |
dogpile, "generic"
- stress dogpile a bit more in caching docs
|
|
|
|
| |
these symbols still seem to be hanging around
|
|
|
|
| |
- remove nose dependency
|
|
|
|
| |
This gives a saner way to call into lingua's Python extractor.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
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
|
| |
|
| |
|
|
|
|
|
| |
- drop python 2.4, 2.5 support
- various pep8ing
|
|
|
|
|
|
|
| |
- write a test suite for cmdline
- start using context manager helpers in tests. intrinsic here is that
we're going to go 1.0 and drop at least 2.4 and probably 2.5
- update .gitignore
|
|
|
|
|
|
| |
non-ASCII bytes. This is invalid on py3K as __str__() must return a
string. send the object through the function recursively when we
get the __str__() value.
|
|
|
|
|
|
|
| |
would not be correctly interpreted in Python 3.
Conflicts:
doc/build/changelog.rst
|
|
|
|
| |
- fix this update_wrapper thing so tests are reported nicely
|
|
|
|
|
| |
when a "try/except" targeted a tuple of exception types, rather
than a single exception. fixes #227
|