aboutsummaryrefslogtreecommitdiffstats
path: root/mako
Commit message (Collapse)AuthorAgeFilesLines
* Version 1.1.4 placeholderMike Bayer2020-05-291-1/+1
|
* Switch template encoding to utf-8Mike Bayer2020-05-291-2/+2
| | | | | | | | | 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
* Version 1.1.3 placeholderMike Bayer2020-03-011-1/+1
|
* Add --output-file option to mako-renderBjörn Dahlgren2020-02-261-1/+15
| | | | | | | | | | Added --output-file argument to the Mako command line runner, which allows a specific output file to be selected. Pull request courtesy Björn Dahlgren. Fixes: #283 Change-Id: Iae7e2d42d5ae4bc6f09663c115bda9e3797ce68c Pull-request: https://bitbucket.org/zzzeek/mako/pull-requests/27
* Version 1.1.2 placeholderMike Bayer2020-01-201-1/+1
|
* Replace usage of parser.suite with ast.parseMike Bayer2020-01-051-3/+3
| | | | | | | | | | | | | | 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
* happy new yearMike Bayer2020-01-0525-37/+35
| | | | | | also fix one flake8 error Change-Id: Ia828267fce34d5b194898e3e301b6d463470f068
* Version 1.1.1 placeholderMike Bayer2019-08-011-1/+1
|
* Bump Python versions, remove conditional importsMike Bayer2019-07-275-102/+45
| | | | | | | | | | | | | | | | | | | | | | 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
* Merge "use timeit.default_timer instead of time.clock() / time.time()"mike bayer2019-07-272-8/+3
|\
| * use timeit.default_timer instead of time.clock() / time.time()Christoph Reiter2019-07-272-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaced usage of time.clock() on windows as well as time.time() elsewhere for microsecond timestamps with timeit.default_timer(), as time.clock() is being removed in Python 3.8. Pull request courtesy Christoph Reiter. Fixes: #301 Closes: #302 Pull-request: https://github.com/sqlalchemy/mako/pull/302 Pull-request-sha: a706e952727337702692fd1d8369d259e1600d6e Change-Id: I24e2cd3d2c02323a6fa2b063e86cabe555df2036
* | bump to 1.1Mike Bayer2019-07-271-1/+1
|/ | | | | | We want to bump Python versions so add a major release bump. Change-Id: I4b21d3782c701e4b21c5ef53c0a19eee8d2d7a40
* Version 1.0.15 placeholderMike Bayer2019-07-201-1/+1
|
* Merge "Include URI in traceback if filename is unknown"mike bayer2019-07-082-6/+13
|\
| * Include URI in traceback if filename is unknownMartin von Gagern2019-07-082-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Support n filter in the page tagMartin von Gagern2019-07-081-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Version 1.0.14 placeholderMike Bayer2019-07-011-1/+1
|
* Correctly track line numbers for multi-line code blocksMartin von Gagern2019-07-012-6/+8
| | | | | | | | | | | | | | | | 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
* Version 1.0.13 placeholderMike Bayer2019-06-051-1/+1
|
* Remove all non-essential functions from _ast_util.pyMike Bayer2019-06-031-184/+3
| | | | | | | | | | | | | 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
* Version 1.0.12 placeholderMike Bayer2019-05-311-1/+1
|
* - update copyrightMike Bayer2019-05-3125-21/+45
| | | | Change-Id: I258e9ff77e5a9ac687cd20d33b6d75de7c79b4dc
* Use tox / zimportsMike Bayer2019-05-3125-1473/+1937
| | | | Change-Id: Ia047c7052a6d242c2cf1c7a83981f1e38ea4d928
* Version 1.0.11 placeholderMike Bayer2019-05-101-1/+1
|
* Use utf-8 encoding for traceback source with no encoding in py3kMike Bayer2019-05-091-0/+2
| | | | | | | | | | 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
* Version 1.0.10 placeholderMike Bayer2019-04-151-1/+1
|
* Use Constant.value, not Constant.nMiro Hrončok2019-04-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | Since Python 3.8, class ast.Constant is used for all constants. Old classes ast.Num, ast.Str, ast.Bytes, ast.NameConstant and ast.Ellipsis are still available, but they will be removed in future Python releases. Further corrected the previous fix for :ticket:`287` as it relied upon an attribute that is monkeypatched by Python's ``ast`` module for some reason, which fails if ``ast`` hasn't been imported; the correct attribute ``Constant.value`` is now used. Also note the issue was mis-numbered in the previous changelog note. References: https://github.com/Pylons/pyramid_mako/issues/47 Fixes: #287 Closes: #292 Pull-request: https://github.com/sqlalchemy/mako/pull/292 Pull-request-sha: b48081aa08fdc1cb6e0196b59a2d0eff35adcd94 Change-Id: Ic3fd1975e608b6890410f3fd4ad4d949478dc45e
* Version 1.0.9 placeholderMike Bayer2019-03-201-1/+1
|
* Add Constant to _ast_utilMike Bayer2019-03-201-0/+4
| | | | | | | | Python 3.8 seems to require this be present for expression generation to succeed. Fixes: #287 Change-Id: I4a3ac22c74e3c96f5f15d349fc8fe2523d6e7def
* Remove redundant Python<2.6 codeHugo2018-01-161-1/+0
| | | | | | | | | | | | | | | | | | | | | 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
* Removed unnecessary "usage" prefix from mako-render script.Hugo2018-01-161-1/+1
| | | | | | | | Pull request courtesy Hugo. (cherry picked from commit 7e6a1d7822bac275aabb3c1cc90cb67612548127) Change-Id: I84a302c982f18762d2514c3f840331d1eb3ebcda
* Add --output-encoding to mako-renderlacsaP2017-11-152-3/+9
| | | | | Fixes: #271 Change-Id: I88b46cfbdea9eda0b4c478dd97829bee8431ff58
* Use sys.stdout.write instead of print in cmdlineYves Chevallier2017-07-051-1/+1
| | | | | | | The `print` function adds an unwanted `\n` char. Change-Id: I4e345214352f0925c374145f41be45550da27393 Pull-request: https://github.com/zzzeek/mako/pull/23
* - 1.0.7 placeholderMike Bayer2017-07-051-1/+1
| | | | Change-Id: Ic586955b3faf41632da794792ecc9ae447a4051e
* Merge branch 'master' of github.com:zzzeek/makoMike Bayer2017-05-173-9/+9
|\
| * Marked some docstrings as raw strings to address the invalid escape warning ↵Yannick Gingras2017-05-103-9/+9
| | | | | | | | on Python 3.6+
* | Spelling fixesVille Skyttä2017-05-112-2/+2
|/
* Add include_error_handler parameter.Huayi Zhang2016-11-083-3/+34
| | | | | | | | 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
* - 1.0.6 placeholderMike Bayer2016-11-081-1/+1
| | | | Change-Id: Ib357002b0c919ce532c9b67ba40fcee91ba2554c
* - add 1.0.5 + changelog for the sphinx fixMike Bayer2016-11-021-1/+1
| | | | in 161b1cf57a3777922fd3e05a6e1314386c2a3912
* - happy new yearMike Bayer2016-03-1021-21/+21
|
* - disable some beaker tests that fail for 2.6Mike Bayer2016-03-091-0/+1
|
* Merge remote-tracking branch 'github/pr/19'Mike Bayer2016-03-091-10/+16
|\
| * Improve lexer with better string handling and grouping parens/bracketsDaniel Martin2016-02-041-10/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* | - changelog for pr 16Mike Bayer2016-03-091-2/+6
| |
* | Merge branch 'feature-list_defs' of https://bitbucket.org/jvanasco/mako into ↵Mike Bayer2016-03-091-0/+4
|\ \ | | | | | | | | | pr16
| * | added `Template.list_defs`jonathan vanasco2015-03-111-0/+4
| | |
* | | - version bumpMike Bayer2016-03-091-1/+1
| |/ |/|
* | - changelog for pullreq bitbucket:21Mike Bayer2015-10-261-1/+1
| |
* | Ensure babel i18n extactor works properly with non-ascii inputRoman Imankulov2015-10-131-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.