summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorDongxiao Xu <dongxiao.xu@intel.com>2012-04-15 15:26:38 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-04-15 17:31:57 +0100
commite3e6d2a7445ef64b0a1a3d740ef4414d5fca9793 (patch)
treea80ce8b82ab639a57d11c0ff3cad7ac8cbbb2f58 /bitbake
parent74211e0372da92bd6b8600bee9e5624f044127a6 (diff)
downloadpoky-e3e6d2a7445ef64b0a1a3d740ef4414d5fca9793.tar.gz
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 <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/builder.py13
-rw-r--r--bitbake/lib/bb/ui/crumbs/hobeventhandler.py11
2 files changed, 5 insertions, 19 deletions
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):
398 if self.load_template(TemplateMgr.convert_to_template_pathfilename("default", ".hob/")) == None: 398 if self.load_template(TemplateMgr.convert_to_template_pathfilename("default", ".hob/")) == None:
399 self.handler.init_cooker() 399 self.handler.init_cooker()
400 self.handler.set_extra_inherit("image_types") 400 self.handler.set_extra_inherit("image_types")
401 self.handler.parse_config() 401 self.handler.generate_configuration()
402 402
403 def update_config_async(self): 403 def update_config_async(self):
404 self.switch_page(self.MACHINE_SELECTION) 404 self.switch_page(self.MACHINE_SELECTION)
405 self.set_user_config() 405 self.set_user_config()
406 self.handler.parse_generate_configuration() 406 self.handler.generate_configuration()
407 407
408 def populate_recipe_package_info_async(self): 408 def populate_recipe_package_info_async(self):
409 self.switch_page(self.RCPPKGINFO_POPULATING) 409 self.switch_page(self.RCPPKGINFO_POPULATING)
@@ -456,9 +456,6 @@ class Builder(gtk.Window):
456 def cancel_build_sync(self, force=False): 456 def cancel_build_sync(self, force=False):
457 self.handler.cancel_build(force) 457 self.handler.cancel_build(force)
458 458
459 def generate_configuration_async(self):
460 self.handler.generate_configuration()
461
462 def cancel_parse_sync(self): 459 def cancel_parse_sync(self):
463 self.handler.cancel_parse() 460 self.handler.cancel_parse()
464 461
@@ -604,11 +601,7 @@ class Builder(gtk.Window):
604 self.parameters.all_package_formats = formats 601 self.parameters.all_package_formats = formats
605 602
606 def handler_command_succeeded_cb(self, handler, initcmd): 603 def handler_command_succeeded_cb(self, handler, initcmd):
607 if initcmd == self.handler.PARSE_CONFIG: 604 if initcmd == self.handler.GENERATE_CONFIGURATION:
608 # settings
609 self.update_configuration_parameters(self.get_parameters_sync())
610 self.generate_configuration_async()
611 elif initcmd == self.handler.GENERATE_CONFIGURATION:
612 self.update_configuration_parameters(self.get_parameters_sync()) 605 self.update_configuration_parameters(self.get_parameters_sync())
613 self.image_configuration_page.switch_machine_combo() 606 self.image_configuration_page.switch_machine_combo()
614 elif initcmd in [self.handler.GENERATE_RECIPES, 607 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):
59 (gobject.TYPE_PYOBJECT,)), 59 (gobject.TYPE_PYOBJECT,)),
60 } 60 }
61 61
62 (PARSE_CONFIG, GENERATE_CONFIGURATION, GENERATE_RECIPES, GENERATE_PACKAGES, GENERATE_IMAGE, POPULATE_PACKAGEINFO) = range(6) 62 (GENERATE_CONFIGURATION, GENERATE_RECIPES, GENERATE_PACKAGES, GENERATE_IMAGE, POPULATE_PACKAGEINFO) = range(5)
63 (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) 63 (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)
64 64
65 def __init__(self, server, recipe_model, package_model): 65 def __init__(self, server, recipe_model, package_model):
@@ -219,14 +219,6 @@ class HobHandler(gobject.GObject):
219 def init_cooker(self): 219 def init_cooker(self):
220 self.server.runCommand(["initCooker"]) 220 self.server.runCommand(["initCooker"])
221 221
222 def parse_config(self):
223 self.commands_async.append(self.SUB_PARSE_CONFIG)
224 self.run_next_command(self.PARSE_CONFIG)
225
226 def parse_generate_configuration(self):
227 self.commands_async.append(self.SUB_PARSE_CONFIG)
228 self.generate_configuration()
229
230 def set_extra_inherit(self, bbclass): 222 def set_extra_inherit(self, bbclass):
231 inherits = self.server.runCommand(["getVariable", "INHERIT"]) or "" 223 inherits = self.server.runCommand(["getVariable", "INHERIT"]) or ""
232 inherits = inherits + " " + bbclass 224 inherits = inherits + " " + bbclass
@@ -312,6 +304,7 @@ class HobHandler(gobject.GObject):
312 self.run_next_command(self.POPULATE_PACKAGEINFO) 304 self.run_next_command(self.POPULATE_PACKAGEINFO)
313 305
314 def generate_configuration(self): 306 def generate_configuration(self):
307 self.commands_async.append(self.SUB_PARSE_CONFIG)
315 self.commands_async.append(self.SUB_PATH_LAYERS) 308 self.commands_async.append(self.SUB_PATH_LAYERS)
316 self.commands_async.append(self.SUB_FILES_DISTRO) 309 self.commands_async.append(self.SUB_FILES_DISTRO)
317 self.commands_async.append(self.SUB_FILES_MACH) 310 self.commands_async.append(self.SUB_FILES_MACH)