From e3e6d2a7445ef64b0a1a3d740ef4414d5fca9793 Mon Sep 17 00:00:00 2001 From: Dongxiao Xu Date: Sun, 15 Apr 2012 15:26:38 +0800 Subject: Hob: Simplify the init process This commit merges some functionalities together and avoid unnecessary signal handling. This can help to speed up the Hob startup. (Bitbake rev: e5a6eb4f007bf270f2fddc814eb856da46e20eee) Signed-off-by: Dongxiao Xu Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/crumbs/builder.py | 13 +++---------- bitbake/lib/bb/ui/crumbs/hobeventhandler.py | 11 ++--------- 2 files changed, 5 insertions(+), 19 deletions(-) (limited to 'bitbake') diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py index dd59d59d10..cd66c3fc9d 100755 --- a/bitbake/lib/bb/ui/crumbs/builder.py +++ b/bitbake/lib/bb/ui/crumbs/builder.py @@ -398,12 +398,12 @@ class Builder(gtk.Window): if self.load_template(TemplateMgr.convert_to_template_pathfilename("default", ".hob/")) == None: self.handler.init_cooker() self.handler.set_extra_inherit("image_types") - self.handler.parse_config() + self.handler.generate_configuration() def update_config_async(self): self.switch_page(self.MACHINE_SELECTION) self.set_user_config() - self.handler.parse_generate_configuration() + self.handler.generate_configuration() def populate_recipe_package_info_async(self): self.switch_page(self.RCPPKGINFO_POPULATING) @@ -456,9 +456,6 @@ class Builder(gtk.Window): def cancel_build_sync(self, force=False): self.handler.cancel_build(force) - def generate_configuration_async(self): - self.handler.generate_configuration() - def cancel_parse_sync(self): self.handler.cancel_parse() @@ -604,11 +601,7 @@ class Builder(gtk.Window): self.parameters.all_package_formats = formats def handler_command_succeeded_cb(self, handler, initcmd): - if initcmd == self.handler.PARSE_CONFIG: - # settings - self.update_configuration_parameters(self.get_parameters_sync()) - self.generate_configuration_async() - elif initcmd == self.handler.GENERATE_CONFIGURATION: + if initcmd == self.handler.GENERATE_CONFIGURATION: self.update_configuration_parameters(self.get_parameters_sync()) self.image_configuration_page.switch_machine_combo() elif initcmd in [self.handler.GENERATE_RECIPES, diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py index a61cca014b..216b4065ec 100644 --- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py +++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py @@ -59,7 +59,7 @@ class HobHandler(gobject.GObject): (gobject.TYPE_PYOBJECT,)), } - (PARSE_CONFIG, GENERATE_CONFIGURATION, GENERATE_RECIPES, GENERATE_PACKAGES, GENERATE_IMAGE, POPULATE_PACKAGEINFO) = range(6) + (GENERATE_CONFIGURATION, GENERATE_RECIPES, GENERATE_PACKAGES, GENERATE_IMAGE, POPULATE_PACKAGEINFO) = range(5) (SUB_PATH_LAYERS, SUB_FILES_DISTRO, SUB_FILES_MACH, SUB_FILES_SDKMACH, SUB_MATCH_CLASS, SUB_PARSE_CONFIG, SUB_GNERATE_TGTS, SUB_GENERATE_PKGINFO, SUB_BUILD_RECIPES, SUB_BUILD_IMAGE) = range(10) def __init__(self, server, recipe_model, package_model): @@ -219,14 +219,6 @@ class HobHandler(gobject.GObject): def init_cooker(self): self.server.runCommand(["initCooker"]) - def parse_config(self): - self.commands_async.append(self.SUB_PARSE_CONFIG) - self.run_next_command(self.PARSE_CONFIG) - - def parse_generate_configuration(self): - self.commands_async.append(self.SUB_PARSE_CONFIG) - self.generate_configuration() - def set_extra_inherit(self, bbclass): inherits = self.server.runCommand(["getVariable", "INHERIT"]) or "" inherits = inherits + " " + bbclass @@ -312,6 +304,7 @@ class HobHandler(gobject.GObject): self.run_next_command(self.POPULATE_PACKAGEINFO) def generate_configuration(self): + self.commands_async.append(self.SUB_PARSE_CONFIG) self.commands_async.append(self.SUB_PATH_LAYERS) self.commands_async.append(self.SUB_FILES_DISTRO) self.commands_async.append(self.SUB_FILES_MACH) -- cgit v1.2.3-54-g00ecf