changeset 31:f6b768417d27

now listing kinda works
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 31 May 2011 07:39:07 -0700
parents 6089d6ec745a
children 86c3c0d4d434
files buttercup/buttercup.py buttercup/checkout.py setup.py
diffstat 3 files changed, 16 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- 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"""
--- 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('..')
 
--- 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*']),