当前位置: 首页>>代码示例>>Python>>正文


Python RunningBuild.handle_event方法代码示例

本文整理汇总了Python中bb.ui.crumbs.runningbuild.RunningBuild.handle_event方法的典型用法代码示例。如果您正苦于以下问题:Python RunningBuild.handle_event方法的具体用法?Python RunningBuild.handle_event怎么用?Python RunningBuild.handle_event使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在bb.ui.crumbs.runningbuild.RunningBuild的用法示例。


在下文中一共展示了RunningBuild.handle_event方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: HobHandler

# 需要导入模块: from bb.ui.crumbs.runningbuild import RunningBuild [as 别名]
# 或者: from bb.ui.crumbs.runningbuild.RunningBuild import handle_event [as 别名]

#.........这里部分代码省略.........
        elif next_command == self.CFG_FILES_DISTRO:
            self.server.runCommand(["findConfigFiles", "DISTRO"])
        elif next_command == self.CFG_FILES_MACH:
            self.server.runCommand(["findConfigFiles", "MACHINE"])
        elif next_command == self.CFG_FILES_SDKMACH:
            self.server.runCommand(["findConfigFiles", "MACHINE-SDK"])
        elif next_command == self.FILES_MATCH_CLASS:
            self.server.runCommand(["findFilesMatchingInDir", "rootfs_", "classes"])
        elif next_command == self.PARSE_CONFIG:
            self.server.runCommand(["parseConfigurationFiles", "", ""])
        elif next_command == self.PARSE_BBFILES:
            self.server.runCommand(["parseFiles"])
        elif next_command == self.GENERATE_TGTS:
            self.server.runCommand(["generateTargetsTree", "classes/image.bbclass", []])
        elif next_command == self.GENERATE_PACKAGEINFO:
            self.server.runCommand(["triggerEvent", "bb.event.RequestPackageInfo()"])
        elif next_command == self.BUILD_TARGET_RECIPES:
            self.clear_busy()
            self.building = True
            self.server.runCommand(["buildTargets", self.recipe_queue, "build"])
            self.recipe_queue = []
        elif next_command == self.BUILD_TARGET_IMAGE:
            self.clear_busy()
            self.building = True
            targets = ["hob-image"]
            self.server.runCommand(["setVariable", "LINGUAS_INSTALL", ""])
            self.server.runCommand(["setVariable", "PACKAGE_INSTALL", " ".join(self.package_queue)])
            if self.toolchain_build:
                pkgs = self.package_queue + [i+'-dev' for i in self.package_queue] + [i+'-dbg' for i in self.package_queue]
                self.server.runCommand(["setVariable", "TOOLCHAIN_TARGET_TASK", " ".join(pkgs)])
                targets.append("hob-toolchain")
            self.server.runCommand(["buildTargets", targets, "build"])

    def handle_event(self, event):
        if not event:
            return

        if self.building:
            self.current_phase = "building"
            self.build.handle_event(event)

        if isinstance(event, bb.event.PackageInfo):
            self.package_model.populate(event._pkginfolist)
            self.run_next_command()

        elif(isinstance(event, logging.LogRecord)):
            if event.levelno >= logging.ERROR:
                self.error_msg += event.msg + '\n'

        elif isinstance(event, bb.event.TargetsTreeGenerated):
            self.current_phase = "data generation"
            if event._model:
                self.recipe_model.populate(event._model)
        elif isinstance(event, bb.event.CoreBaseFilesFound):
            self.current_phase = "configuration lookup"
            paths = event._paths
            self.emit('layers-updated', paths)
        elif isinstance(event, bb.event.ConfigFilesFound):
            self.current_phase = "configuration lookup"
            var = event._variable
            values = event._values
            values.sort()
            self.emit("config-updated", var, values)
        elif isinstance(event, bb.event.ConfigFilePathFound):
            self.current_phase = "configuration lookup"
        elif isinstance(event, bb.event.FilesMatchingFound):
开发者ID:izzetaykutkocak,项目名称:poky-e100,代码行数:70,代码来源:hobeventhandler.py

示例2: HobHandler

# 需要导入模块: from bb.ui.crumbs.runningbuild import RunningBuild [as 别名]
# 或者: from bb.ui.crumbs.runningbuild.RunningBuild import handle_event [as 别名]

