changeset 51:de3d2320df90

add a python source factory and utilize it
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 10 Jan 2011 12:30:00 -0800
parents a39959f8c0a5
children 1bd23c43a133
files autobot/process/factory.py autobot/projects/logparser/__init__.py
diffstat 2 files changed, 13 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/autobot/process/factory.py	Mon Jan 10 12:24:00 2011 -0800
+++ b/autobot/process/factory.py	Mon Jan 10 12:30:00 2011 -0800
@@ -67,14 +67,21 @@
     # setup the environment
     VirtualenvFactory.__init__(self, name=name, hg_sources=hg_sources, git_sources=git_sources)
 
-    # install the packages 
+    # install the packages
+    sources = []
     for hg_source in hg_sources:
       package = hg_source.rstrip('/').rsplit('/', 1)[-1]
+      sources.append(package)
+    for git_source in git_sources:
+      package = hg_source.rstrip('/').rsplit('/', 1)[-1]
+      if package.endswith('.git'):
+        package = package[:-4]
+      sources.append(package)
+    for package in sources:
       self.addStep(ShellCommand(command=[WithProperties('%(python)s'), 'setup.py', 'install'],
                                 workdir=WithProperties('%(virtualenv)s/src/' + package),
                                 haltOnFailure=True))
-    for git_source in git_sources:
-      pass # [TODO]
+        
 
 # python sources:
 # [{'source': 'http://hg.mozilla.org/....',
--- a/autobot/projects/logparser/__init__.py	Mon Jan 10 12:24:00 2011 -0800
+++ b/autobot/projects/logparser/__init__.py	Mon Jan 10 12:30:00 2011 -0800
@@ -1,4 +1,4 @@
-from autobot.process.factory import VirtualenvFactory
+from autobot.process.factory import PythonSourceFactory
 from buildbot.steps.shell import ShellCommand
 from buildbot.steps.shell import WithProperties
 
@@ -10,8 +10,8 @@
   def __init__(self):
 
     # setup the environment
-    VirtualenvFactory.__init__(self, name='logparser',
-                               hg_sources=['http://hg.mozilla.org/automation/logparser/'])
+    PythonSourceFactory.__init__(self, name='logparser',
+                                 hg_sources=['http://hg.mozilla.org/automation/logparser/'])
 
     # install the python
     # TODO: utilize PythonSourceFactory