diff options
author | morpheus65535 <[email protected]> | 2024-03-03 12:15:23 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2024-03-03 12:15:23 -0500 |
commit | 03afeb347075381bcb7fd6036295c9fa4a90d2dc (patch) | |
tree | 7c5d72c973d2c8e4ade57391a1c9ad5e94903a46 /libs/mako | |
parent | 9ae684240b5bdd40a870d8122f0e380f8d03a187 (diff) | |
download | bazarr-03afeb347075381bcb7fd6036295c9fa4a90d2dc.tar.gz bazarr-03afeb347075381bcb7fd6036295c9fa4a90d2dc.zip |
Updated multiple Python modules (now in libs and custom_libs directories) and React libraries
Diffstat (limited to 'libs/mako')
-rw-r--r-- | libs/mako/__init__.py | 4 | ||||
-rw-r--r-- | libs/mako/_ast_util.py | 2 | ||||
-rw-r--r-- | libs/mako/ast.py | 2 | ||||
-rw-r--r-- | libs/mako/cache.py | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | libs/mako/cmd.py | 3 | ||||
-rw-r--r-- | libs/mako/codegen.py | 4 | ||||
-rw-r--r-- | libs/mako/compat.py | 10 | ||||
-rw-r--r-- | libs/mako/exceptions.py | 2 | ||||
-rw-r--r-- | libs/mako/ext/autohandler.py | 2 | ||||
-rw-r--r-- | libs/mako/ext/babelplugin.py | 2 | ||||
-rw-r--r-- | libs/mako/ext/beaker_cache.py | 2 | ||||
-rw-r--r-- | libs/mako/ext/extract.py | 2 | ||||
-rw-r--r-- | libs/mako/ext/linguaplugin.py | 2 | ||||
-rw-r--r-- | libs/mako/ext/preprocessors.py | 2 | ||||
-rw-r--r-- | libs/mako/ext/pygmentplugin.py | 2 | ||||
-rw-r--r-- | libs/mako/ext/turbogears.py | 2 | ||||
-rw-r--r-- | libs/mako/filters.py | 2 | ||||
-rw-r--r-- | libs/mako/lexer.py | 20 | ||||
-rw-r--r-- | libs/mako/lookup.py | 3 | ||||
-rw-r--r-- | libs/mako/parsetree.py | 2 | ||||
-rw-r--r-- | libs/mako/pygen.py | 2 | ||||
-rw-r--r-- | libs/mako/pyparser.py | 5 | ||||
-rw-r--r-- | libs/mako/runtime.py | 2 | ||||
-rw-r--r-- | libs/mako/template.py | 3 | ||||
-rw-r--r-- | libs/mako/testing/assertions.py | 1 | ||||
-rw-r--r-- | libs/mako/testing/helpers.py | 4 | ||||
-rw-r--r-- | libs/mako/util.py | 2 |
27 files changed, 46 insertions, 45 deletions
diff --git a/libs/mako/__init__.py b/libs/mako/__init__.py index d73392190..d022cf82d 100644 --- a/libs/mako/__init__.py +++ b/libs/mako/__init__.py @@ -1,8 +1,8 @@ # mako/__init__.py -# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file> +# Copyright 2006-2024 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php -__version__ = "1.2.4" +__version__ = "1.3.2" diff --git a/libs/mako/_ast_util.py b/libs/mako/_ast_util.py index 95742835f..63b8f2286 100644 --- a/libs/mako/_ast_util.py +++ b/libs/mako/_ast_util.py @@ -1,5 +1,5 @@ # mako/_ast_util.py -# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file> +# Copyright 2006-2024 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php diff --git a/libs/mako/ast.py b/libs/mako/ast.py index a3f3ee3ec..e59df3eb1 100644 --- a/libs/mako/ast.py +++ b/libs/mako/ast.py @@ -1,5 +1,5 @@ # mako/ast.py -# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file> +# Copyright 2006-2024 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php diff --git a/libs/mako/cache.py b/libs/mako/cache.py index db21bb3e9..bad252575 100644 --- a/libs/mako/cache.py +++ b/libs/mako/cache.py @@ -1,5 +1,5 @@ # mako/cache.py -# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file> +# Copyright 2006-2024 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php diff --git a/libs/mako/cmd.py b/libs/mako/cmd.py index 93a6733fc..3858a1274 100755..100644 --- a/libs/mako/cmd.py +++ b/libs/mako/cmd.py @@ -1,5 +1,5 @@ # mako/cmd.py -# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file> +# Copyright 2006-2024 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php @@ -25,7 +25,6 @@ def _exit(): def cmdline(argv=None): - parser = ArgumentParser() parser.add_argument( "--var", diff --git a/libs/mako/codegen.py b/libs/mako/codegen.py index d1d2c20a0..ce6f83aac 100644 --- a/libs/mako/codegen.py +++ b/libs/mako/codegen.py @@ -1,5 +1,5 @@ # mako/codegen.py -# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file> +# Copyright 2006-2024 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php @@ -816,7 +816,6 @@ class _GenerateRenderMethod: ) or len(self.compiler.default_filters) ): - s = self.create_filter_callable( node.escapes_code.args, "%s" % node.text, True ) @@ -1181,7 +1180,6 @@ class _Identifiers: def visitBlockTag(self, node): if node is not self.node and not node.is_anonymous: - if isinstance(self.node, parsetree.DefTag): raise exceptions.CompileException( "Named block '%s' not allowed inside of def '%s'" diff --git a/libs/mako/compat.py b/libs/mako/compat.py index 48df30d6e..183221595 100644 --- a/libs/mako/compat.py +++ b/libs/mako/compat.py @@ -1,17 +1,17 @@ # mako/compat.py -# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file> +# Copyright 2006-2024 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import collections +from importlib import metadata as importlib_metadata from importlib import util import inspect import sys win32 = sys.platform.startswith("win") pypy = hasattr(sys, "pypy_version_info") -py38 = sys.version_info >= (3, 8) ArgSpec = collections.namedtuple( "ArgSpec", ["args", "varargs", "keywords", "defaults"] @@ -62,12 +62,6 @@ def exception_name(exc): return exc.__class__.__name__ -if py38: - from importlib import metadata as importlib_metadata -else: - import importlib_metadata # noqa - - def importlib_metadata_get(group): ep = importlib_metadata.entry_points() if hasattr(ep, "select"): diff --git a/libs/mako/exceptions.py b/libs/mako/exceptions.py index 31c695fd7..ca2256773 100644 --- a/libs/mako/exceptions.py +++ b/libs/mako/exceptions.py @@ -1,5 +1,5 @@ # mako/exceptions.py -# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file> +# Copyright 2006-2024 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php diff --git a/libs/mako/ext/autohandler.py b/libs/mako/ext/autohandler.py index 5bcfc2858..dff9b6a84 100644 --- a/libs/mako/ext/autohandler.py +++ b/libs/mako/ext/autohandler.py @@ -1,5 +1,5 @@ # ext/autohandler.py -# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file> +# Copyright 2006-2024 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php diff --git a/libs/mako/ext/babelplugin.py b/libs/mako/ext/babelplugin.py index 907d0b808..cdb37cdf3 100644 --- a/libs/mako/ext/babelplugin.py +++ b/libs/mako/ext/babelplugin.py @@ -1,5 +1,5 @@ # ext/babelplugin.py -# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file> +# Copyright 2006-2024 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php diff --git a/libs/mako/ext/beaker_cache.py b/libs/mako/ext/beaker_cache.py index 9aa35b068..590fbd017 100644 --- a/libs/mako/ext/beaker_cache.py +++ b/libs/mako/ext/beaker_cache.py @@ -1,5 +1,5 @@ # ext/beaker_cache.py -# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file> +# Copyright 2006-2024 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php diff --git a/libs/mako/ext/extract.py b/libs/mako/ext/extract.py index 9d33ee184..d03789db5 100644 --- a/libs/mako/ext/extract.py +++ b/libs/mako/ext/extract.py @@ -1,5 +1,5 @@ # ext/extract.py -# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file> +# Copyright 2006-2024 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php diff --git a/libs/mako/ext/linguaplugin.py b/libs/mako/ext/linguaplugin.py index efb04c70a..22077e665 100644 --- a/libs/mako/ext/linguaplugin.py +++ b/libs/mako/ext/linguaplugin.py @@ -1,5 +1,5 @@ # ext/linguaplugin.py -# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file> +# Copyright 2006-2024 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php diff --git a/libs/mako/ext/preprocessors.py b/libs/mako/ext/preprocessors.py index 80403ecda..6d1aaf5d1 100644 --- a/libs/mako/ext/preprocessors.py +++ b/libs/mako/ext/preprocessors.py @@ -1,5 +1,5 @@ # ext/preprocessors.py -# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file> +# Copyright 2006-2024 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php diff --git a/libs/mako/ext/pygmentplugin.py b/libs/mako/ext/pygmentplugin.py index 9acbf4cd6..f422623de 100644 --- a/libs/mako/ext/pygmentplugin.py +++ b/libs/mako/ext/pygmentplugin.py @@ -1,5 +1,5 @@ # ext/pygmentplugin.py -# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file> +# Copyright 2006-2024 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php diff --git a/libs/mako/ext/turbogears.py b/libs/mako/ext/turbogears.py index 2ebf07468..2a3ec7d7a 100644 --- a/libs/mako/ext/turbogears.py +++ b/libs/mako/ext/turbogears.py @@ -1,5 +1,5 @@ # ext/turbogears.py -# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file> +# Copyright 2006-2024 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php diff --git a/libs/mako/filters.py b/libs/mako/filters.py index af202f3f5..2a4b43862 100644 --- a/libs/mako/filters.py +++ b/libs/mako/filters.py @@ -1,5 +1,5 @@ # mako/filters.py -# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file> +# Copyright 2006-2024 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php diff --git a/libs/mako/lexer.py b/libs/mako/lexer.py index 75182f852..9d1f5f30d 100644 --- a/libs/mako/lexer.py +++ b/libs/mako/lexer.py @@ -1,5 +1,5 @@ # mako/lexer.py -# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file> +# Copyright 2006-2024 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php @@ -247,6 +247,8 @@ class Lexer: continue if self.match_python_block(): continue + if self.match_percent(): + continue if self.match_text(): continue @@ -352,14 +354,24 @@ class Lexer: else: return True + def match_percent(self): + match = self.match(r"(?<=^)(\s*)%%(%*)", re.M) + if match: + self.append_node( + parsetree.Text, match.group(1) + "%" + match.group(2) + ) + return True + else: + return False + def match_text(self): match = self.match( r""" (.*?) # anything, followed by: ( - (?<=\n)(?=[ \t]*(?=%|\#\#)) # an eval or line-based - # comment preceded by a - # consumed newline and whitespace + (?<=\n)(?=[ \t]*(?=%|\#\#)) # an eval or line-based + # comment, preceded by a + # consumed newline and whitespace | (?=\${) # an expression | diff --git a/libs/mako/lookup.py b/libs/mako/lookup.py index f7410ce3b..d916db771 100644 --- a/libs/mako/lookup.py +++ b/libs/mako/lookup.py @@ -1,5 +1,5 @@ # mako/lookup.py -# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file> +# Copyright 2006-2024 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php @@ -178,7 +178,6 @@ class TemplateLookup(TemplateCollection): lexer_cls=None, include_error_handler=None, ): - self.directories = [ posixpath.normpath(d) for d in util.to_list(directories, ()) ] diff --git a/libs/mako/parsetree.py b/libs/mako/parsetree.py index c5a12d1d5..04686ece1 100644 --- a/libs/mako/parsetree.py +++ b/libs/mako/parsetree.py @@ -1,5 +1,5 @@ # mako/parsetree.py -# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file> +# Copyright 2006-2024 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php diff --git a/libs/mako/pygen.py b/libs/mako/pygen.py index 57c697931..820e101d3 100644 --- a/libs/mako/pygen.py +++ b/libs/mako/pygen.py @@ -1,5 +1,5 @@ # mako/pygen.py -# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file> +# Copyright 2006-2024 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php diff --git a/libs/mako/pyparser.py b/libs/mako/pyparser.py index d9b090c6f..9b63dc330 100644 --- a/libs/mako/pyparser.py +++ b/libs/mako/pyparser.py @@ -1,5 +1,5 @@ # mako/pyparser.py -# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file> +# Copyright 2006-2024 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php @@ -64,7 +64,6 @@ class FindIdentifiers(_ast_util.NodeVisitor): self._add_declared(node.name) def visit_Assign(self, node): - # flip around the visiting of Assign so the expression gets # evaluated first, in the case of a clause like "x=x+5" (x # is undeclared) @@ -99,7 +98,6 @@ class FindIdentifiers(_ast_util.NodeVisitor): yield arg def _visit_function(self, node, islambda): - # push function state onto stack. dont log any more # identifiers as "declared" until outside of the function, # but keep logging identifiers as "undeclared". track @@ -122,7 +120,6 @@ class FindIdentifiers(_ast_util.NodeVisitor): self.local_ident_stack = local_ident_stack def visit_For(self, node): - # flip around visit self.visit(node.iter) diff --git a/libs/mako/runtime.py b/libs/mako/runtime.py index 6d7fa684a..23401b70c 100644 --- a/libs/mako/runtime.py +++ b/libs/mako/runtime.py @@ -530,7 +530,7 @@ class Namespace: def _populate(self, d, l): for ident in l: if ident == "*": - for (k, v) in self._get_star(): + for k, v in self._get_star(): d[k] = v else: d[ident] = getattr(self, ident) diff --git a/libs/mako/template.py b/libs/mako/template.py index 8c70731dc..e27717276 100644 --- a/libs/mako/template.py +++ b/libs/mako/template.py @@ -1,5 +1,5 @@ # mako/template.py -# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file> +# Copyright 2006-2024 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php @@ -26,7 +26,6 @@ from mako.lexer import Lexer class Template: - r"""Represents a compiled template. :class:`.Template` includes a reference to the original diff --git a/libs/mako/testing/assertions.py b/libs/mako/testing/assertions.py index 14ea63523..22221cd20 100644 --- a/libs/mako/testing/assertions.py +++ b/libs/mako/testing/assertions.py @@ -103,7 +103,6 @@ def _assert_raises( check_context=False, cause_cls=None, ): - with _expect_raises(except_cls, msg, check_context, cause_cls) as ec: callable_(*args, **kwargs) return ec.error diff --git a/libs/mako/testing/helpers.py b/libs/mako/testing/helpers.py index 77cca3672..5ae9d38d3 100644 --- a/libs/mako/testing/helpers.py +++ b/libs/mako/testing/helpers.py @@ -19,6 +19,10 @@ def result_lines(result): ] +def result_raw_lines(result): + return [x for x in re.split(r"\r?\n", result) if x.strip() != ""] + + def make_path( filespec: Union[Path, str], make_absolute: bool = True, diff --git a/libs/mako/util.py b/libs/mako/util.py index 5fb683b4f..91188cacf 100644 --- a/libs/mako/util.py +++ b/libs/mako/util.py @@ -1,5 +1,5 @@ # mako/util.py -# Copyright 2006-2022 the Mako authors and contributors <see AUTHORS file> +# Copyright 2006-2024 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php |