#.........这里部分代码省略.........
            self.runCommand(["triggerEvent", "bb.event.NetworkTest()"])
        elif next_command == self.SUB_BUILD_RECIPES:
            self.clear_busy()
            self.building = True
            self.runCommand(["buildTargets", self.recipe_queue, self.default_task])
            self.recipe_queue = []
        elif next_command == self.SUB_BUILD_IMAGE:
            self.clear_busy()
            self.building = True
            targets = [self.image]
            if self.package_queue:
                self.runCommand(["setVariable", "LINGUAS_INSTALL", ""])
                self.runCommand(["setVariable", "PACKAGE_INSTALL", " ".join(self.package_queue)])
            if self.toolchain_packages:
                self.runCommand(["setVariable", "TOOLCHAIN_TARGET_TASK", " ".join(self.toolchain_packages)])
                targets.append(self.toolchain)
            if targets[0] == "hob-image":
                hobImage = self.runCommand(["matchFile", "hob-image.bb"])
                if self.base_image != "Create your own image":
                    baseImage = self.runCommand(["matchFile", self.base_image + ".bb"])
                    version = self.runCommand(["generateNewImage", hobImage, baseImage, self.package_queue])
                    targets[0] += version
                    self.recipe_model.set_custom_image_version(version)

            self.runCommand(["buildTargets", targets, self.default_task])

    def display_error(self):
        self.clear_busy()
        self.emit("command-failed", self.error_msg)
        self.error_msg = ""
        if self.building:
            self.building = False

    def handle_event(self, event):
        if not event:
            return
        if self.building:
            self.current_phase = "building"
            self.build.handle_event(event)

        if isinstance(event, bb.event.PackageInfo):
            self.package_model.populate(event._pkginfolist)
            self.emit("package-populated")
            self.run_next_command()

        elif isinstance(event, bb.event.SanityCheckPassed):
            self.run_next_command()

        elif isinstance(event, bb.event.SanityCheckFailed):
            self.emit("sanity-failed", event._msg, event._network_error)

        elif isinstance(event, logging.LogRecord):
            if not self.building:
                if event.levelno >= logging.ERROR:
                    formatter = bb.msg.BBLogFormatter()
                    msg = formatter.format(event)
                    self.error_msg += msg + '\n'

        elif isinstance(event, bb.event.TargetsTreeGenerated):
            self.current_phase = "data generation"
            if event._model:
                self.recipe_model.populate(event._model)
                self.emit("recipe-populated")
        elif isinstance(event, bb.event.ConfigFilesFound):
            self.current_phase = "configuration lookup"
            var = event._variable
开发者ID:MentorEmbedded,项目名称:bitbake,代码行数:70,代码来源:hobeventhandler.py

示例3: HobHandler

# 需要导入模块: from bb.ui.crumbs.runningbuild import RunningBuild [as 别名]
# 或者: from bb.ui.crumbs.runningbuild.RunningBuild import handle_event [as 别名]

#.........这里部分代码省略.........
            self.clear_busy()
            self.building = True
            self.runCommand(["buildTargets", self.recipe_queue, self.default_task])
            self.recipe_queue = []
        elif next_command == self.SUB_BUILD_IMAGE:
            self.clear_busy()
            self.building = True
            target = self.image
            if target == "hob-image":
                hobImage = self.runCommand(["matchFile", "hob-image.bb"])
                if self.base_image != "Start with an empty image recipe":
                    baseImage = self.runCommand(["matchFile", self.base_image + ".bb"])
                    version = self.runCommand(["generateNewImage", hobImage, baseImage, self.package_queue, True, ""])
                    target += version
                    self.recipe_model.set_custom_image_version(version)

            targets = [target + ":do_rootfs"]
            targets.append("virtual/kernel:do_deploy")
            targets.append("virtual/kernel:do_populate_sysroot")
            targets.append("grub:do_deploy")
            targets.append("grub-conf:do_deploy")

            if self.toolchain:
                targets.append(target + ":do_populate_sdk")
            self.runCommand(["buildTargets", targets, self.default_task])

    def display_error(self):
        self.clear_busy()
        self.emit("command-failed", self.error_msg)
        self.error_msg = ""
        if self.building:
            self.building = False

    def handle_event(self, event):
        if not event:
            return
        if self.building:
            self.current_phase = "building"
            self.build.handle_event(event)

        if isinstance(event, bb.event.PackageInfo):
            self.package_model.populate(event._pkginfolist)
            self.emit("package-populated")
            self.run_next_command()

        elif isinstance(event, bb.event.SanityCheckPassed):
            reparse = self.runCommand(["getVariable", "BB_INVALIDCONF"]) or None
            if reparse is True:
                self.set_var_in_file("BB_INVALIDCONF", False, "local.conf")
                self.runCommand(["parseConfigurationFiles", "", ""])
            self.run_next_command()

        elif isinstance(event, bb.event.SanityCheckFailed):
            self.emit("sanity-failed", event._msg)

        elif isinstance(event, logging.LogRecord):
            if not self.building:
                if event.levelno >= logging.ERROR:
                    formatter = bb.msg.BBLogFormatter()
                    msg = formatter.format(event)
                    self.error_msg += msg + '\n'
                elif event.levelno >= logging.WARNING and self.parsing == True:
                    formatter = bb.msg.BBLogFormatter()
                    msg = formatter.format(event)
                    warn_msg = msg + '\n'
                    self.emit("parsing-warning", warn_msg)
开发者ID:alex1818,项目名称:yocto-iot,代码行数:70,代码来源:hobeventhandler.py


注:本文中的bb.ui.crumbs.runningbuild.RunningBuild.handle_event方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。