More fixes for Hob
cover More fixes for Hob
These patches are to:
- change parse_config API from async to sync for image types and remembering layers
- fix the image types
- add proxy support
- remember settings and layers between Hob runs with template
- fix two UI bugs in the build log screen
- extend the timeout for piping.
- etc.
The following changes since commit 8dda137c12d284304a5b3e6693732b00f2b5553f:
Hob: Revert interfaces of callbacks for layer_button, view_recipes_button, and view_packages_button. (2012-03-22 14:43:51 +0000)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib shane/hob-fixes-continue
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=shane/hob-fixes-continue
Dongxiao Xu (4):
command.py: Change parseConfigurationFiles API from async to sync process.py: Increase the timeout value for polling commands
Hob: Change parseConfigurationFiles API usage
Hob: Fix the workaround to get image types
Liming An (2):
Hob: reset the policy to forbid the horizontal scrolling for building
log
Hob: add auto scroll to rows which be new appended in hob building
log page
Shane Wang (2):
Hob: allow users to setup the proxies
Hob: remember the settings between Hob sessions
bitbake/lib/bb/command.py | 17 ++-- bitbake/lib/bb/server/process.py | 2 +- bitbake/lib/bb/ui/crumbs/builddetailspage.py | 17 +++- bitbake/lib/bb/ui/crumbs/builder.py | 139 +++++++++++++++++++++++-- bitbake/lib/bb/ui/crumbs/hig.py | 94 +++++++++++++++-- bitbake/lib/bb/ui/crumbs/hobeventhandler.py | 28 ++++-- bitbake/lib/bb/ui/crumbs/hobwidget.py | 24 +++++ bitbake/lib/bb/ui/crumbs/runningbuild.py | 7 +- bitbake/lib/bb/ui/crumbs/template.py | 55 +++++++--- bitbake/lib/bb/ui/hob.py | 3 +- 10 files changed, 319 insertions(+), 67 deletions(-)
Signature · 1 line
1.7.6
PATCH 1/8 command.py: Change parseConfigurationFiles API from async to sync
From: Dongxiao Xu <[email protected]>
parseConfigurationFiles will not cost much time and move it to the CommandSync class.
--- bitbake/lib/bb/command.py | 17 ++++++++--------- 1 files changed, 8 insertions(+), 9 deletions(-)
bitbake/lib/bb/command.py +8 -9
@@ -186,6 +186,14 @@ class CommandsSync: event = params[0] bb.event.fire(eval(event), command.cooker.configuration.data) + def parseConfigurationFiles(self, command, params): + """ + Parse the configuration files + """ + prefiles = params[0] + postfiles = params[1] + command.cooker.parseConfigurationFiles(prefiles, postfiles) + class CommandsAsync: """ A class of asynchronous commands
@@ -350,12 +358,3 @@ class CommandsAsync: command.finishAsyncCommand() compareRevisions.needcache = True - def parseConfigurationFiles(self, command, params): - """ - Parse the configuration files - """ - prefiles = params[0] - postfiles = params[1] - command.cooker.parseConfigurationFiles(prefiles, postfiles) - command.finishAsyncCommand() - parseConfigurationFiles.needcache = False
Signature · 1 line
1.7.6
PATCH 2/8 process.py: Increase the timeout value for polling commands
From: Dongxiao Xu <[email protected]>
The parseConfigurationFiles commands needs more time for piping, thus change the polling timeout value from 0.5s to 1s.
--- bitbake/lib/bb/server/process.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
bitbake/lib/bb/server/process.py +1 -1
@@ -45,7 +45,7 @@ class ServerCommunicator(): while True: # don't let the user ctrl-c while we're waiting for a response try: - if self.connection.poll(.5): + if self.connection.poll(1): return self.connection.recv() else: return None
Signature · 1 line
1.7.6
PATCH 4/8 Hob: Fix the workaround to get image types
In reply to Shane WangFrom: Dongxiao Xu <[email protected]>
Inherit image_types.bbclass before getting parameters to fix the original workaround.
Besides, kick the handler things off after Builder is initialized.
--- bitbake/lib/bb/ui/crumbs/hobeventhandler.py | 8 ++++++-- bitbake/lib/bb/ui/hob.py | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-)
bitbake/lib/bb/ui/crumbs/hobeventhandler.py +6 -2
@@ -379,6 +379,11 @@ class HobHandler(gobject.GObject): self.build.reset() def get_parameters(self): + # inherit image_types.bbclass + self.init_cooker() + self.set_extra_inherit("image_types") + self.parse_config() + # retrieve the parameters from bitbake params = {} params["core_base"] = self.server.runCommand(["getVariable", "COREBASE"]) or ""
@@ -444,8 +449,7 @@ class HobHandler(gobject.GObject): params["image_fstypes"] = self.server.runCommand(["getVariable", "IMAGE_FSTYPES"]) or "" - # walkaround - params["image_types"] = " ".join(hcc.SUPPORTED_IMAGE_TYPES.keys()).lstrip(" ") + params["image_types"] = self.server.runCommand(["getVariable", "IMAGE_TYPES"]) or "" params["conf_version"] = self.server.runCommand(["getVariable", "CONF_VERSION"]) or "" params["lconf_version"] = self.server.runCommand(["getVariable", "LCONF_VERSION"]) or ""
bitbake/lib/bb/ui/hob.py +2 -1
@@ -56,9 +56,10 @@ def main (server = None, eventHandler = None): package_model = PackageListModel() hobHandler = HobHandler(server, recipe_model, package_model) + builder = Builder(hobHandler, recipe_model, package_model) + if hobHandler.kick() == False: return 1 - builder = Builder(hobHandler, recipe_model, package_model) # This timeout function regularly probes the event queue to find out if we # have any messages waiting for us.
Signature · 1 line
1.7.6
PATCH 3/8 Hob: Change parseConfigurationFiles API usage
In reply to Shane WangFrom: Dongxiao Xu <[email protected]>
parseConfigurationFiles API is changed to sync mode, therefore make accordingly changes in Hob part.
--- bitbake/lib/bb/ui/crumbs/hobeventhandler.py | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-)
bitbake/lib/bb/ui/crumbs/hobeventhandler.py +8 -7
@@ -62,7 +62,7 @@ class HobHandler(gobject.GObject): (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) + (CFG_AVAIL_LAYERS, CFG_PATH_LAYERS, CFG_FILES_DISTRO, CFG_FILES_MACH, CFG_FILES_SDKMACH, FILES_MATCH_CLASS, PARSE_BBFILES, GENERATE_TGTS, GENERATE_PACKAGEINFO, BUILD_TARGET_RECIPES, BUILD_TARGET_IMAGE, CMD_END) = range(12) (LAYERS_REFRESH, GENERATE_RECIPES, GENERATE_PACKAGES, GENERATE_IMAGE, POPULATE_PACKAGEINFO) = range(5) def __init__(self, server, recipe_model, package_model):
@@ -134,8 +134,6 @@ class HobHandler(gobject.GObject): 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:
@@ -265,10 +263,13 @@ class HobHandler(gobject.GObject): def init_cooker(self): self.server.runCommand(["initCooker"]) + def parse_config(self): + self.server.runCommand(["parseConfigurationFiles", "", ""]) + def refresh_layers(self, bblayers): self.server.runCommand(["initCooker"]) self.server.runCommand(["setVariable", "BBLAYERS", " ".join(bblayers)]) - self.commands_async.append(self.PARSE_CONFIG) + self.parse_config() self.commands_async.append(self.CFG_FILES_DISTRO) self.commands_async.append(self.CFG_FILES_MACH) self.commands_async.append(self.CFG_FILES_SDKMACH)
@@ -336,7 +337,7 @@ class HobHandler(gobject.GObject): self.run_next_command(self.POPULATE_PACKAGEINFO) def generate_recipes(self): - self.commands_async.append(self.PARSE_CONFIG) + self.parse_config() self.commands_async.append(self.GENERATE_TGTS) self.run_next_command(self.GENERATE_RECIPES)
@@ -344,7 +345,7 @@ class HobHandler(gobject.GObject): targets = [] targets.extend(tgts) self.recipe_queue = targets - self.commands_async.append(self.PARSE_CONFIG) + self.parse_config() self.commands_async.append(self.PARSE_BBFILES) self.commands_async.append(self.BUILD_TARGET_RECIPES) self.run_next_command(self.GENERATE_PACKAGES)
@@ -352,7 +353,7 @@ class HobHandler(gobject.GObject): def generate_image(self, tgts, toolchain_build=False): self.package_queue = tgts self.toolchain_build = toolchain_build - self.commands_async.append(self.PARSE_CONFIG) + self.parse_config() self.commands_async.append(self.PARSE_BBFILES) self.commands_async.append(self.BUILD_TARGET_IMAGE) self.run_next_command(self.GENERATE_IMAGE)
Signature · 1 line
1.7.6
PATCH 5/8 Hob: allow users to setup the proxies
In reply to Shane WangThis patch is to set os.environ to allow users to set the environment variables for all_proxy, http_proxy, https_proxy and ftp_proxy.
--- bitbake/lib/bb/ui/crumbs/builder.py | 52 +++++++++++++++++++ bitbake/lib/bb/ui/crumbs/hig.py | 94 ++++++++++++++++++++++++++++++---- 2 files changed, 135 insertions(+), 11 deletions(-)
bitbake/lib/bb/ui/crumbs/builder.py +52 -0
@@ -39,6 +39,7 @@ from bb.ui.crumbs.hig import CrumbsMessageDialog, BinbDialog, \ class Configuration: '''Represents the data structure of configuration.''' + __dummy_proxy__ = "myproxy.example.com:8010" def __init__(self, params): # Settings
@@ -67,6 +68,25 @@ class Configuration: self.selected_recipes = [] self.selected_packages = [] + # proxy settings + self.all_proxy = self.get_os_proxy("all_proxy") + self.http_proxy = self.get_os_proxy("http_proxy") + self.ftp_proxy = self.get_os_proxy("ftp_proxy") + self.https_proxy = self.get_os_proxy("https_proxy") + self.enable_proxy = False + + def get_os_proxy(self, proxy_key): + if proxy_key in os.environ.keys(): + return os.environ[proxy_key] + return self.__dummy_proxy__ + + def set_os_proxy(self, proxy_key, proxy): + if (not proxy or proxy.lstrip() == "" or proxy == self.__dummy_proxy__) \ + and proxy_key in os.environ.keys(): + del os.environ[proxy_key] + else: + os.environ[proxy_key] = proxy + def load(self, template): self.curr_mach = template.getVar("MACHINE") self.curr_package_format = " ".join(template.getVar("PACKAGE_CLASSES").split("package_")).strip()
@@ -92,6 +112,12 @@ class Configuration: self.selected_image = template.getVar("__SELECTED_IMAGE__") self.selected_recipes = template.getVar("DEPENDS").split() self.selected_packages = template.getVar("IMAGE_INSTALL").split() + # proxy + self.all_proxy = template.getVar("all_proxy") + self.http_proxy = template.getVar("http_proxy") + self.ftp_proxy = template.getVar("ftp_proxy") + self.https_proxy = template.getVar("https_proxy") + self.enable_proxy = (template.getVar("enable_proxy") == "True") def save(self, template, filename): # bblayers.conf
@@ -119,6 +145,12 @@ class Configuration: template.setVar("__SELECTED_IMAGE__", self.selected_image) template.setVar("DEPENDS", self.selected_recipes) template.setVar("IMAGE_INSTALL", self.selected_packages) + # proxy + template.setVar("all_proxy", self.all_proxy) + template.setVar("http_proxy", self.http_proxy) + template.setVar("ftp_proxy", self.ftp_proxy) + template.setVar("https_proxy", self.https_proxy) + template.setVar("enable_proxy", ("%s" % self.enable_proxy)) class Parameters: '''Represents other variables like available machines, etc.'''
@@ -732,6 +764,13 @@ class Builder(gtk.Window): dialog.destroy() + def _setup_proxy(self): + if self.configuration.enable_proxy: + self.configuration.set_os_proxy("all_proxy", self.configuration.all_proxy) + self.configuration.set_os_proxy("http_proxy", self.configuration.http_proxy) + self.configuration.set_os_proxy("https_proxy", self.configuration.https_proxy) + self.configuration.set_os_proxy("ftp_proxy", self.configuration.ftp_proxy) + def show_adv_settings_dialog(self): dialog = AdvancedSettingDialog(title = "Settings", configuration = copy.deepcopy(self.configuration),
@@ -740,6 +779,11 @@ class Builder(gtk.Window): all_distros = self.parameters.all_distros, all_sdk_machines = self.parameters.all_sdk_machines, max_threads = self.parameters.max_threads, + all_proxy = self.configuration.all_proxy, + http_proxy = self.configuration.http_proxy, + https_proxy = self.configuration.https_proxy, + ftp_proxy = self.configuration.ftp_proxy, + enable_proxy = self.configuration.enable_proxy, parent = self, flags = gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT
@@ -749,6 +793,14 @@ class Builder(gtk.Window): response = dialog.run() if response == gtk.RESPONSE_YES: self.configuration = dialog.configuration + # setup the proxy + self.configuration.enable_proxy = dialog.enable_proxy + if self.configuration.enable_proxy: + self.configuration.all_proxy = dialog.all_proxy + self.configuration.http_proxy = dialog.http_proxy + self.configuration.https_proxy = dialog.https_proxy + self.configuration.ftp_proxy = dialog.ftp_proxy + self._setup_proxy() # DO reparse recipes if dialog.settings_changed: if self.configuration.curr_mach == "":
bitbake/lib/bb/ui/crumbs/hig.py +83 -11
140 lines not on this page · raw message
Signature · 1 line
1.7.6
PATCH 6/8 Hob: remember the settings between Hob sessions
In reply to Shane WangThis patch is to add support to remember and restore the settings between different Hob sessions. The settings include:
- Layers
- Settings including proxies
[Yocto #2113]
--- bitbake/lib/bb/ui/crumbs/builder.py | 125 ++++++++++++++++++++------- bitbake/lib/bb/ui/crumbs/hig.py | 8 +- bitbake/lib/bb/ui/crumbs/hobeventhandler.py | 5 +- bitbake/lib/bb/ui/crumbs/template.py | 55 ++++++++---- 4 files changed, 141 insertions(+), 52 deletions(-)
bitbake/lib/bb/ui/crumbs/builder.py +94 -31
@@ -87,8 +87,27 @@ class Configuration: else: os.environ[proxy_key] = proxy + def _setup_proxy(self): + if self.enable_proxy: + self.set_os_proxy("all_proxy", self.all_proxy) + self.set_os_proxy("http_proxy", self.http_proxy) + self.set_os_proxy("https_proxy", self.https_proxy) + self.set_os_proxy("ftp_proxy", self.ftp_proxy) + def load(self, template): + self.load_machine(template) + self.load_configuration(template) + self.load_layers(template) + self.load_image(template) + + def load_settings_only(self, template): + self.load_configuration(template) + self.load_layers(template) + + def load_machine(self, template): self.curr_mach = template.getVar("MACHINE") + + def load_configuration(self, template): self.curr_package_format = " ".join(template.getVar("PACKAGE_CLASSES").split("package_")).strip() self.curr_distro = template.getVar("DISTRO") self.dldir = template.getVar("DL_DIR")
@@ -98,7 +117,7 @@ class Configuration: self.bbthread = int(template.getVar("BB_NUMBER_THREAD")) self.image_rootfs_size = int(template.getVar("IMAGE_ROOTFS_SIZE")) self.image_extra_size = int(template.getVar("IMAGE_EXTRA_SPACE")) - # image_overhead_factor is read-only. + # image_overhead_factor is read-only. self.incompat_license = template.getVar("INCOMPATIBLE_LICENSE") self.curr_sdk_machine = template.getVar("SDKMACHINE") self.conf_version = template.getVar("CONF_VERSION")
@@ -106,24 +125,43 @@ class Configuration: self.extra_setting = eval(template.getVar("EXTRA_SETTING")) self.toolchain_build = eval(template.getVar("TOOLCHAIN_BUILD")) self.image_fstypes = template.getVar("IMAGE_FSTYPES").split() - # bblayers.conf - self.layers = template.getVar("BBLAYERS").split() - # image/recipes/packages - self.selected_image = template.getVar("__SELECTED_IMAGE__") - self.selected_recipes = template.getVar("DEPENDS").split() - self.selected_packages = template.getVar("IMAGE_INSTALL").split() # proxy self.all_proxy = template.getVar("all_proxy") self.http_proxy = template.getVar("http_proxy") self.ftp_proxy = template.getVar("ftp_proxy") self.https_proxy = template.getVar("https_proxy") self.enable_proxy = (template.getVar("enable_proxy") == "True") + self._setup_proxy() + + def load_layers(self, template): + # bblayers.conf + self.layers = template.getVar("BBLAYERS").split() + + def load_image(self, template): + # image/recipes/packages + self.selected_image = template.getVar("__SELECTED_IMAGE__") + self.selected_recipes = template.getVar("DEPENDS").split() + self.selected_packages = template.getVar("IMAGE_INSTALL").split() def save(self, template, filename): + self.save_machine(template) + self.save_configuration(template) + self.save_layers(template) + self.save_image(template) + + def save_settings_only(self, template): + self.save_configuration(template) + self.save_layers(template) + + def save_layers(self, template): # bblayers.conf template.setVar("BBLAYERS", " ".join(self.layers)) + + def save_machine(self, template): # local.conf template.setVar("MACHINE", self.curr_mach) + + def save_configuration(self, template): template.setVar("DISTRO", self.curr_distro) template.setVar("DL_DIR", self.dldir) template.setVar("SSTATE_DIR", self.sstatedir)
@@ -140,11 +178,6 @@ class Configuration: template.setVar("EXTRA_SETTING", self.extra_setting) template.setVar("TOOLCHAIN_BUILD", self.toolchain_build) template.setVar("IMAGE_FSTYPES", " ".join(self.image_fstypes).lstrip(" ")) - # image/recipes/packages - self.selected_image = filename - template.setVar("__SELECTED_IMAGE__", self.selected_image) - template.setVar("DEPENDS", self.selected_recipes) - template.setVar("IMAGE_INSTALL", self.selected_packages) # proxy template.setVar("all_proxy", self.all_proxy) template.setVar("http_proxy", self.http_proxy)
@@ -152,6 +185,13 @@ class Configuration: template.setVar("https_proxy", self.https_proxy) template.setVar("enable_proxy", ("%s" % self.enable_proxy)) + def save_image(self, template, filename): + # image/recipes/packages + self.selected_image = filename + template.setVar("__SELECTED_IMAGE__", self.selected_image) + template.setVar("DEPENDS", self.selected_recipes) + template.setVar("IMAGE_INSTALL", self.selected_packages) + class Parameters: '''Represents other variables like available machines, etc.'''
@@ -256,6 +296,10 @@ class Builder(gtk.Window): self.handler.connect("command-succeeded", self.handler_command_succeeded_cb) self.handler.connect("command-failed", self.handler_command_failed_cb) + # restore the settings from the last Hob session + self.load_default_settings() + self.handler.parse_layers(self.configuration.layers) + self.switch_page(self.MACHINE_SELECTION) def create_visual_elements(self):
@@ -292,21 +336,32 @@ class Builder(gtk.Window): self.show_all() self.nb.set_current_page(0) - def load_template(self, path): + def load_template(self, path, load_settings_only=False): self.template = TemplateMgr() - self.template.load(path) - self.configuration.load(self.template) - - for layer in self.configuration.layers: - if not os.path.exists(layer+'/conf/layer.conf'): - return False + ret = True + if not self.template.exists(path): + ret = False + else: + self.template.load(path) + if not load_settings_only: + self.configuration.load(self.template) + else: + self.configuration.load_settings_only(self.template) - self.switch_page(self.LAYER_CHANGED) + for layer in self.configuration.layers: + if not os.path.exists(layer+'/conf/layer.conf'): + ret = False + if ret: + self.switch_page(self.LAYER_CHANGED) self.template.destroy() self.template = None + return ret - def save_template(self, path): + def load_default_settings(self): + self.load_template(TemplateMgr.convert_to_template_pathfilename("default", ".hob/"), load_settings_only=True) + + def save_template(self, path, save_settings_only=False): if path.rfind("/") == -1: filename = "default" path = "."
@@ -314,14 +369,27 @@ class Builder(gtk.Window): filename = path[path.rfind("/") + 1:len(path)] path = path[0:path.rfind("/")] - self.template = TemplateMgr() + if not save_settings_only: + self.template = TemplateMgr() + else: + self.template = TemplateMgr(save_template_only=True) + self.template.open(filename, path) - self.configuration.save(self.template, filename) + + if not save_settings_only: + self.configuration.save(self.template, filename) + else: + self.configuration.save_settings_only(self.template) self.template.save() self.template.destroy() self.template = None + def save_default_settings(self): + if not os.path.exists(".hob/"): + os.mkdir(".hob/") + self.save_template(".hob/default", save_settings_only=True) + def switch_page(self, next_step): # Main Workflow (Business Logic) self.nb.set_current_page(self.__step2page__[next_step])
@@ -645,6 +713,8 @@ class Builder(gtk.Window): response = dialog.run() dialog.destroy() if response == gtk.RESPONSE_YES: + # save the settings from the next Hob session + self.save_default_settings() gtk.main_quit() return False else:
@@ -764,13 +834,6 @@ class Builder(gtk.Window): dialog.destroy() - def _setup_proxy(self): - if self.configuration.enable_proxy: - self.configuration.set_os_proxy("all_proxy", self.configuration.all_proxy) - self.configuration.set_os_proxy("http_proxy", self.configuration.http_proxy) - self.configuration.set_os_proxy("https_proxy", self.configuration.https_proxy) - self.configuration.set_os_proxy("ftp_proxy", self.configuration.ftp_proxy) - def show_adv_settings_dialog(self): dialog = AdvancedSettingDialog(title = "Settings", configuration = copy.deepcopy(self.configuration),
@@ -800,7 +863,7 @@ class Builder(gtk.Window): self.configuration.http_proxy = dialog.http_proxy self.configuration.https_proxy = dialog.https_proxy self.configuration.ftp_proxy = dialog.ftp_proxy - self._setup_proxy() + self.configuration._setup_proxy() # DO reparse recipes if dialog.settings_changed: if self.configuration.curr_mach == "":
bitbake/lib/bb/ui/crumbs/hig.py +4 -4
@@ -539,7 +539,7 @@ class AdvancedSettingDialog (CrumbsDialog): label = self.gen_label_widget("<span weight=\"bold\">Set all proxy:</span>") tooltip = "Set the all proxy that will be used if the proxy for a URL isn't specified." - proxy_widget, self.all_proxy_text = self.gen_entry_widget(self.split_model, self.all_proxy, self, tooltip, False) + proxy_widget, self.all_proxy_text = self.gen_entry_widget(self.all_proxy, self, tooltip, False) self.all_proxy_text.set_editable(self.enable_proxy) self.all_proxy_text.set_sensitive(self.enable_proxy) sub_vbox.pack_start(label, expand=False, fill=False)
@@ -547,7 +547,7 @@ class AdvancedSettingDialog (CrumbsDialog): label = self.gen_label_widget("<span weight=\"bold\">Set http proxy:</span>") tooltip = "Set the http proxy that will be used in do_fetch() source code" - proxy_widget, self.http_proxy_text = self.gen_entry_widget(self.split_model, self.http_proxy, self, tooltip, False) + proxy_widget, self.http_proxy_text = self.gen_entry_widget(self.http_proxy, self, tooltip, False) self.http_proxy_text.set_editable(self.enable_proxy) self.http_proxy_text.set_sensitive(self.enable_proxy) sub_vbox.pack_start(label, expand=False, fill=False)
@@ -555,7 +555,7 @@ class AdvancedSettingDialog (CrumbsDialog): label = self.gen_label_widget("<span weight=\"bold\">Set https proxy:</span>") tooltip = "Set the https proxy that will be used in do_fetch() source code" - proxy_widget, self.https_proxy_text = self.gen_entry_widget(self.split_model, self.https_proxy, self, tooltip, False) + proxy_widget, self.https_proxy_text = self.gen_entry_widget(self.https_proxy, self, tooltip, False) self.https_proxy_text.set_editable(self.enable_proxy) self.https_proxy_text.set_sensitive(self.enable_proxy) sub_vbox.pack_start(label, expand=False, fill=False)
@@ -563,7 +563,7 @@ class AdvancedSettingDialog (CrumbsDialog): label = self.gen_label_widget("<span weight=\"bold\">Set ftp proxy:</span>") tooltip = "Set the ftp proxy that will be used in do_fetch() source code" - proxy_widget, self.ftp_proxy_text = self.gen_entry_widget(self.split_model, self.ftp_proxy, self, tooltip, False) + proxy_widget, self.ftp_proxy_text = self.gen_entry_widget(self.ftp_proxy, self, tooltip, False) self.ftp_proxy_text.set_editable(self.enable_proxy) self.ftp_proxy_text.set_sensitive(self.enable_proxy) sub_vbox.pack_start(label, expand=False, fill=False)
bitbake/lib/bb/ui/crumbs/hobeventhandler.py +4 -1
@@ -266,10 +266,13 @@ class HobHandler(gobject.GObject): def parse_config(self): self.server.runCommand(["parseConfigurationFiles", "", ""]) - def refresh_layers(self, bblayers): + def parse_layers(self, bblayers): self.server.runCommand(["initCooker"]) self.server.runCommand(["setVariable", "BBLAYERS", " ".join(bblayers)]) self.parse_config() + + def refresh_layers(self, bblayers): + self.parse_layers(bblayers) self.commands_async.append(self.CFG_FILES_DISTRO) self.commands_async.append(self.CFG_FILES_MACH) self.commands_async.append(self.CFG_FILES_SDKMACH)
bitbake/lib/bb/ui/crumbs/template.py +39 -16
76 lines not on this page · raw message
Signature · 1 line
1.7.6
PATCH 7/8 Hob: reset the policy to forbid the horizontal scrolling for building log
In reply to Shane WangFrom: Liming An <[email protected]>
This patch is not to show the horizontal scroll bar for building log, and add CellRendererText class to wrap the text.
[Yocto #2091]
--- bitbake/lib/bb/ui/crumbs/builddetailspage.py | 6 +++--- bitbake/lib/bb/ui/crumbs/hobwidget.py | 24 ++++++++++++++++++++++++ bitbake/lib/bb/ui/crumbs/runningbuild.py | 7 ++++--- 3 files changed, 31 insertions(+), 6 deletions(-)
bitbake/lib/bb/ui/crumbs/builddetailspage.py +3 -3
@@ -58,7 +58,7 @@ class BuildDetailsPage (HobPage): self.config_model = self.builder.handler.build.model.config_model() self.config_tv.set_model(self.config_model) self.scrolled_view_config = gtk.ScrolledWindow () - self.scrolled_view_config.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) + self.scrolled_view_config.set_policy(gtk.POLICY_NEVER, gtk.POLICY_ALWAYS) self.scrolled_view_config.add(self.config_tv) self.notebook.append_page(self.scrolled_view_config, gtk.Label("Build Configuration"))
@@ -66,14 +66,14 @@ class BuildDetailsPage (HobPage): self.failure_model = self.builder.handler.build.model.failure_model() self.failure_tv.set_model(self.failure_model) self.scrolled_view_failure = gtk.ScrolledWindow () - self.scrolled_view_failure.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) + self.scrolled_view_failure.set_policy(gtk.POLICY_NEVER, gtk.POLICY_ALWAYS) self.scrolled_view_failure.add(self.failure_tv) self.notebook.append_page(self.scrolled_view_failure, gtk.Label("Issues")) self.build_tv = RunningBuildTreeView(readonly=True) self.build_tv.set_model(self.builder.handler.build.model) self.scrolled_view_build = gtk.ScrolledWindow () - self.scrolled_view_build.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) + self.scrolled_view_build.set_policy(gtk.POLICY_NEVER, gtk.POLICY_ALWAYS) self.scrolled_view_build.add(self.build_tv) self.notebook.append_page(self.scrolled_view_build, gtk.Label("Log"))
bitbake/lib/bb/ui/crumbs/hobwidget.py +24 -0
@@ -706,3 +706,27 @@ class HobNotebook(gtk.VBox): def set_search_entry_clear_cb(self, search, icon_pos, event): self.reset_entry(search) +class HobWarpCellRendererText(gtk.CellRendererText): + def __init__(self, col_number): + gtk.CellRendererText.__init__(self) + self.set_property("wrap-mode", pango.WRAP_WORD_CHAR) + self.set_property("wrap-width", 300) # default value wrap width is 300 + self.col_n = col_number + + def do_render(self, window, widget, background_area, cell_area, expose_area, flags): + if widget: + self.props.wrap_width = self.get_resized_wrap_width(widget, widget.get_column(self.col_n)) + return gtk.CellRendererText.do_render(self, window, widget, background_area, cell_area, expose_area, flags) + + def get_resized_wrap_width(self, treeview, column): + otherCols = [] + for col in treeview.get_columns(): + if col != column: + otherCols.append(col) + adjwidth = treeview.allocation.width - sum(c.get_width() for c in otherCols) + adjwidth -= treeview.style_get_property("horizontal-separator") * 4 + if self.props.wrap_width == adjwidth or adjwidth <= 0: + adjwidth = self.props.wrap_width + return adjwidth + +gobject.type_register(HobWarpCellRendererText)
bitbake/lib/bb/ui/crumbs/runningbuild.py +4 -3
@@ -27,6 +27,7 @@ import urllib import urllib2 import pango from bb.ui.crumbs.hobcolor import HobColors +from bb.ui.crumbs.hobwidget import HobWarpCellRendererText class RunningBuildModel (gtk.TreeStore): (COL_LOG, COL_PACKAGE, COL_TASK, COL_MESSAGE, COL_ICON, COL_COLOR, COL_NUM_ACTIVE) = range(7)
@@ -350,7 +351,7 @@ class RunningBuildTreeView (gtk.TreeView): self.append_column (col) # The message of the build. - self.message_renderer = gtk.CellRendererText () + self.message_renderer = HobWarpCellRendererText (col_number=1) self.message_column = gtk.TreeViewColumn ("Message", self.message_renderer, text=3) self.message_column.add_attribute(self.message_renderer, 'background', 5) self.message_renderer.set_property('editable', (not self.readonly))
@@ -419,7 +420,7 @@ class BuildConfigurationTreeView(gtk.TreeView): self.get_selection().set_mode(gtk.SELECTION_SINGLE) # The message of the build. - self.message_renderer = gtk.CellRendererText () + self.message_renderer = HobWarpCellRendererText (col_number=0) self.message_column = gtk.TreeViewColumn ("Message", self.message_renderer, text=RunningBuildModel.COL_MESSAGE, background=RunningBuildModel.COL_COLOR) font = self.get_style().font_desc font.set_size(pango.SCALE * 13)
@@ -442,6 +443,6 @@ class BuildFailureTreeView(gtk.TreeView): self.append_column (col) # The message of the build. - self.message_renderer = gtk.CellRendererText () + self.message_renderer = HobWarpCellRendererText (col_number=1) self.message_column = gtk.TreeViewColumn ("Message", self.message_renderer, text=RunningBuildModel.COL_MESSAGE, background=RunningBuildModel.COL_COLOR) self.append_column (self.message_column)
Signature · 1 line
1.7.6
PATCH 8/8 Hob: add auto scroll to rows which be new appended in hob building log page
In reply to Shane WangFrom: Liming An <[email protected]>
For make the building screen to provide clear information about task in progress by request, so add this function.
At the beginning of building, the vertical scroll bar will go to the active area automatically. Once the user moves the scroll bar in the middle, the automatic move of the bar is disabled. However, once the user moves it to the bottom again, it will be kept to the bottom even though more logs come.
[Yocto #2098]
--- bitbake/lib/bb/ui/crumbs/builddetailspage.py | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-)
bitbake/lib/bb/ui/crumbs/builddetailspage.py +10 -1
@@ -38,7 +38,7 @@ class BuildDetailsPage (HobPage): super(BuildDetailsPage, self).__init__(builder, "Building ...") self.num_of_issues = 0 - + self.endpath = (0,) # create visual elements self.create_visual_elements()
@@ -77,6 +77,8 @@ class BuildDetailsPage (HobPage): self.scrolled_view_build.add(self.build_tv) self.notebook.append_page(self.scrolled_view_build, gtk.Label("Log")) + self.builder.handler.build.model.connect_after("row-changed", self.scroll_to_present_row, self.scrolled_view_build.get_vadjustment(), self.build_tv) + self.button_box = gtk.HBox(False, 6) self.back_button = HobAltButton("Back to image configuration") self.back_button.connect("clicked", self.back_button_clicked_cb)
@@ -138,3 +140,10 @@ class BuildDetailsPage (HobPage): def hide_stop_button(self): self.stop_button.hide() + + def scroll_to_present_row(self, model, path, iter, v_adj, treeview): + if treeview and v_adj: + if path[0] > self.endpath[0]: # check the event is a new row append or not + self.endpath = path + if v_adj.value == (v_adj.upper - v_adj.page_size): # check the gtk.adjustment position is at end boundary or not + treeview.scroll_to_cell(path)
Signature · 1 line
1.7.6