diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2010-01-20 18:46:02 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-01-20 18:46:02 +0000 |
commit | 22c29d8651668195f72e2f6a8e059d625eb511c3 (patch) | |
tree | dd1dd43f0ec47a9964c8a766eb8b3ad75cf51a64 /bitbake/lib/bb/ui/goggle.py | |
parent | 1bfd6edef9db9c9175058ae801d1b601e4f15263 (diff) | |
download | poky-22c29d8651668195f72e2f6a8e059d625eb511c3.tar.gz |
bitbake: Switch to bitbake-dev version (bitbake master upstream)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/ui/goggle.py')
-rw-r--r-- | bitbake/lib/bb/ui/goggle.py | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/bitbake/lib/bb/ui/goggle.py b/bitbake/lib/bb/ui/goggle.py new file mode 100644 index 0000000000..94995d82db --- /dev/null +++ b/bitbake/lib/bb/ui/goggle.py | |||
@@ -0,0 +1,77 @@ | |||
1 | # | ||
2 | # BitBake Graphical GTK User Interface | ||
3 | # | ||
4 | # Copyright (C) 2008 Intel Corporation | ||
5 | # | ||
6 | # Authored by Rob Bradford <rob@linux.intel.com> | ||
7 | # | ||
8 | # This program is free software; you can redistribute it and/or modify | ||
9 | # it under the terms of the GNU General Public License version 2 as | ||
10 | # published by the Free Software Foundation. | ||
11 | # | ||
12 | # This program is distributed in the hope that it will be useful, | ||
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | # GNU General Public License for more details. | ||
16 | # | ||
17 | # You should have received a copy of the GNU General Public License along | ||
18 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
19 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
20 | |||
21 | import gobject | ||
22 | import gtk | ||
23 | import xmlrpclib | ||
24 | from bb.ui.crumbs.runningbuild import RunningBuildTreeView, RunningBuild | ||
25 | |||
26 | def event_handle_idle_func (eventHandler, build): | ||
27 | |||
28 | # Consume as many messages as we can in the time available to us | ||
29 | event = eventHandler.getEvent() | ||
30 | while event: | ||
31 | build.handle_event (event) | ||
32 | event = eventHandler.getEvent() | ||
33 | |||
34 | return True | ||
35 | |||
36 | class MainWindow (gtk.Window): | ||
37 | def __init__ (self): | ||
38 | gtk.Window.__init__ (self, gtk.WINDOW_TOPLEVEL) | ||
39 | |||
40 | # Setup tree view and the scrolled window | ||
41 | scrolled_window = gtk.ScrolledWindow () | ||
42 | self.add (scrolled_window) | ||
43 | self.cur_build_tv = RunningBuildTreeView() | ||
44 | scrolled_window.add (self.cur_build_tv) | ||
45 | |||
46 | def init (server, eventHandler): | ||
47 | gobject.threads_init() | ||
48 | gtk.gdk.threads_init() | ||
49 | |||
50 | window = MainWindow () | ||
51 | window.show_all () | ||
52 | |||
53 | # Create the object for the current build | ||
54 | running_build = RunningBuild () | ||
55 | window.cur_build_tv.set_model (running_build.model) | ||
56 | try: | ||
57 | cmdline = server.runCommand(["getCmdLineAction"]) | ||
58 | print cmdline | ||
59 | if not cmdline: | ||
60 | return 1 | ||
61 | ret = server.runCommand(cmdline) | ||
62 | if ret != True: | ||
63 | print "Couldn't get default commandline! %s" % ret | ||
64 | return 1 | ||
65 | except xmlrpclib.Fault, x: | ||
66 | print "XMLRPC Fault getting commandline:\n %s" % x | ||
67 | return 1 | ||
68 | |||
69 | # Use a timeout function for probing the event queue to find out if we | ||
70 | # have a message waiting for us. | ||
71 | gobject.timeout_add (200, | ||
72 | event_handle_idle_func, | ||
73 | eventHandler, | ||
74 | running_build) | ||
75 | |||
76 | gtk.main() | ||
77 | |||