view autobot/projects/__init__.py @ 71:a1568668175c

make the autobot project possibly do something
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 11 Jan 2011 14:00:01 -0800
parents f8dccf3377d9
children a14d466c843b
line wrap: on
line source

"""
projects that need some testing:

* logparser      [WORKING]
* mozmill        [IN FLIGHT]
* devicemanager  [IN FLIGHT]
* profilemanager [IN FLIGHT]
* firebug        [TODO]
* jetpack thing  [TODO]
* autobot        [TODO]
"""

import imp
import os
from buildbot.process.factory import BuildFactory
from logparser import TestLogParserFactory
from mozmill import TestMozmillFactory

# available factories::
# import these automagically; requires non-zipped eggs
factories = {}
descriptions = {}
here = os.path.dirname(os.path.abspath(__file__))
packages = [os.path.join(here, path)
            for path in os.listdir(here)
            if os.path.isdir(os.path.join(here, path))]
packages = [os.path.basename(package) for package in packages
            if os.path.exists(os.path.join(package, '__init__.py'))]
for package in packages:
    try:
        module = imp.load_package('autobot.projects.'+package, imp.find_module(package, [here])[1])
    except:
        continue
    for attr in dir(module):
        try:
            _obj = getattr(module, attr)
            if issubclass(_obj, BuildFactory) and _obj.__module__.startswith('autobot.projects.'):
                factories[package] = _obj
                descriptions[package] = (getattr(_obj, '__doc__', attr) or attr).strip()
        except TypeError:
            continue