summaryrefslogtreecommitdiff
path: root/bitbake/lib/bb/ui/ncurses.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/ui/ncurses.py')
-rw-r--r--bitbake/lib/bb/ui/ncurses.py31
1 files changed, 16 insertions, 15 deletions
diff --git a/bitbake/lib/bb/ui/ncurses.py b/bitbake/lib/bb/ui/ncurses.py
index 14310dc12..3fed4c58a 100644
--- a/bitbake/lib/bb/ui/ncurses.py
+++ b/bitbake/lib/bb/ui/ncurses.py
@@ -44,6 +44,8 @@
"""
+from __future__ import division
+
import os, sys, curses, itertools, time
import bb
import xmlrpclib
@@ -136,7 +138,7 @@ class NCursesUI:
"""Thread Activity Window"""
def __init__( self, x, y, width, height ):
NCursesUI.DecoratedWindow.__init__( self, "Thread Activity", x, y, width, height )
-
+
def setStatus( self, thread, text ):
line = "%02d: %s" % ( thread, text )
width = self.dimensions[WIDTH]
@@ -199,8 +201,8 @@ class NCursesUI:
main_left = 0
main_top = 0
- main_height = ( height / 3 * 2 )
- main_width = ( width / 3 ) * 2
+ main_height = ( height // 3 * 2 )
+ main_width = ( width // 3 ) * 2
clo_left = main_left
clo_top = main_top + main_height
clo_height = height - main_height - main_top - 1
@@ -225,17 +227,17 @@ class NCursesUI:
helper = uihelper.BBUIHelper()
shutdown = 0
-
+
try:
cmdline = server.runCommand(["getCmdLineAction"])
if not cmdline:
return
ret = server.runCommand(cmdline)
if ret != True:
- print "Couldn't get default commandlind! %s" % ret
+ print("Couldn't get default commandlind! %s" % ret)
return
- except xmlrpclib.Fault, x:
- print "XMLRPC Fault getting commandline:\n %s" % x
+ except xmlrpclib.Fault as x:
+ print("XMLRPC Fault getting commandline:\n %s" % x)
return
exitflag = False
@@ -246,7 +248,7 @@ class NCursesUI:
continue
helper.eventHandler(event)
#mw.appendText("%s\n" % event[0])
- if isinstance(event, bb.build.Task):
+ if isinstance(event, bb.build.TaskBase):
mw.appendText("NOTE: %s\n" % event._message)
if isinstance(event, bb.msg.MsgDebug):
mw.appendText('DEBUG: ' + event._message + '\n')
@@ -263,10 +265,10 @@ class NCursesUI:
y = event.total
if x == y:
mw.setStatus("Idle")
- mw.appendText("Parsing finished. %d cached, %d parsed, %d skipped, %d masked."
+ mw.appendText("Parsing finished. %d cached, %d parsed, %d skipped, %d masked."
% ( event.cached, event.parsed, event.skipped, event.masked ))
else:
- mw.setStatus("Parsing: %s (%04d/%04d) [%2d %%]" % ( parsespin.next(), x, y, x*100/y ) )
+ mw.setStatus("Parsing: %s (%04d/%04d) [%2d %%]" % ( next(parsespin), x, y, x*100//y ) )
# if isinstance(event, bb.build.TaskFailed):
# if event.logfile:
# if data.getVar("BBINCLUDELOGS", d):
@@ -301,12 +303,12 @@ class NCursesUI:
taw.setText(0, 0, "")
if activetasks:
taw.appendText("Active Tasks:\n")
- for task in activetasks:
- taw.appendText(task)
+ for task in activetasks.itervalues():
+ taw.appendText(task["title"])
if failedtasks:
taw.appendText("Failed Tasks:\n")
for task in failedtasks:
- taw.appendText(task)
+ taw.appendText(task["title"])
curses.doupdate()
except KeyboardInterrupt:
@@ -324,7 +326,7 @@ class NCursesUI:
def init(server, eventHandler):
if not os.isatty(sys.stdout.fileno()):
- print "FATAL: Unable to run 'ncurses' UI without a TTY."
+ print("FATAL: Unable to run 'ncurses' UI without a TTY.")
return
ui = NCursesUI()
try:
@@ -332,4 +334,3 @@ def init(server, eventHandler):
except:
import traceback
traceback.print_exc()
-