$65 GRAYBYTE WORDPRESS FILE MANAGER $31

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/python37/lib/python3.7/site-packages/mako/ext/

HOME
Current File : /opt/alt/python37/lib/python3.7/site-packages/mako/ext//linguaplugin.py
# 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

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
31 Aug 2024 6.48 AM
root / 996
0755
__pycache__
--
31 Aug 2024 6.48 AM
root / 996
0755
__init__.py
0 KB
1 Aug 2019 11.26 PM
root / 996
0644
autohandler.py
1.841 KB
1 Aug 2019 11.26 PM
root / 996
0644
babelplugin.py
2.088 KB
1 Aug 2019 11.26 PM
root / 996
0644
beaker_cache.py
2.538 KB
1 Aug 2019 11.26 PM
root / 996
0644
extract.py
4.508 KB
1 Aug 2019 11.26 PM
root / 996
0644
linguaplugin.py
1.908 KB
1 Aug 2019 11.26 PM
root / 996
0644
preprocessors.py
0.563 KB
1 Aug 2019 11.26 PM
root / 996
0644
pygmentplugin.py
4.835 KB
1 Aug 2019 11.26 PM
root / 996
0644
turbogears.py
2.114 KB
1 Aug 2019 11.26 PM
root / 996
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF