tools.py
¶
Some utility functions.
Renderer
¶
The Jinja template renderer.
create_path_filter(patterns)
¶
Returns a function that matches a path against given patterns.
Source code in copier/tools.py
175 176 177 178 179 180 181 182 183 |
|
get_jinja_env(envops, filters=None, paths=None, **kwargs)
¶
Return a pre-configured Jinja environment.
Source code in copier/tools.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
|
get_migration_tasks(conf, stage)
¶
Get migration objects that match current version spec.
Versions are compared using PEP 440.
Source code in copier/tools.py
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 |
|
normalize_str(text, form='NFD')
¶
Normalize unicode text. Uses the NFD algorithm by default.
Source code in copier/tools.py
170 171 172 |
|
to_nice_yaml(data, **kwargs)
¶
Dump a string to pretty YAML.
Source code in copier/tools.py
101 102 103 104 105 106 107 108 109 |
|