'''
Created on Jan 6, 2013

__author__ = "Elizabeth 'pidge' Flanagan"
__copyright__ = "Copyright 2012-2013, Intel Corp."
__credits__ = ["Elizabeth Flanagan"]
__license__ = "GPL"
__version__ = "2.0"
__maintainer__ = "Elizabeth Flanagan"
__email__ = "elizabeth.flanagan@intel.com"
'''


from buildbot.steps.shell import ShellCommand
from buildbot.process.buildstep import LogLineObserver
import os

class BuildImages(ShellCommand):
    haltOnFailure = False
    flunkOnFailure = True
    name = "BuildImages"
    def __init__(self, factory, argdict=None, **kwargs):
        self.layerversion_yoctobsp=None
        self.machine=""
        self.images=""
        self._pendingLogObservers = []
        self.factory = factory
        for k, v in argdict.iteritems():
            setattr(self, k, v)
        # Timeout needs to be passed to LoggingBuildStep as a kwarg
        self.timeout = 100000
        kwargs['timeout']=self.timeout
        ShellCommand.__init__(self, **kwargs)

    def start(self):
        self.layerversion_yoctobsp = self.getProperty("layerversion_yoctobsp")
        self.machine = self.getProperty("MACHINE")
        if self.layerversion_yoctobsp is not None and int(self.layerversion_yoctobsp) < 2 and self.machine is not None and self.machine == "genericx86-64":
            self.command = "echo 'Skipping Step.'"
        else:
            self.command = ". ./oe-init-build-env; bitbake " + self.images
            self.description = "Building " + str(self.images)
        ShellCommand.start(self)

    def describe(self, done=False):
        description = ShellCommand.describe(self, done)
        if self.layerversion_yoctobsp is not None and int(self.layerversion_yoctobsp) < 2 and self.machine is not None and self.machine == "genericx86-64":
            description.append("genericx86-64 does not exist in this branch. Skipping")
        return description

'''
Created on Jan 6, 2013

__author__ = "Elizabeth 'pidge' Flanagan"
__copyright__ = "Copyright 2012-2013, Intel Corp."
__credits__ = ["Elizabeth Flanagan"]
__license__ = "GPL"
__version__ = "2.0"
__maintainer__ = "Elizabeth Flanagan"
__email__ = "elizabeth.flanagan@intel.com"
'''


from buildbot.steps.shell import ShellCommand
from buildbot.process.buildstep import LogLineObserver
import os

class BuildImages(ShellCommand):
    haltOnFailure = False
    flunkOnFailure = True
    name = "BuildImages"
    def __init__(self, factory, argdict=None, **kwargs):
        self.layerversion_yoctobsp=None
        self.machine=""
        self.images=""
        self._pendingLogObservers = []
        self.factory = factory
        for k, v in argdict.iteritems():
            setattr(self, k, v)
        # Timeout needs to be passed to LoggingBuildStep as a kwarg
        self.timeout = 100000
        kwargs['timeout']=self.timeout
        ShellCommand.__init__(self, **kwargs)

    def start(self):
        self.layerversion_yoctobsp = self.getProperty("layerversion_yoctobsp")
        self.machine = self.getProperty("MACHINE")
        if self.layerversion_yoctobsp is not None and int(self.layerversion_yoctobsp) < 2 and self.machine is not None and self.machine == "genericx86-64":
            self.command = "echo 'Skipping Step.'"
        else:
            self.command = ". ./oe-init-build-env; bitbake " + self.images
            self.description = ["Building " + str(self.images)]
        ShellCommand.start(self)

    def describe(self, done=False):
        description = ShellCommand.describe(self, done)
        if self.layerversion_yoctobsp is not None and int(self.layerversion_yoctobsp) < 2 and self.machine is not None and self.machine == "genericx86-64":
            description.append("genericx86-64 does not exist in this branch. Skipping")
        return description

fix mystery whitespace in build logs