REDROOM
PHP 8.0.30
Path:
Logout
Edit File
Size: 1.91 KB
Close
/opt/alt/python37/lib/python3.7/site-packages/mako/ext/linguaplugin.py
Text
Base64
# ext/linguaplugin.py # Copyright 2006-2019 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 io from lingua.extractors import Extractor from lingua.extractors import get_extractor from lingua.extractors import Message from mako import compat from mako.ext.extract import MessageExtractor class LinguaMakoExtractor(Extractor, MessageExtractor): """Mako templates""" extensions = [".mako"] default_config = {"encoding": "utf-8", "comment-tags": ""} def __call__(self, filename, options, fileobj=None): self.options = options self.filename = filename self.python_extractor = get_extractor("x.py") if fileobj is None: fileobj = open(filename, "rb") return self.process_file(fileobj) def process_python(self, code, code_lineno, translator_strings): source = code.getvalue().strip() if source.endswith(compat.b(":")): if source in ( compat.b("try:"), compat.b("else:"), ) or source.startswith(compat.b("except")): source = compat.b("") # Ignore try/except and else elif source.startswith(compat.b("elif")): source = source[2:] # Replace "elif" with "if" source += compat.b("pass") code = io.BytesIO(source) for msg in self.python_extractor( self.filename, self.options, code, code_lineno - 1 ): if translator_strings: msg = Message( msg.msgctxt, msg.msgid, msg.msgid_plural, msg.flags, compat.u(" ").join(translator_strings + [msg.comment]), msg.tcomment, msg.location, ) yield msg
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 9
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
__pycache__
DIR
-
drwxr-xr-x
2023-12-06 03:19:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
autohandler.py
1.84 KB
lrw-r--r--
2019-08-01 16:26:43
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
babelplugin.py
2.09 KB
lrw-r--r--
2019-08-01 16:26:43
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
beaker_cache.py
2.54 KB
lrw-r--r--
2019-08-01 16:26:43
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
extract.py
4.51 KB
lrw-r--r--
2019-08-01 16:26:43
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
linguaplugin.py
1.91 KB
lrw-r--r--
2019-08-01 16:26:43
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
preprocessors.py
576 B
lrw-r--r--
2019-08-01 16:26:43
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
pygmentplugin.py
4.83 KB
lrw-r--r--
2019-08-01 16:26:43
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
turbogears.py
2.11 KB
lrw-r--r--
2019-08-01 16:26:43
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__init__.py
0 B
lrw-r--r--
2019-08-01 16:26:43
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).