Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • BackTrack 5 R2
  • Wine 1.4 / 1.5.5
  • Mozilla Firefox 12...
  • Ubuntu 11.04
  • Angry Birds 1.1.2.1
  • Ubuntu 10.04.4 LTS
  • Linux Kernel 3.4
  • Ubuntu Manual 10.10
  • Adobe Flash Player...
  • Pidgin 2.10.4
  • Home > Linux > Programming > Libraries

    missingbits 0.0.14

    Download button

    No screenshots available
    Downloads: 189  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    John Carr | More programs
    The Apache License 2.0 / FREE
    February 22nd, 2012, 11:01 GMT [view history]
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    missingbits description

    Buildout parts that make you smile

    missingbits is a module that provides several recipes you can use if you find your self duplicating lots of config. It also has echo, which turned out to be useful for testing.

    It was created for a site which uses 1, 3 or 9 zopes depending on a set of conditions.

    missingbits:range

    This recipe takes a string and will make a list out of it. For example, where as you could write:

    [buildout]
    parts = cluster

    [cluster]
    recipe = plone.recipe.cluster
    start =
     ${buildout:bin-directory}/zope0 start
     ${buildout:bin-directory}/zope1 start
     ${buildout:bin-directory}/zope2 start
     ${buildout:bin-directory}/zope3 start
     ${buildout:bin-directory}/zope4 start
     ${buildout:bin-directory}/zope5 start
    stop =
     ${buildout:bin-directory}/zope5 stop
     ${buildout:bin-directory}/zope4 stop
     ${buildout:bin-directory}/zope3 stop
     ${buildout:bin-directory}/zope2 stop
     ${buildout:bin-directory}/zope1 stop
     ${buildout:bin-directory}/zope0 stop


    You can write:

    [buildout]
    parts = cluster

    [zopes]
    recipe = missingbits:range
    stop = 6
    cluster-start = ${{buildout:bin-directory}}/zope{0} start
    cluster-stop = ${{buildout:bin-directory}}/zope{0} stop

    [cluster]
    recipe = plone.recipe.cluster
    start = ${zopes:cluster-start.forward}
    stop = ${zopes:cluster-stop.reverse}


    This is most useful when the number of zopes might vary for different builds of the same site.

    Parameters

    start
     Number to start the range at (Default: 0, Optional)
    stop
     Number to stop at, but not including. So start of 0 and stop of 6 will get you [0,1,2,3,4,5]. (Mandatory).
    step
     Number to increment by. (Default: +1, Optional)
    foo
     Foo is any variable you choose to set on the recipe. A number of duplicates will be made of it and a newline seperated list placed in an output variable. Any occurence of {0} will be replaced with a number for the item in the range we are up to. You can delay evaluation of any buildout variables you are using by escaping them ({{ and }}). If you don't do this, buildout will have to evaluate them before it evaluates this recipe and you might change the order the parts run in.
    foo.forward
     If you set a variable called foo on the recipe, it will make a foo.forward. This contains the list in ascending order.
    foo.reverse
     If you set a variable called foo on the recipe, it will make a foo.reverse. This contains the list in descending order.

    missingbits:clone

    I don't like copying and pasting things in buildout, i tend to make mistakes. So I clone instead.

    A site with 4 zopes might look something like this:

    [buildout]
    parts =
     zope0
     zope1
     zope2
     zope3

    [zope0]
    < = instance
    http-address = ${hosts:zope}:${ports:zope0}
    event-log = /var/log/zope/www.foo.bar.zope0.event.log
    z2-log = /var/log/zope/www.foo.bar.zope0.Z2.log

    [zope1]
    < = instance
    http-address = ${hosts:zope}:${ports:zope1}
    event-log = /var/log/zope/www.foo.bar.zope1.event.log
    z2-log = /var/log/zope/www.foo.bar.zope1.Z2.log

    [zope2]
    < = instance
    http-address = ${hosts:zope}:${ports:zope2}
    event-log = /var/log/zope/www.foo.bar.zope2.event.log
    z2-log = /var/log/zope/www.foo.bar.zope2.Z2.log

    [zope3]
    < = instance
    http-address = ${hosts:zope}:${ports:zope3}
    event-log = /var/log/zope/www.foo.bar.zope3.event.log
    z2-log = /var/log/zope/www.foo.bar.zope3.Z2.log

    When the number of zopes can change, we really need to make this more manageable. We could do this instead:

    [buildout]
    parts = zope-factory

    [zope{0}]
    < = instance
    http-address = ${{hosts:zope}}:${{ports:zope{0}}}
    event-log = /var/log/zope/www.foo.bar.zope{0}.event.log
    z2-log = /var/log/zope/www.foo.bar.zope{0}.Z2.log

    [zope-factory]
    recipe = missingbits:clone
    template = zope{0}
    count = 4

    Parameters

    template
     A part to use as a base for cloning. It should not be referenced in parts and it should not be reference by other parts, especially if it has a recipe. Any buildout variables it has will need to be escaped by using {{ and }}. Any occurences of {0} will be replaced by the number of the clone we are on.
    start
     Number to start the range at (Default: 0, Optional)
    stop
     Number to stop at, but not including. So start of 0 and stop of 6 will get you [0,1,2,3,4,5]. (Mandatory).
    step
     Number to increment by. (Default: +1, Optional)
    parts
     This variable is set by the recipe and contains a list of the parts that were generated. You can pass it to any recipe taking a list of parts, but you cannot pass it to ${buildout:parts} as the buildout part is evaluated too early.

    missingbits:echo

    While testing these recipes it was handy to have a no-op recipe that just printed some text. This is that recipe.

    You can print text from your buildout like so:

    [buildout]
    parts = echo

    [echo]
    recipe = missingbits:echo
    echo = Any text you want here


    Repository

    This software is available from our recipe repository on github.


    Product's homepage

    Requirements:

    · Python

    What's New in This Release: [ read full changelog ]

    · Improve 1.4.3 support.

      


    TAGS:

    buildout recipes | config duplicator | buildout | recipe | config



    HTML code for linking to this page:


    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM