*: use print() as a function
to make python3 happy (Bitbake rev: c82926ccdd4ec4e3ad6e78a381dacb96adf9b409) Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
parent
2fc283c52d
commit
c4fde248b1
|
@ -195,13 +195,13 @@ Default BBFILES are the .bb files in the current directory.""")
|
||||||
uimodule = __import__("bb.ui", fromlist = [ui])
|
uimodule = __import__("bb.ui", fromlist = [ui])
|
||||||
ui_init = getattr(uimodule, ui).init
|
ui_init = getattr(uimodule, ui).init
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
print "FATAL: Invalid user interface '%s' specified. " % ui
|
print("FATAL: Invalid user interface '%s' specified. " % ui)
|
||||||
print "Valid interfaces are 'ncurses', 'depexp' or the default, 'knotty'."
|
print("Valid interfaces are 'ncurses', 'depexp' or the default, 'knotty'.")
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
return_value = ui_init(serverConnection.connection, serverConnection.events)
|
return_value = ui_init(serverConnection.connection, serverConnection.events)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print "FATAL: Unable to start to '%s' UI: %s" % (ui, e)
|
print("FATAL: Unable to start to '%s' UI: %s" % (ui, e))
|
||||||
raise
|
raise
|
||||||
finally:
|
finally:
|
||||||
serverConnection.terminate()
|
serverConnection.terminate()
|
||||||
|
|
|
@ -218,8 +218,8 @@ python myclass_eventhandler() {
|
||||||
from bb.event import getName
|
from bb.event import getName
|
||||||
from bb import data
|
from bb import data
|
||||||
|
|
||||||
print "The name of the Event is %s" % getName(e)
|
print("The name of the Event is %s" % getName(e))
|
||||||
print "The file we run for is %s" % data.getVar('FILE', e.data, True)
|
print("The file we run for is %s" % data.getVar('FILE', e.data, True))
|
||||||
}
|
}
|
||||||
</screen></para><para>
|
</screen></para><para>
|
||||||
This event handler gets called every time an event is triggered. A global variable <varname>e</varname> is defined. <varname>e</varname>.data contains an instance of bb.data. With the getName(<varname>e</varname>)
|
This event handler gets called every time an event is triggered. A global variable <varname>e</varname> is defined. <varname>e</varname>.data contains an instance of bb.data. With the getName(<varname>e</varname>)
|
||||||
|
|
|
@ -110,7 +110,7 @@ def debug(level, msgdomain, msg, fn = None):
|
||||||
if debug_level[msgdomain] >= level:
|
if debug_level[msgdomain] >= level:
|
||||||
bb.event.fire(MsgDebug(msg), None)
|
bb.event.fire(MsgDebug(msg), None)
|
||||||
if not bb.event._ui_handlers:
|
if not bb.event._ui_handlers:
|
||||||
print('DEBUG: ' + msg)
|
print('DEBUG: %s' % (msg))
|
||||||
|
|
||||||
def note(level, msgdomain, msg, fn = None):
|
def note(level, msgdomain, msg, fn = None):
|
||||||
if not msgdomain:
|
if not msgdomain:
|
||||||
|
@ -119,20 +119,20 @@ def note(level, msgdomain, msg, fn = None):
|
||||||
if level == 1 or verbose or debug_level[msgdomain] >= 1:
|
if level == 1 or verbose or debug_level[msgdomain] >= 1:
|
||||||
bb.event.fire(MsgNote(msg), None)
|
bb.event.fire(MsgNote(msg), None)
|
||||||
if not bb.event._ui_handlers:
|
if not bb.event._ui_handlers:
|
||||||
print('NOTE: ' + msg)
|
print('NOTE: %s' % (msg))
|
||||||
|
|
||||||
def warn(msgdomain, msg, fn = None):
|
def warn(msgdomain, msg, fn = None):
|
||||||
bb.event.fire(MsgWarn(msg), None)
|
bb.event.fire(MsgWarn(msg), None)
|
||||||
if not bb.event._ui_handlers:
|
if not bb.event._ui_handlers:
|
||||||
print('WARNING: ' + msg)
|
print('WARNING: %s' % (msg))
|
||||||
|
|
||||||
def error(msgdomain, msg, fn = None):
|
def error(msgdomain, msg, fn = None):
|
||||||
bb.event.fire(MsgError(msg), None)
|
bb.event.fire(MsgError(msg), None)
|
||||||
print 'ERROR: ' + msg
|
print('ERROR: %s' % (msg))
|
||||||
|
|
||||||
def fatal(msgdomain, msg, fn = None):
|
def fatal(msgdomain, msg, fn = None):
|
||||||
bb.event.fire(MsgFatal(msg), None)
|
bb.event.fire(MsgFatal(msg), None)
|
||||||
print('FATAL: ' + msg)
|
print('FATAL: %s' % (msg))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
def plain(msg, fn = None):
|
def plain(msg, fn = None):
|
||||||
|
|
Loading…
Reference in New Issue