PHP 8.2.30
Preview: preprocessors.py Size: 576 B
/opt/hc_python/lib64/python3.12/site-packages/mako/ext/preprocessors.py

# ext/preprocessors.py
# Copyright 2006-2025 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

"""preprocessing functions, used with the 'preprocessor'
argument on Template, TemplateLookup"""

import re


def convert_comments(text):
    """preprocess old style comments.

    example:

    from mako.ext.preprocessors import convert_comments
    t = Template(..., preprocessor=convert_comments)"""
    return re.sub(r"(?<=\n)\s*#[^#]", "##", text)

Directory Contents

Dirs: 1 × Files: 9

Name Size Perms Modified Actions
- drwxr-xr-x 2025-04-04 08:02:05
Edit Download
1.84 KB lrw-r--r-- 2025-04-04 08:02:05
Edit Download
2.04 KB lrw-r--r-- 2025-04-04 08:02:05
Edit Download
2.52 KB lrw-r--r-- 2025-04-04 08:02:05
Edit Download
4.55 KB lrw-r--r-- 2025-04-04 08:02:05
Edit Download
1.89 KB lrw-r--r-- 2025-04-04 08:02:05
Edit Download
576 B lrw-r--r-- 2025-04-04 08:02:05
Edit Download
4.64 KB lrw-r--r-- 2025-04-04 08:02:05
Edit Download
2.09 KB lrw-r--r-- 2025-04-04 08:02:05
Edit Download
0 B lrw-r--r-- 2025-04-04 08:02:05
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).