18 | | == Download == |
19 | | |
20 | | Download the zipped source from [download:bittenrecipesextractorscript here]. |
21 | | |
22 | | == Source == |
23 | | |
24 | | You can check out BittenRecipesExtractorScript from [http://trac-hacks.org/svn/bittenrecipesextractorscript here] using Subversion, or [source:bittenrecipesextractorscript browse the source] with Trac. |
25 | | |
26 | | == Example == |
27 | | |
28 | | '''Retrieve recipes:'''[[BR]] |
29 | | |
30 | | mkdir ~/some/location[[BR]] |
31 | | cp recipe_get.py ~/some/location[[BR]] |
32 | | cp recipe_put.py ~/some/location[[BR]] |
33 | | cd ~/some/location[[BR]] |
34 | | sudo python recipe_get.py /var/www/Trac/My_Test_Trac[[BR]] |
35 | | |
36 | | '''Save recipes:'''[[BR]] |
37 | | |
38 | | sudo python recipe_put.py /var/www/Trac/My_Test_Trac[[BR]] |
39 | | |
| 18 | === Known Issues === |
| 19 | When I have been modifying the scripts using emacs (and possibly some other editors do this), the editor will create a backup swap file, which just so happens to match the file matching routine I have in place for recipes to be committed. I have not seen this cause issues, but it most certainly is not desirable. My advice is to edit a master copy, such as the ones in the subversion directory, and copy those two files, to your recipe directory and use them there.[[BR]] |
| 30 | == Download == |
| 31 | |
| 32 | Download the zipped source from [download:bittenrecipesextractorscript here]. |
| 33 | |
| 34 | == Source == |
| 35 | |
| 36 | You can check out BittenRecipesExtractorScript from [http://trac-hacks.org/svn/bittenrecipesextractorscript here] using Subversion, or [source:bittenrecipesextractorscript browse the source] with Trac. |
| 37 | |
| 38 | == Example == |
| 39 | I may combined these two scripts into one someday, but for now the usage follows:[[BR]] |
| 40 | |
| 41 | === Reading and Writing Recipes === |
| 42 | Create a directory for which the recipes will be saved at. Each Bitten Rule will be a separate <recipe_name>.recipe file. The two python scripts must be copied to this newly created directory.[[BR]] |
| 43 | Each python script uses the same single argument. The only argument that is needed, is the path to your Trac environment. Which exactly what is necessary when ever you run: |
| 44 | {{{ |
| 45 | trac-admin /some/trac/environment |
| 46 | }}} |
| 47 | To be absolutely clear on this, and to add additional text spam to this site: |
| 48 | {{{ |
| 49 | sudo python recipe_get.py /some/trac/environment |
| 50 | sudo python recipe_put.py /some/trac/environment |
| 51 | }}} |
| 52 | Whilst in the same directory as your saved recipes. 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. |
| 53 | |
| 54 | === Editing the Recipe Files === |
| 55 | The file syntax is fairly straight forward. The values are delimited by the two carrot characters.[[BR]] |
| 56 | From first value to last: |
| 57 | * The unique recipe name (NEVER CHANGE THIS) |
| 58 | * The path in your repository |
| 59 | * Is this recipe active or not? 1 being active, 0 being inactive |
| 60 | * The bitten recipe itself |
| 61 | * The recipe name as seen on the Trac Bitten Builds page |
| 62 | * The recipe description |
| 63 | 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. |