$14 GRAYBYTE WORDPRESS FILE MANAGER $95

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/cloudlinux/venv/lib/python3.11/site-packages/mako/

HOME
Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/mako//cmd.py
# mako/cmd.py
# Copyright 2006-2022 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
from argparse import ArgumentParser
from os.path import dirname
from os.path import isfile
import sys

from mako import exceptions
from mako.lookup import TemplateLookup
from mako.template import Template


def varsplit(var):
    if "=" not in var:
        return (var, "")
    return var.split("=", 1)


def _exit():
    sys.stderr.write(exceptions.text_error_template().render())
    sys.exit(1)


def cmdline(argv=None):

    parser = ArgumentParser()
    parser.add_argument(
        "--var",
        default=[],
        action="append",
        help="variable (can be used multiple times, use name=value)",
    )
    parser.add_argument(
        "--template-dir",
        default=[],
        action="append",
        help="Directory to use for template lookup (multiple "
        "directories may be provided). If not given then if the "
        "template is read from stdin, the value defaults to be "
        "the current directory, otherwise it defaults to be the "
        "parent directory of the file provided.",
    )
    parser.add_argument(
        "--output-encoding", default=None, help="force output encoding"
    )
    parser.add_argument(
        "--output-file",
        default=None,
        help="Write to file upon successful render instead of stdout",
    )
    parser.add_argument("input", nargs="?", default="-")

    options = parser.parse_args(argv)

    output_encoding = options.output_encoding
    output_file = options.output_file

    if options.input == "-":
        lookup_dirs = options.template_dir or ["."]
        lookup = TemplateLookup(lookup_dirs)
        try:
            template = Template(
                sys.stdin.read(),
                lookup=lookup,
                output_encoding=output_encoding,
            )
        except:
            _exit()
    else:
        filename = options.input
        if not isfile(filename):
            raise SystemExit("error: can't find %s" % filename)
        lookup_dirs = options.template_dir or [dirname(filename)]
        lookup = TemplateLookup(lookup_dirs)
        try:
            template = Template(
                filename=filename,
                lookup=lookup,
                output_encoding=output_encoding,
            )
        except:
            _exit()

    kw = dict(varsplit(var) for var in options.var)
    try:
        rendered = template.render(**kw)
    except:
        _exit()
    else:
        if output_file:
            open(output_file, "wt", encoding=output_encoding).write(rendered)
        else:
            sys.stdout.write(rendered)


if __name__ == "__main__":
    cmdline()

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
17 Dec 2025 3.08 AM
root / root
0755
__pycache__
--
14 Aug 2025 9.24 PM
root / root
0755
ext
--
14 Aug 2025 9.24 PM
root / root
0755
testing
--
14 Aug 2025 9.24 PM
root / root
0755
__init__.py
0.236 KB
17 Apr 2025 8.10 PM
root / root
0644
_ast_util.py
19.772 KB
17 Apr 2025 8.10 PM
root / root
0644
ast.py
6.486 KB
17 Apr 2025 8.10 PM
root / root
0644
cache.py
7.5 KB
17 Apr 2025 8.10 PM
root / root
0644
cmd.py
2.748 KB
17 Apr 2025 8.10 PM
root / root
0644
codegen.py
46.2 KB
17 Apr 2025 8.10 PM
root / root
0644
compat.py
1.868 KB
17 Apr 2025 8.10 PM
root / root
0644
exceptions.py
12.236 KB
17 Apr 2025 8.10 PM
root / root
0644
filters.py
4.549 KB
17 Apr 2025 8.10 PM
root / root
0644
lexer.py
15.607 KB
17 Apr 2025 8.10 PM
root / root
0644
lookup.py
12.138 KB
17 Apr 2025 8.10 PM
root / root
0644
parsetree.py
18.562 KB
17 Apr 2025 8.10 PM
root / root
0644
pygen.py
10.172 KB
17 Apr 2025 8.10 PM
root / root
0644
pyparser.py
6.867 KB
17 Apr 2025 8.10 PM
root / root
0644
runtime.py
27.154 KB
17 Apr 2025 8.10 PM
root / root
0644
template.py
23.299 KB
17 Apr 2025 8.10 PM
root / root
0644
util.py
10.389 KB
17 Apr 2025 8.10 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF