From 62c908c88b342370d2e179953c9e07094a6060b5 Mon Sep 17 00:00:00 2001 From: Shane Wang Date: Sun, 15 Apr 2012 02:58:58 +0800 Subject: Hob: remember layers and settings between Hob sessions This patch is to remember layers and settings between Hob sessions, which includes: - Put some variables for the build details screen from Configuration to Parameters because they are not actually for build but for show - We create a dummy Configuration instance and a dummy Parameters instance in __init__ of builder - The two instances will be assigned the real values by update_configuration_parameters() after parsing (in the event callback) - When it is the first time to launch Hob in a build directory, nothing is remembered since everything is fresh. - The feature is implemented with templates, and based on the hook for Hob. - When the user changes the layers or the settings, a default template file is saved into ".hob/". - Later on, the layers and the settings are remembered by loading the default template automatically. (Bitbake rev: f7c874ab930b9e7f95e79d0e84e62eb9b967f566) Signed-off-by: Shane Wang Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/crumbs/template.py | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'bitbake/lib/bb/ui/crumbs/template.py') diff --git a/bitbake/lib/bb/ui/crumbs/template.py b/bitbake/lib/bb/ui/crumbs/template.py index 5679c18f76..cbed2708de 100644 --- a/bitbake/lib/bb/ui/crumbs/template.py +++ b/bitbake/lib/bb/ui/crumbs/template.py @@ -136,11 +136,27 @@ class TemplateMgr(gobject.GObject): self.local_conf = None self.image_bb = None + @classmethod + def convert_to_template_pathfilename(cls, filename, path): + return "%s/%s%s%s" % (path, "template-", filename, ".hob") + + @classmethod + def convert_to_bblayers_pathfilename(cls, filename, path): + return "%s/%s%s%s" % (path, "bblayers-", filename, ".conf") + + @classmethod + def convert_to_local_pathfilename(cls, filename, path): + return "%s/%s%s%s" % (path, "local-", filename, ".conf") + + @classmethod + def convert_to_image_pathfilename(cls, filename, path): + return "%s/%s%s%s" % (path, "hob-image-", filename, ".bb") + def open(self, filename, path): - self.template_hob = HobTemplateFile("%s/%s%s%s" % (path, "template-", filename, ".hob")) - self.bblayers_conf = ConfigFile("%s/%s%s%s" % (path, "bblayers-", filename, ".conf")) - self.local_conf = ConfigFile("%s/%s%s%s" % (path, "local-", filename, ".conf")) - self.image_bb = RecipeFile("%s/%s%s%s" % (path, "hob-image-", filename, ".bb")) + self.template_hob = HobTemplateFile(TemplateMgr.convert_to_template_pathfilename(filename, path)) + self.bblayers_conf = ConfigFile(TemplateMgr.convert_to_bblayers_pathfilename(filename, path)) + self.local_conf = ConfigFile(TemplateMgr.convert_to_local_pathfilename(filename, path)) + self.image_bb = RecipeFile(TemplateMgr.convert_to_image_pathfilename(filename, path)) def setVar(self, var, val): if var in TemplateMgr.__gLocalVars__: -- cgit v1.2.3-54-g00ecf