| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Change-Id: I1ae40f516c03801427063175d6b18a60556fbd29
|
|
|
|
| |
Change-Id: I1aef208387ea7d25462b8effdfc298e89c74dadd
|
|
|
|
|
|
|
|
| |
Closes: #342
Pull-request: https://github.com/sqlalchemy/mako/pull/342
Pull-request-sha: 21a068103481410cf4856fb07c19146dc684d460
Change-Id: I9027433ec23ee19c9d9a47015e0327acf409e2d8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
## [Setup.py](setup.py)
- Use `with` when opening file to ensure closure
## [Util.py](mako/util.py)
- Remove unnecessary else after guard condition
- Replace if statement with if expression
- Remove unnecessary else after guard condition
- Replace unneeded comprehension with generator
- Inline variable that is immediately returned
## [Template.py](mako/template.py)
- Replace if statement with if expression, Simplify if expression by using or
- Replace list(), dict() or set() with comprehension
- Swap if/else branches, Merge else clause's nested if statement into elif
## [Runtime.py](mako/runtime.py)
- Remove unnecessary else after guard condition
## [PyParser.py](mako/pyparser.py)
- Replace yield inside for loop with yield from
- Lift code into else after jump in control flow, Merge else clause's nested if statement into elif
- Replace if statement with if expression
## [Pygen.py](mako/pygen.py)
- Merge nested if conditions
- Simplify conditional into return statement (removes comment)
- Replace if statement with if expression, Simplify boolean if expression
## [Parsetree.py](mako/parsetree.py)
- Replace unneeded comprehension with generator
- Merge else clause's nested if statement into elif
- Replace unneeded comprehension with generator
## [Lookup.py](mako/lookup.py)
- Swap if/else branches, Merge else clause's nested if statement into elif
- Swap if/else branches, Remove unnecessary else after guard condition
## [Lexer.py](mako/lexer.py)
- Replace if statement with if expression
- Merge nested if conditions
- Swap if/else branches, Remove unnecessary else after guard condition, Merge else clause's nested if statement into elif
- Swap if/else branches, Remove unnecessary else after guard condition
## [Exceptions.py](mako/exceptions.py)
- Replace if statement with if expression, Use `with` when opening file to ensure closure
## [Ast.py](mako/ast.py)
- Replace multiple comparisons of same variable with `in` operator
## [Pygmentplugin.py](mako/ext/pygmentplugin.py)
- Replace if statement with if expression
Closes: #335
Pull-request: https://github.com/sqlalchemy/mako/pull/335
Pull-request-sha: c6243b116441f4b14e1cff00f47ed72aee3d3133
Change-Id: I9093e2f5ca4bb59aa12536b1a0bdf2d58514aa40
|
|
|
|
|
|
|
|
|
|
|
| |
- 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 Python deprecation issues related to module importing, as well as
file access within the Lingua plugin, for deprecated APIs that began to
emit warnings under Python 3.10. Pull request courtesy Petr Viktorin.
This modernizes the code to avoid `DeprecationWarning` and `ResourceWarning` encountered in the test suite under Python 3.10a4:
- [load_module](https://docs.python.org/3/library/importlib.html#importlib.abc.Loader.load_module) is deprecated
- Some files weren't being closed
This changes the semantics of the `compat.load_module` function: on Python 3.5+, the module is no longer inserted in `sys.modules`. All non-test calls did `del sys.modules[self.module_id]` right after the call, anyway. On older Python, the module is inserted and then deleted.
(Some additional `DeprecationWarning` come from Setuptools: https://github.com/pypa/setuptools/pull/2517)
Closes: #328
Pull-request: https://github.com/sqlalchemy/mako/pull/328
Pull-request-sha: 87c1d09e5f39de7b19e749568c437928580f7553
Change-Id: I9cb3772f6812ef14297792344caf2f9aa5337adf
|
|
|
|
|
|
| |
also fix one flake8 error
Change-Id: Ia828267fce34d5b194898e3e301b6d463470f068
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Change-Id: I258e9ff77e5a9ac687cd20d33b6d75de7c79b4dc
|
|
|
|
| |
Change-Id: Ia047c7052a6d242c2cf1c7a83981f1e38ea4d928
|
|
|
|
| |
on Python 3.6+
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
|\
| |
| |
| | |
pr16
|
| | |
|
|/ |
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
|
|
|
| |
- move CHANGES to changelog.rst
|
| |
|
|
|
|
|
|
| |
file warnings when running the tests under
various Pythons with warnings turned on.
[ticket:213]
|
|
|
|
|
|
| |
against a module compiled to the filesystem would
fail trying to produce a RichTraceback due to the
content being in bytes. [ticket:209]
|
| |
|
|
|
|
|
| |
TemplateLookup, allows alternate Lexer classes
to be used.
|
|
|
|
| |
waiting on further detail what I'm missing here
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
(``.. versionadded::``, ``.. versionchanged::`` and ``.. deprecated::``),
update docs CSS to put those infos into boxes.
|
|
|
|
|
| |
add more litterals, systematicaly use ``.. sourcecode::`` before code samples,
add some ``:func:``, ``:class:`` and so on, fix some links, etc.
|
|
|
|
|
|
| |
fix misspelled words, remove line ending spaces, change ``-`` to ``--``,
add some ``'`` between subject and 'to be' verb (e.g. "it's", "i'm"),
add some ending dots to sentences, change some letters "capitalness", etc.
|
|
|
|
|
| |
- fix up links, formatting in docs
- remove some repetition in the _compile logic
|
|
|
|
| |
- changelog
|
|
|
|
|
| |
to filehandles being implicitly closed.
[ticket:182]
|
|
|
|
|
|
|
| |
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]
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
system, whereby the usage of Beaker is just the
default plugin. Template and TemplateLookup
now accept a string "cache_impl" parameter which
refers to the name of a cache plugin, defaulting
to the name 'beaker'. New plugins can be
registered as pkg_resources entrypoints under
the group "mako.cache", or registered directly
using mako.cache.register_plugin(). The
core plugin is the mako.cache.CacheImpl
class.
- The <%def>, <%block> and <%page> tags now accept
any argument named "cache_*", and the key
minus the "cache_" prefix will be passed as keyword
arguments to the CacheImpl methods.
- Template and TemplateLookup now accept an argument
cache_args, which refers to a dictionary containing
cache parameters. The cache_dir, cache_url, cache_type,
cache_timeout arguments are deprecated (will probably
never be removed, however) and can be passed
now as cache_args={'url':<some url>, 'type':'memcached',
'timeout':50, 'dir':'/path/to/some/directory'}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
- misc cleanup
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
| |
- convert heading copyrights to 2006-2011, reference AUTHORS file
|
| |
|