Changeset 506 in tailor
- Timestamp:
- 08/05/05 12:39:18 (8 years ago)
- Hash name:
- 20050805103918-97f81-2efd1936ea1410722dc75df4d4d3810eb23487b6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
README
r488 r506 264 264 template config filled with the values specified by the 265 265 other options. You can redirect 266 267 268 Using a Python script as configuration file 269 ------------------------------------------- 270 271 Instead of executing ``tailor --configfile project.tailor.conf`` 272 you can prepend the following signature to the config itself:: 273 274 #!/usr/bin/env /path/to/tailor 275 276 Giving execute mode to it will permit the launch of the tailor 277 process by running the config script directly:: 278 279 $ ./project.tailor.conf 280 281 When a config file is signed in this way [#]_, either you pass it as 282 argument to ``--configfile`` or executed as above, tailor will 283 actually execute it as a full fledged Python script, that may define 284 functions that alter the behaviour of tailor itself. 285 286 A common usage of this functionality is to define so called `hooks`, 287 sequences of functions that are executed at particular points in 288 the tailorization process. 289 290 For example:: 291 292 #!/usr/bin/env /home/lele/WiP/tailor/tailor 293 """ 294 [project] 295 source = svn:repository 296 target = darcs:repository 297 before-commit = transform_crlf_to_lf 298 ... 299 """ 300 301 def transform_crlf_to_lf(context, changeset): 302 for e in changeset.entries: 303 .... 304 305 .. [#] Tailor does actually read just the first two bytes from the 306 file, and compare them with "#!", so you are free to choose 307 whatever syntax works in your environment. 308 266 309 267 310 State file
Note: See TracChangeset
for help on using the changeset viewer.
