Changes between Version 15 and Version 16 of BittenRecipesExtractorScript


Ignore:
Timestamp:
May 21, 2022, 5:08:33 PM (2 years ago)
Author:
figaro
Comment:

Move examples to functional description

Legend:

Unmodified
Added
Removed
Modified
  • BittenRecipesExtractorScript

    v15 v16  
    55== Description
    66
    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.
     7These 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
     11Each Bitten rule will be a separate <recipe_name>.recipe file.
     12
     13Each Python script uses the same single argument, namely the path to your Trac environment:
     14{{{#!sh
     15$ trac-admin /some/trac/environment
     16}}}
     17
     18To 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
     23and:
     24{{{#!sh
     25$ sudo python recipe_put.py /some/trac/environment
     26}}}
     27
     28Accordingly.
     29
     30When 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.
     31You 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
     35The 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
     37From 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
     47I 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.
    948
    1049== Bugs/Feature Requests
     
    2059=== Known Issues
    2160
    22 Pattern matching may include swap and backup specific files from editing your recipes. The only issue this would cause, may be a file with no changes from the original, or other non-desirable changes. Keep this in mind if your finding recipes not updating with correct data. Search for hidden files in your recipe directory, and delete them. I have attempted to solve this, but unfortunately I have found that Trac allows periods and dashes in the naming convention of bitten rules. So this rules out a lot of simple pattern matching I can perform. eg {{{if str.isalnum(file_name)}}}
     61Pattern matching may include swap and backup specific files from editing your recipes. The only issue this would cause, may be a file with no changes from the original, or other non-desirable changes. Keep this in mind if you are finding recipes not updating with the correct data. Search for hidden files in your recipe directory and delete them. I have attempted to solve this, but unfortunately I have found that Trac allows periods and dashes in the naming convention of Bitten rules. So this rules out a lot of simple pattern matching that can be performed, eg {{{if str.isalnum(file_name)}}}.
    2362
    2463Super User access is needed when reading and writing to the Trac database directly.
    25 Also, on some of my clusters that I work with, multiple version of python can exist. Meaning, if you receive errors like:
     64Also, on some of my clusters that I work with, multiple version of Python can exist. Hence, if you receive errors like:
    2665{{{#!sh
    2766ImportError: No module named trac.env
    2867}}}
    2968
    30 You need to adjust your PATH environment to include the path to which ever python version was used to install and run Trac:
     69You need to adjust your PATH environment to include the path to the Python version that was used to install and run Trac:
    3170{{{#!sh
    32 export PATH=/usr/local/python2.7/bin:$PATH
     71$ export PATH=/usr/local/python2.7/bin:$PATH
    3372}}}
    3473
    35 '''Note''': This is the reason I do not include the common #!/usr/bin/python interrupter header in my scripts.
     74'''Note''': This is the reason I do not include the common `#!/usr/bin/python` interrupter header in my scripts.
    3675
    3776== Download
     
    4281
    4382You can check out BittenRecipesExtractorScript from [/svn/bittenrecipesextractorscript here] using Subversion, or [source:bittenrecipesextractorscript browse the source] with Trac.
    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.
    8683
    8784== Recent Changes