# HG changeset patch # User Jeff Hammel # Date 1306852747 25200 # Node ID f6b768417d27db6df9f0fc4a1a0841262beb5680 # Parent 6089d6ec745a27c5570b6132f4ab917d50ac0726 now listing kinda works diff -r 6089d6ec745a -r f6b768417d27 buttercup/buttercup.py --- a/buttercup/buttercup.py Tue May 31 07:29:15 2011 -0700 +++ b/buttercup/buttercup.py Tue May 31 07:39:07 2011 -0700 @@ -34,9 +34,9 @@ def __init__(self, srcdir): self.srcdir = srcdir - sources = {'hg': ['%s/%s' % (self.HG, package) + self.sources = {'hg': ['%s/%s' % (self.HG, package) for package in self.PACKAGES ]} - sources['git'] = ['git://github.com/mozilla/toolbox.git'] + self.sources['git'] = ['git://github.com/mozilla/toolbox.git'] def install(self): """install all software needed for this flower""" diff -r 6089d6ec745a -r f6b768417d27 buttercup/checkout.py --- a/buttercup/checkout.py Tue May 31 07:29:15 2011 -0700 +++ b/buttercup/checkout.py Tue May 31 07:39:07 2011 -0700 @@ -10,6 +10,7 @@ # pip install -r foo.txt import os +import source import sys import subprocess from buttercup import Buttercup @@ -56,8 +57,10 @@ # list sources if specified if options.list: - for source in sources: - print '%s: %s' % (source[0], source[1]) + buttercup = Buttercup(srcdir=None) + sources = source.sources(buttercup.sources) + for s in sources: + print '%s: %s' % (s.directory_name(s.uri), s.uri) sys.exit(0) # setup the src directory in a virtualenv @@ -68,22 +71,22 @@ os.chdir(src) # clone the sources - for source in sources: - if os.path.exists(source[0]): + for s in sources: + if os.path.exists(s[0]): if options.update: - os.chdir(source[0]) + os.chdir(s[0]) subprocess.call(['hg', 'pull']) subprocess.call(['hg', 'update']) os.chdir('..') else: - print "%s already exists" % source[0] + print "%s already exists" % s[0] else: - subprocess.call(['hg', 'clone', source[1]]) + subprocess.call(['hg', 'clone', s[1]]) # install the sources if options.install: - for source in sources: - os.chdir(source[0]) + for s in sources: + os.chdir(s[0]) subprocess.call(['python', 'setup.py', 'develop']) os.chdir('..') diff -r 6089d6ec745a -r f6b768417d27 setup.py --- a/setup.py Tue May 31 07:29:15 2011 -0700 +++ b/setup.py Tue May 31 07:39:07 2011 -0700 @@ -5,7 +5,7 @@ except: description = '' -version='0.0' +version='0.1' setup(name='buttercup', version=version, @@ -13,7 +13,7 @@ long_description=description, author='Jeff Hammel', author_email='k0scist@gmail.com', - url='http://k0s.org', + url='http://k0s.org/', keywords='', license="GPL", packages=find_packages(exclude=['ez_setup', 'examples', 'tests*']),