REDROOM
PHP 8.0.30
Path:
Logout
Edit File
Size: 2.41 KB
Close
//opt/alt/python37/lib/python3.7/site-packages/mako/cmd.py
Text
Base64
# mako/cmd.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 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("input", nargs="?", default="-") options = parser.parse_args(argv) output_encoding = options.output_encoding 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: sys.stdout.write(template.render(**kw)) except: _exit() if __name__ == "__main__": cmdline()
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 2 × Files: 17
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
ext
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
__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
ast.py
6.63 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
cache.py
7.55 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
cmd.py
2.41 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
codegen.py
46.77 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
compat.py
3.76 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
exceptions.py
12.85 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
filters.py
5.92 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
lexer.py
16.53 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
lookup.py
12.42 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
parsetree.py
18.96 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
pygen.py
9.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
pyparser.py
7.61 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
runtime.py
27.38 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
template.py
25.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
util.py
10.76 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
_ast_util.py
19.94 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
242 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).