view buttercup/checkout.py @ 2:d5c80480b967

adding script to checkout source packages; should make this more unified in the future
author k0s <k0scist@gmail.com>
date Tue, 02 Mar 2010 15:13:57 -0500
parents
children e6e80bf0476f
line wrap: on
line source

#!/usr/bin/env python

"""
checks out the source as associated with the buttercup package
"""

import sys
import subprocess
from optparse import OptionParser

HG='http://k0s.org/hg'
PACKAGES=['bitsyauth',
          'bitsyblog',
          'buttercup',
          'clwapp',
          'commentator',
          'contenttransformer',
          'cropresize',
          'decoupage',
          'emaildispatcher',
          'genshi_view',
          'hgpaste',
          'lxmlmiddleware',
          'montage',
          'webob_view',
          'wordstream']

def main(args=sys.argv[1:]):
    parser = OptionParser()
    parser.add_option('--list', action="store_true", default=False,
                      help="list the source to be installed")
    options, args = parser.parse_args(args)

    sources = ['%s/%s' % (HG, package)
               for package in PACKAGES ]

    if options.list:
        for source in sources:
            print source
        sys.exit(0)

    for source in sources:
        subprocess.call(['hg', 'clone', source])

if __name__ == '__main__':
    main()