root/galaxy-central/eggs/Mako-0.2.5-py2.6.egg/mako/ext/preprocessors.py @ 3

リビジョン 3, 0.7 KB (コミッタ: kohda, 14 年 前)

Install Unix tools  http://hannonlab.cshl.edu/galaxy_unix_tools/galaxy.html

行番号 
1"""preprocessing functions, used with the 'preprocessor' argument on Template, TemplateLookup"""
2
3import re
4
5def convert_comments(text):
6    """preprocess old style comments.
7   
8    example:
9   
10    from mako.ext.preprocessors import convert_comments
11    t = Template(..., preprocessor=preprocess_comments)"""
12    return re.sub(r'(?<=\n)\s*#[^#]', "##", text)
13
14# TODO
15def create_tag(callable):
16    """given a callable, extract the *args and **kwargs, and produce a preprocessor
17    that will parse for <%<funcname> <args>> and convert to an appropriate <%call> statement.
18   
19    this allows any custom tag to be created which looks like a pure Mako-style tag."""
20    raise NotImplementedError("Future functionality....")
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。