7 | | Two small scripts who's purpose is to retrieve a Trac's Bitten rule sets. Thus allowing you to make off-line changes quickly with your favorite text editor. |
8 | | Once satisfied with your changes, a second script uploads said changes. |
| 7 | These are two scripts that retrieve a Trac's [https://bitten.edgewall.org/ Bitten] rule sets. These scripts allow you to make off-line changes easily with your favorite text editor. Once the changes have been made, a second script uploads these changes to the server. |
| 8 | |
| 9 | === Reading and Writing Recipes |
| 10 | |
| 11 | Each Bitten rule will be a separate <recipe_name>.recipe file. |
| 12 | |
| 13 | Each Python script uses the same single argument, namely the path to your Trac environment: |
| 14 | {{{#!sh |
| 15 | $ trac-admin /some/trac/environment |
| 16 | }}} |
| 17 | |
| 18 | To be absolutely clear on this, and to add additional text spam to this site: |
| 19 | {{{#!sh |
| 20 | $ sudo python recipe_get.py /some/trac/environment |
| 21 | }}} |
| 22 | |
| 23 | and: |
| 24 | {{{#!sh |
| 25 | $ sudo python recipe_put.py /some/trac/environment |
| 26 | }}} |
| 27 | |
| 28 | Accordingly. |
| 29 | |
| 30 | When you perform a recipe_get.py, a directory will be created with a name equal to your Trac directory with '_recipes' appended to it (trac-directory-name_recipes). The recipes will be saved (or updated for recipes currently residing) in this directory. |
| 31 | You can leave these files there and continue to run both scripts for eternity. No need to clean them up. And quite frankly, leaving them alone for backup reasons, is recommended. |
| 32 | |
| 33 | === Editing the Recipe Files |
| 34 | |
| 35 | The file syntax is fairly straightforward. The values are delimited by two caret characters. If there is a quicker or better way to do this, please submit a ticket. |
| 36 | |
| 37 | From the first value to last: |
| 38 | * The unique recipe name (this should never be changed) |
| 39 | * The path in your repository |
| 40 | * Is this recipe active or not? 1 being active, 0 being inactive |
| 41 | * The Bitten recipe itself |
| 42 | * The minimum revision (if blank, then set to None) |
| 43 | * The maximum revision (if blank, then set to None) |
| 44 | * The recipe name as seen on the Trac Bitten Builds page |
| 45 | * The recipe description |
| 46 | |
| 47 | I have seen no harm in changing all but the first value. In fact, I have altered the other values with incorrect data, and was easily able to recover from it, by making my corrections, and running the recipe_put.py script again. |
44 | | |
45 | | == Example |
46 | | |
47 | | I may combine these two scripts into one someday, but for now the usage follows: |
48 | | |
49 | | === Reading and Writing Recipes |
50 | | |
51 | | Each Bitten Rule will be a separate <recipe_name>.recipe file.[[BR]] |
52 | | Each python script uses the same single argument. The only argument that is needed, is the path to your Trac environment. Which is exactly what is necessary when ever you run: |
53 | | {{{#!sh |
54 | | trac-admin /some/trac/environment |
55 | | }}} |
56 | | |
57 | | To be absolutely clear on this, and to add additional text spam to this site: |
58 | | {{{#!sh |
59 | | sudo python recipe_get.py /some/trac/environment |
60 | | }}} |
61 | | |
62 | | and: |
63 | | {{{#!sh |
64 | | sudo python recipe_put.py /some/trac/environment |
65 | | }}} |
66 | | |
67 | | Accordingly. |
68 | | |
69 | | When you perform a recipe_get.py, a directory will be created with a name equal to your Trac directory with '_recipes' appended to it (trac-directory-name_recipes). The recipes will be saved (or updated for recipes currently residing) in this directory. |
70 | | You can leave these files there and continue to run both scripts for eternity. No need to clean them up. And quite frankly, leaving them alone for backup reasons, is a darn good idea. |
71 | | |
72 | | === Editing the Recipe Files |
73 | | |
74 | | The file syntax is fairly straight forward. The values are delimited by two carrot characters. Please, if there is a quicker better way, do submit a ticket. |
75 | | |
76 | | From the first value to last: |
77 | | * The unique recipe name (NEVER CHANGE THIS) |
78 | | * The path in your repository |
79 | | * Is this recipe active or not? 1 being active, 0 being inactive |
80 | | * The bitten recipe itself |
81 | | * The minimum revision (if blank set to None) |
82 | | * The maximum revision (if blank set to None) |
83 | | * The recipe name as seen on the Trac Bitten Builds page |
84 | | * The recipe description |
85 | | I have seen no harm in changing all but the first value. In fact, I have altered the other values with incorrect data, and was easily able to recover from it, by making my corrections, and running the recipe_put.py script again. |