numpy.distutils.conv_template | index /usr/lib/python2.6/dist-packages/numpy/distutils/conv_template.py |
takes templated file .xxx.src and produces .xxx file where .xxx is
.i or .c or .h, using the following template rules
/**begin repeat -- on a line by itself marks the start of a repeated code
segment
/**end repeat**/ -- on a line by itself marks it's end
After the /**begin repeat and before the */, all the named templates are placed
these should all have the same number of replacements
Repeat blocks can be nested, with each nested block labeled with its depth,
i.e.
/**begin repeat1
*....
*/
/**end repeat1**/
In the main body each replace will use one entry from the list of named replacements
Note that all #..# forms in a block must have the same number of
comma-separated entries.
Example:
An input file containing
/**begin repeat
* #a = 1,2,3#
* #b = 1,2,3#
*/
/**begin repeat1
* #c = ted, jim#
*/
@a@, @b@, @c@
/**end repeat1**/
/**end repeat**/
produces
line 1 "template.c.src"
/*
*********************************************************************
** This file was autogenerated from a template DO NOT EDIT!!**
** Changes should be made to the original source (.src) file **
*********************************************************************
*/
#line 9
1, 1, ted
#line 9
1, 1, jim
#line 9
2, 2, ted
#line 9
2, 2, jim
#line 9
3, 3, ted
#line 9
3, 3, jim
Modules | ||||||
|
Functions | ||
|
Data | ||
__all__ = ['process_str', 'process_file'] __file__ = '/usr/lib/python2.6/dist-packages/numpy/distutils/conv_template.pyc' __name__ = 'numpy.distutils.conv_template' __package__ = 'numpy.distutils' global_names = {} header = '\n/*\n *******************************************...*******************************************\n */\n\n' include_src_re = <_sre.SRE_Pattern object at 0x6f335e0> named_re = <_sre.SRE_Pattern object at 0x6fc8120> parenrep = <_sre.SRE_Pattern object at 0x6e9f530> plainrep = <_sre.SRE_Pattern object at 0x6f09730> replace_re = <_sre.SRE_Pattern object at 0x6f76350> stripast = <_sre.SRE_Pattern object at 0x6e5bac0> |