<commit_before>'''
Created on Dec 17, 2012

__author__ = "Elizabeth 'pidge' Flanagan"
__copyright__ = "Copyright 2013, Intel Corp."
__credits__ = ["<NAME>"]
__license__ = "GPL"
__version__ = "2.0"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
'''

#!/usr/bin/python

from config import *
from twisted.python import log
from buildsteps import *
import ast
from buildsteps import YoctoBlocker
from buildsteps import NoOp
from buildbot.process import factory as factory
from buildbot.steps.shell import ShellCommand
from buildbot.process.properties import Property, PropertiesMixin, renderer
from buildbot.steps.trigger import Trigger

class BuildSet():
    '''
    classdocs
    '''
    def __init__(self, name, layers, steps, builders, set_props={}):
        '''
        Constructor
        '''
        locals()['f'+name] = factory.BuildFactory()
        for stepOrder in steps:
            for step in dict(stepOrder):
                factoryFN=getattr(locals()['f'+name], 'addStep')
                if step=="PublishLayerTarballs":
                    for layer in layers:
                        kwargs=stepOrder[step]
                        layername=layer.iterkeys().next()
                        if 'checkout' in layer[layer.iterkeys().next()]:
                            if layer[layer.iterkeys().next()]['checkout'] == False: 
                                pass
                            else:
                                if layername == "poky" or layername == 'oecore':
                                    workdir = 'build'
                                elif layername == "eclipse-poky":
                                    workdir=os.path.join("build", layername)
                                else:
                                    workdir=os.path.join("build", layername)
                                m = __import__ (step)
                                func = getattr(m, step)
                                factoryFN(func(locals()['f'+name],
                                          layername=layername,
                                          workdir=workdir,
                                          argdict=layer[layer.iterkeys().next()]))
                elif step=="CheckOutLayers":
                # All steps need the factory passed as the first param
                    for layer in layers:
                        kwargs=stepOrder[step]
                        layername=layer.iterkeys().next()
                        if 'checkout' in layer[layer.iterkeys().next()]:
                            if layer[layer.iterkeys().next()]['checkout'] == False: <commit_msg>BuildSet.py: Layer tarball logic hole<commit_after>'''
Created on Dec 17, 2012

__author__ = "Elizabeth 'pidge' Flanagan"
__copyright__ = "Copyright 2013, Intel Corp."
__credits__ = ["<NAME>"]
__license__ = "GPL"
__version__ = "2.0"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
'''

#!/usr/bin/python

from config import *
from twisted.python import log
from buildsteps import *
import ast
from buildsteps import YoctoBlocker
from buildsteps import NoOp
from buildbot.process import factory as factory
from buildbot.steps.shell import ShellCommand
from buildbot.process.properties import Property, PropertiesMixin, renderer
from buildbot.steps.trigger import Trigger

class BuildSet():
    '''
    classdocs
    '''
    def __init__(self, name, layers, steps, builders, set_props={}):
        '''
        Constructor
        '''
        locals()['f'+name] = factory.BuildFactory()
        for stepOrder in steps:
            for step in dict(stepOrder):
                factoryFN=getattr(locals()['f'+name], 'addStep')
                if step=="PublishLayerTarballs":
                    for layer in layers:
                        kwargs=stepOrder[step]
                        layername=layer.iterkeys().next()
                        log.msg(layer[layer.iterkeys().next()])
                        if layer[layer.iterkeys().next()].has_key('checkout') and layer[layer.iterkeys().next()]['checkout'] == False: 
                            pass
                        else:
                            if layername == "poky" or layername == 'oecore':
                                workdir = 'build'
                            elif layername == "eclipse-poky":
                                workdir=os.path.join("build", layername)
                            else:
                                workdir=os.path.join("build", layername)
                            m = __import__ (step)
                            func = getattr(m, step)
                            factoryFN(func(locals()['f'+name],
                                      layername=layername,
                                      workdir=workdir,
                                      argdict=layer[layer.iterkeys().next()]))
                elif step=="CheckOutLayers":
                # All steps need the factory passed as the first param
                    for layer in layers:
                        kwargs=stepOrder[step]
                        layername=layer.iterkeys().next()
                        if 'checkout' in layer[layer.iterkeys().next()]:
                            if layer[layer.iterkeys().next()]['checkout'] == False: 
{'fraction_non_alphanumeric': 0.1051125524608928, 'fraction_numerical': 0.004578405188859214, 'mean_word_length': 1.4931050879695673, 'pattern_counts': {'":': 6, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3013009', 'n_tokens_mistral': 1350, 'n_tokens_neox': 1264, 'n_words': 317}