summaryrefslogtreecommitdiff
path: root/mako
AgeCommit message (Collapse)Author
2020-03-01Version 1.1.3 placeholderMike Bayer
2020-02-26Add --output-file option to mako-renderBjörn Dahlgren
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
2020-01-20Version 1.1.2 placeholderMike Bayer
2020-01-05Replace usage of parser.suite with ast.parseMike Bayer
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
2020-01-05happy new yearMike Bayer
also fix one flake8 error Change-Id: Ia828267fce34d5b194898e3e301b6d463470f068
2019-08-01Version 1.1.1 placeholderMike Bayer
2019-07-27Bump Python versions, remove conditional importsMike Bayer
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
2019-07-27Merge "use timeit.default_timer instead of time.clock() / time.time()"mike bayer
2019-07-27use timeit.default_timer instead of time.clock() / time.time()Christoph Reiter
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
2019-07-27bump to 1.1Mike Bayer
We want to bump Python versions so add a major release bump. Change-Id: I4b21d3782c701e4b21c5ef53c0a19eee8d2d7a40
2019-07-20Version 1.0.15 placeholderMike Bayer
2019-07-08Merge "Include URI in traceback if filename is unknown"mike bayer
2019-07-08Support n filter in the page tagMartin von Gagern
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
2019-07-08Include URI in traceback if filename is unknownMartin von Gagern
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
2019-07-01Version 1.0.14 placeholderMike Bayer
2019-07-01Correctly track line numbers for multi-line code blocksMartin von Gagern
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
2019-06-05Version 1.0.13 placeholderMike Bayer
2019-06-03Remove all non-essential functions from _ast_util.pyMike Bayer
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
2019-05-31Version 1.0.12 placeholderMike Bayer
2019-05-31- update copyrightMike Bayer
Change-Id: I258e9ff77e5a9ac687cd20d33b6d75de7c79b4dc
2019-05-31Use tox / zimportsMike Bayer
Change-Id: Ia047c7052a6d242c2cf1c7a83981f1e38ea4d928
2019-05-10Version 1.0.11 placeholderMike Bayer
2019-05-09Use utf-8 encoding for traceback source with no encoding in py3kMike Bayer
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
2019-04-15Version 1.0.10 placeholderMike Bayer
2019-04-12Use Constant.value, not Constant.nMiro Hrončok
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
2019-03-20Version 1.0.9 placeholderMike Bayer
2019-03-20Add Constant to _ast_utilMike Bayer
Python 3.8 seems to require this be present for expression generation to succeed. Fixes: #287 Change-Id: I4a3ac22c74e3c96f5f15d349fc8fe2523d6e7def
2018-01-16Remove redundant Python<2.6 codeHugo
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
2018-01-16Removed unnecessary "usage" prefix from mako-render script.Hugo
Pull request courtesy Hugo. (cherry picked from commit 7e6a1d7822bac275aabb3c1cc90cb67612548127) Change-Id: I84a302c982f18762d2514c3f840331d1eb3ebcda
2017-11-15Add --output-encoding to mako-renderlacsaP
Fixes: #271 Change-Id: I88b46cfbdea9eda0b4c478dd97829bee8431ff58
2017-07-05Use sys.stdout.write instead of print in cmdlineYves Chevallier
The `print` function adds an unwanted `\n` char. Change-Id: I4e345214352f0925c374145f41be45550da27393 Pull-request: https://github.com/zzzeek/mako/pull/23
2017-07-05- 1.0.7 placeholderMike Bayer
Change-Id: Ic586955b3faf41632da794792ecc9ae447a4051e
2017-05-17Merge branch 'master' of github.com:zzzeek/makoMike Bayer
2017-05-11Spelling fixesVille Skyttä
2017-05-10Marked some docstrings as raw strings to address the invalid escape warning ↵Yannick Gingras
on Python 3.6+
2016-11-08Add include_error_handler parameter.Huayi Zhang
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
2016-11-08- 1.0.6 placeholderMike Bayer
Change-Id: Ib357002b0c919ce532c9b67ba40fcee91ba2554c
2016-11-02- add 1.0.5 + changelog for the sphinx fixMike Bayer
in 161b1cf57a3777922fd3e05a6e1314386c2a3912
2016-03-10- happy new yearMike Bayer
2016-03-09- disable some beaker tests that fail for 2.6Mike Bayer
2016-03-09Merge remote-tracking branch 'github/pr/19'Mike Bayer
2016-03-09- changelog for pr 16Mike Bayer
2016-03-09Merge branch 'feature-list_defs' of https://bitbucket.org/jvanasco/mako into ↵Mike Bayer
pr16
2016-03-09- version bumpMike Bayer
2016-02-04Improve lexer with better string handling and grouping parens/bracketsDaniel Martin
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)
2015-10-26- changelog for pullreq bitbucket:21Mike Bayer
2015-10-13Ensure babel i18n extactor works properly with non-ascii inputRoman Imankulov
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.
2015-08-27correct template lookup on Windows:Gabi Davar
- posixpath.join does not handle windows paths very well. Now all tests pass on py27 & py34 on windows.
2015-08-26- Repair some calls within the ast module that no longer work on Python3.5;Mike Bayer
additionally replace the use of ``inspect.getargspec()`` under Python 3 (seems to be called from the TG plugin) to avoid deprecation warnings. fixes #250
2015-05-14The Lingua extractor must not generate a parse error in case of extra blank ↵Laurent DAVERIO
spaces inside curly brackets.