本文整理汇总了Python中bb.ui.crumbs.runningbuild.RunningBuild.reset方法的典型用法代码示例。如果您正苦于以下问题:Python RunningBuild.reset方法的具体用法?Python RunningBuild.reset怎么用?Python RunningBuild.reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bb.ui.crumbs.runningbuild.RunningBuild
的用法示例。
在下文中一共展示了RunningBuild.reset方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: HobHandler
# 需要导入模块: from bb.ui.crumbs.runningbuild import RunningBuild [as 别名]
# 或者: from bb.ui.crumbs.runningbuild.RunningBuild import reset [as 别名]
#.........这里部分代码省略.........
self.run_next_command(self.GENERATE_PACKAGES)
def generate_image(self, image, base_image, toolchain, image_packages=[], toolchain_packages=[], default_task="build"):
self.image = image
self.base_image = base_image
self.toolchain = toolchain
self.package_queue = image_packages
self.toolchain_packages = toolchain_packages
self.default_task = default_task
self.commands_async.append(self.SUB_PARSE_CONFIG)
self.commands_async.append(self.SUB_BUILD_IMAGE)
self.run_next_command(self.GENERATE_IMAGE)
def build_succeeded_async(self):
self.building = False
def build_failed_async(self):
self.initcmd = None
self.commands_async = []
self.building = False
def cancel_parse(self):
self.runCommand(["stateStop"])
def cancel_build(self, force=False):
if force:
# Force the cooker to stop as quickly as possible
self.runCommand(["stateStop"])
else:
# Wait for tasks to complete before shutting down, this helps
# leave the workdir in a usable state
self.runCommand(["stateShutdown"])
def reset_build(self):
self.build.reset()
def get_logfile(self):
return self.server.runCommand(["getVariable", "BB_CONSOLELOG"])[0]
def _remove_redundant(self, string):
ret = []
for i in string.split():
if i not in ret:
ret.append(i)
return " ".join(ret)
def get_parameters(self):
# retrieve the parameters from bitbake
params = {}
params["core_base"] = self.runCommand(["getVariable", "COREBASE"]) or ""
hob_layer = params["core_base"] + "/meta-hob"
params["layer"] = self.runCommand(["getVariable", "BBLAYERS"]) or ""
params["layers_non_removable"] = self.runCommand(["getVariable", "BBLAYERS_NON_REMOVABLE"]) or ""
if hob_layer not in params["layer"].split():
params["layer"] += (" " + hob_layer)
if hob_layer not in params["layers_non_removable"].split():
params["layers_non_removable"] += (" " + hob_layer)
params["dldir"] = self.runCommand(["getVariable", "DL_DIR"]) or ""
params["machine"] = self.runCommand(["getVariable", "MACHINE"]) or ""
params["distro"] = self.runCommand(["getVariable", "DISTRO"]) or "defaultsetup"
params["pclass"] = self.runCommand(["getVariable", "PACKAGE_CLASSES"]) or ""
params["sstatedir"] = self.runCommand(["getVariable", "SSTATE_DIR"]) or ""
params["sstatemirror"] = self.runCommand(["getVariable", "SSTATE_MIRRORS"]) or ""
num_threads = self.runCommand(["getCpuCount"])
if not num_threads:
示例2: HobHandler
# 需要导入模块: from bb.ui.crumbs.runningbuild import RunningBuild [as 别名]
# 或者: from bb.ui.crumbs.runningbuild.RunningBuild import reset [as 别名]
#.........这里部分代码省略.........
message["title"] = "Parsing recipes"
self.emit("parsing-started", message)
if isinstance(event, bb.event.ParseStarted):
self.parsing = True
elif isinstance(event, (bb.event.ParseProgress,
bb.event.CacheLoadProgress,
bb.event.TreeDataPreparationProgress)):
message = {}
message["eventname"] = bb.event.getName(event)
message["current"] = event.current
message["total"] = event.total
message["title"] = "Parsing recipes"
self.emit("parsing", message)
elif isinstance(event, (bb.event.ParseCompleted,
bb.event.CacheLoadCompleted,
bb.event.TreeDataPreparationCompleted)):
message = {}
message["eventname"] = bb.event.getName(event)
message["current"] = event.total
message["total"] = event.total
message["title"] = "Parsing recipes"
self.emit("parsing-completed", message)
if isinstance(event, bb.event.ParseCompleted):
self.parsing = False
if self.error_msg and not self.commands_async:
self.display_error()
return
def init_cooker(self):
self.runCommand(["initCooker"])
def reset_cooker(self):
self.runCommand(["enableDataTracking"])
self.runCommand(["resetCooker"])
self.runCommand(["disableDataTracking"])
def set_distro(self, distro):
self.set_var_in_file("DISTRO", distro, "local.conf")
def request_package_info(self):
self.commands_async.append(self.SUB_GENERATE_PKGINFO)
self.run_next_command(self.POPULATE_PACKAGEINFO)
def trigger_sanity_check(self):
self.commands_async.append(self.SUB_SANITY_CHECK)
self.run_next_command(self.SANITY_CHECK)
def generate_configuration(self):
self.commands_async.append(self.SUB_PARSE_CONFIG)
self.commands_async.append(self.SUB_FILES_MACH)
self.run_next_command(self.GENERATE_CONFIGURATION)
def generate_recipes(self):
self.commands_async.append(self.SUB_PARSE_CONFIG)
self.commands_async.append(self.SUB_GNERATE_TGTS)
self.run_next_command(self.GENERATE_RECIPES)
def generate_packages(self, tgts, default_task="build"):
targets = []
targets.extend(tgts)
self.recipe_queue = targets
self.default_task = default_task
self.commands_async.append(self.SUB_PARSE_CONFIG)
self.commands_async.append(self.SUB_BUILD_RECIPES)
示例3: HobHandler
# 需要导入模块: from bb.ui.crumbs.runningbuild import RunningBuild [as 别名]
# 或者: from bb.ui.crumbs.runningbuild.RunningBuild import reset [as 别名]
class HobHandler(gobject.GObject):
"""
This object does BitBake event handling for the hob gui.
"""
__gsignals__ = {
"layers-updated" : (gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
(gobject.TYPE_PYOBJECT,)),
"package-formats-updated" : (gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
(gobject.TYPE_PYOBJECT,)),
"config-updated" : (gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
(gobject.TYPE_STRING, gobject.TYPE_PYOBJECT,)),
"command-succeeded" : (gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
(gobject.TYPE_INT,)),
"command-failed" : (gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
(gobject.TYPE_STRING,)),
"generating-data" : (gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
()),
"data-generated" : (gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
()),
"parsing-started" : (gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
(gobject.TYPE_PYOBJECT,)),
"parsing" : (gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
(gobject.TYPE_PYOBJECT,)),
"parsing-completed" : (gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
(gobject.TYPE_PYOBJECT,)),
}
(CFG_AVAIL_LAYERS, CFG_PATH_LAYERS, CFG_FILES_DISTRO, CFG_FILES_MACH, CFG_FILES_SDKMACH, FILES_MATCH_CLASS, PARSE_CONFIG, PARSE_BBFILES, GENERATE_TGTS, GENERATE_PACKAGEINFO, BUILD_TARGET_RECIPES, BUILD_TARGET_IMAGE, CMD_END) = range(13)
(LAYERS_REFRESH, GENERATE_RECIPES, GENERATE_PACKAGES, GENERATE_IMAGE, POPULATE_PACKAGEINFO) = range(5)
def __init__(self, server, server_addr, client_addr, recipe_model, package_model):
super(HobHandler, self).__init__()
self.build = RunningBuild(sequential=True)
self.recipe_model = recipe_model
self.package_model = package_model
self.commands_async = []
self.generating = False
self.current_phase = None
self.building = False
self.recipe_queue = []
self.package_queue = []
self.server = server
self.error_msg = ""
self.initcmd = None
self.split_model = False
if server_addr and client_addr:
self.split_model = (server_addr != client_addr)
self.reset_server() # reset server if server was found just now
self.server_addr = server_addr
def kick(self):
import xmlrpclib
try:
# kick the while thing off
if self.split_model:
self.commands_async.append(self.CFG_AVAIL_LAYERS)
else:
self.commands_async.append(self.CFG_PATH_LAYERS)
self.commands_async.append(self.CFG_FILES_DISTRO)
self.commands_async.append(self.CFG_FILES_MACH)
self.commands_async.append(self.CFG_FILES_SDKMACH)
self.commands_async.append(self.FILES_MATCH_CLASS)
self.run_next_command()
return True
except xmlrpclib.Fault as x:
print("XMLRPC Fault getting commandline:\n %s" % x)
return False
def set_busy(self):
if not self.generating:
self.emit("generating-data")
self.generating = True
def clear_busy(self):
if self.generating:
self.emit("data-generated")
self.generating = False
def run_next_command(self, initcmd=None):
if initcmd:
self.initcmd = initcmd
if self.commands_async:
self.set_busy()
#.........这里部分代码省略.........
示例4: MainWindow
# 需要导入模块: from bb.ui.crumbs.runningbuild import RunningBuild [as 别名]
# 或者: from bb.ui.crumbs.runningbuild.RunningBuild import reset [as 别名]
#.........这里部分代码省略.........
def running_build_succeeded_cb(self, running_build):
self.build_succeeded = True
def running_build_failed_cb(self, running_build):
self.build_succeeded = False
def image_changed_string_cb(self, model, new_image):
self.selected_image = new_image
# disconnect the image combo's signal handler
if self.image_combo_id:
self.image_combo.disconnect(self.image_combo_id)
self.image_combo_id = None
cnt = 0
it = self.model.images.get_iter_first()
while it:
path = self.model.images.get_path(it)
if self.model.images[path][self.model.COL_NAME] == new_image:
self.image_combo.set_active(cnt)
break
it = self.model.images.iter_next(it)
cnt = cnt + 1
# Reconnect the signal handler
if not self.image_combo_id:
self.image_combo_id = self.image_combo.connect("changed", self.image_changed_cb)
def image_changed_cb(self, combo):
model = self.image_combo.get_model()
it = self.image_combo.get_active_iter()
if it:
path = model.get_path(it)
# Firstly, deselect the previous image
userp, _ = self.model.get_selected_packages()
self.model.reset()
# Now select the new image and save its path in case we
# change the image later
self.toggle_package(path, model, image=True)
if len(userp):
self.model.set_selected_packages(userp)
self.selected_image = model[path][self.model.COL_NAME]
def reload_triggered_cb(self, handler, image, packages):
if image:
self.selected_image = image
if len(packages):
self.selected_packages = packages.split()
def data_generated(self, handler):
self.generating = False
self.enable_widgets()
def machine_combo_changed_cb(self, combo, handler):
mach = combo.get_active_text()
if mach != self.curr_mach:
self.curr_mach = mach
# Flush this straight to the file as MACHINE is changed
# independently of other 'Preferences'
self.configurator.setConfVar('MACHINE', mach)
self.configurator.writeConf()
handler.set_machine(mach)
handler.reload_data()
def update_machines(self, handler, machines):
active = 0
# disconnect the signal handler before updating the combo model
if self.machine_handler_id: