summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/hob.py
diff options
context:
space:
mode:
authorbavery <brian.avery@intel.com>2016-02-29 10:26:02 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-03-02 22:41:23 +0000
commita9dc72f08bf5bdd898fba429729acee0e7305838 (patch)
treefa1e320398a1939df372363fbbfd79a5e58ae933 /bitbake/lib/bb/ui/hob.py
parent27468dbc3aa4ed71a20f706d4a65dfa29c4dd733 (diff)
downloadpoky-a9dc72f08bf5bdd898fba429729acee0e7305838.tar.gz
bitbake: hob: removal of hob ui and associated ui files
We've been gearing up the Toaster web UI to replace the Hob (GTK+ based) UI for some time now; Hob has basically been on life support for the past few releases. As of late last month in master, Toaster has the capability to select the packages in an image, removing the last thing that Hob could do that Toaster couldn't. To recap, the reasons why Hob is being removed include: - The code is tightly woven into BitBake, making it fragile. This means it needs significant QA and maintenance on an ongoing basis. - Some of the implementation is not ideal; we'll be able to remove some cruft from BitBake and OE-Core at the same time. - It's GTK+ 2 based, not the current GTK+ 3. - Toaster is now a much more capable UI and is being actively maintained The discussion about removing hob can be found at: http://lists.openembedded.org/pipermail/openembedded-architecture/2016-February/000082.html (Bitbake rev: be2cceea159c6ca9111eff3df87b98513eab6d72) Signed-off-by: bavery <brian.avery@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/hob.py')
-rwxr-xr-xbitbake/lib/bb/ui/hob.py109
1 files changed, 0 insertions, 109 deletions
diff --git a/bitbake/lib/bb/ui/hob.py b/bitbake/lib/bb/ui/hob.py
deleted file mode 100755
index da5b411891..0000000000
--- a/bitbake/lib/bb/ui/hob.py
+++ /dev/null
@@ -1,109 +0,0 @@
1#!/usr/bin/env python
2#
3# BitBake Graphical GTK User Interface
4#
5# Copyright (C) 2011 Intel Corporation
6#
7# Authored by Joshua Lock <josh@linux.intel.com>
8# Authored by Dongxiao Xu <dongxiao.xu@intel.com>
9#
10# This program is free software; you can redistribute it and/or modify
11# it under the terms of the GNU General Public License version 2 as
12# published by the Free Software Foundation.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License along
20# with this program; if not, write to the Free Software Foundation, Inc.,
21# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22
23import sys
24import os
25requirements = "FATAL: Hob requires Gtk+ 2.20.0 or higher, PyGtk 2.21.0 or higher"
26try:
27 import gobject
28 import gtk
29 import pygtk
30 pygtk.require('2.0') # to be certain we don't have gtk+ 1.x !?!
31 gtkver = gtk.gtk_version
32 pygtkver = gtk.pygtk_version
33 if gtkver < (2, 20, 0) or pygtkver < (2, 21, 0):
34 sys.exit("%s,\nYou have Gtk+ %s and PyGtk %s." % (requirements,
35 ".".join(map(str, gtkver)),
36 ".".join(map(str, pygtkver))))
37except ImportError as exc:
38 sys.exit("%s (%s)." % (requirements, str(exc)))
39sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
40try:
41 import bb
42except RuntimeError as exc:
43 sys.exit(str(exc))
44from bb.ui import uihelper
45from bb.ui.crumbs.hoblistmodel import RecipeListModel, PackageListModel
46from bb.ui.crumbs.hobeventhandler import HobHandler
47from bb.ui.crumbs.builder import Builder
48
49featureSet = [bb.cooker.CookerFeatures.HOB_EXTRA_CACHES, bb.cooker.CookerFeatures.BASEDATASTORE_TRACKING]
50
51def event_handle_idle_func(eventHandler, hobHandler):
52 # Consume as many messages as we can in the time available to us
53 if not eventHandler:
54 return False
55 event = eventHandler.getEvent()
56 while event:
57 hobHandler.handle_event(event)
58 event = eventHandler.getEvent()
59 return True
60
61_evt_list = [ "bb.runqueue.runQueueExitWait", "bb.event.LogExecTTY", "logging.LogRecord",
62 "bb.build.TaskFailed", "bb.build.TaskBase", "bb.event.ParseStarted",
63 "bb.event.ParseProgress", "bb.event.ParseCompleted", "bb.event.CacheLoadStarted",
64 "bb.event.CacheLoadProgress", "bb.event.CacheLoadCompleted", "bb.command.CommandFailed",
65 "bb.command.CommandExit", "bb.command.CommandCompleted", "bb.cooker.CookerExit",
66 "bb.event.MultipleProviders", "bb.event.NoProvider", "bb.runqueue.sceneQueueTaskStarted",
67 "bb.runqueue.runQueueTaskStarted", "bb.runqueue.runQueueTaskFailed", "bb.runqueue.sceneQueueTaskFailed",
68 "bb.event.BuildBase", "bb.build.TaskStarted", "bb.build.TaskSucceeded", "bb.build.TaskFailedSilent",
69 "bb.event.SanityCheckPassed", "bb.event.SanityCheckFailed", "bb.event.PackageInfo",
70 "bb.event.TargetsTreeGenerated", "bb.event.ConfigFilesFound", "bb.event.ConfigFilePathFound",
71 "bb.event.FilesMatchingFound", "bb.event.NetworkTestFailed", "bb.event.NetworkTestPassed",
72 "bb.event.BuildStarted", "bb.event.BuildCompleted", "bb.event.DiskFull"]
73
74def main (server, eventHandler, params):
75 params.updateFromServer(server)
76 gobject.threads_init()
77
78 # That indicates whether the Hob and the bitbake server are
79 # running on different machines
80 # recipe model and package model
81 recipe_model = RecipeListModel()
82 package_model = PackageListModel()
83
84 llevel, debug_domains = bb.msg.constructLogOptions()
85 server.runCommand(["setEventMask", server.getEventHandle(), llevel, debug_domains, _evt_list])
86 hobHandler = HobHandler(server, recipe_model, package_model)
87 builder = Builder(hobHandler, recipe_model, package_model)
88
89 # This timeout function regularly probes the event queue to find out if we
90 # have any messages waiting for us.
91 gobject.timeout_add(10, event_handle_idle_func, eventHandler, hobHandler)
92
93 try:
94 gtk.main()
95 except EnvironmentError as ioerror:
96 # ignore interrupted io
97 if ioerror.args[0] == 4:
98 pass
99 finally:
100 hobHandler.cancel_build(force = True)
101
102if __name__ == "__main__":
103 try:
104 ret = main()
105 except Exception:
106 ret = 1
107 import traceback
108 traceback.print_exc(15)
109 sys.exit(ret)