1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-02 13:29:49 +00:00

Apply the 2to3 print function transform

(Bitbake rev: ff2e28d0d9723ccd0e9dd635447b6d889cc9f597)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
Chris Larson
2010-04-09 19:46:14 -07:00
committed by Richard Purdie
parent 978b5c9466
commit ad543e2e41
17 changed files with 220 additions and 218 deletions
+2 -2
View File
@@ -158,7 +158,7 @@ class BuildResult(gobject.GObject):
# pull it out.
# TODO: Better to stat a file?
(_ , date, revision) = identifier.split ("-")
print date
print(date)
year = int (date[0:4])
month = int (date[4:6])
@@ -386,7 +386,7 @@ class BuildManager (gobject.GObject):
server.runCommand(["buildTargets", [conf.image], "rootfs"])
except Exception, e:
print e
print(e)
class BuildManagerTreeView (gtk.TreeView):
""" The tree view for the build manager. This shows the historic builds
+9 -9
View File
@@ -201,14 +201,14 @@ def init(server, eventHandler):
try:
cmdline = server.runCommand(["getCmdLineAction"])
if not cmdline or cmdline[0] != "generateDotGraph":
print "This UI is only compatible with the -g option"
print("This UI is only compatible with the -g option")
return
ret = server.runCommand(["generateDepTreeEvent", cmdline[1], cmdline[2]])
if ret != True:
print "Couldn't run command! %s" % ret
print("Couldn't run command! %s" % ret)
return
except xmlrpclib.Fault, x:
print "XMLRPC Fault getting commandline:\n %s" % x
print("XMLRPC Fault getting commandline:\n %s" % x)
return
shutdown = 0
@@ -233,8 +233,8 @@ def init(server, eventHandler):
x = event.sofar
y = event.total
if x == y:
print("\nParsing finished. %d cached, %d parsed, %d skipped, %d masked, %d errors."
% ( event.cached, event.parsed, event.skipped, event.masked, event.errors))
print(("\nParsing finished. %d cached, %d parsed, %d skipped, %d masked, %d errors."
% ( event.cached, event.parsed, event.skipped, event.masked, event.errors)))
pbar.hide()
gtk.gdk.threads_enter()
pbar.progress.set_fraction(float(x)/float(y))
@@ -250,7 +250,7 @@ def init(server, eventHandler):
if isinstance(event, bb.command.CookerCommandCompleted):
continue
if isinstance(event, bb.command.CookerCommandFailed):
print "Command execution failed: %s" % event.error
print("Command execution failed: %s" % event.error)
break
if isinstance(event, bb.cooker.CookerExit):
break
@@ -259,13 +259,13 @@ def init(server, eventHandler):
except KeyboardInterrupt:
if shutdown == 2:
print "\nThird Keyboard Interrupt, exit.\n"
print("\nThird Keyboard Interrupt, exit.\n")
break
if shutdown == 1:
print "\nSecond Keyboard Interrupt, stopping...\n"
print("\nSecond Keyboard Interrupt, stopping...\n")
server.runCommand(["stateStop"])
if shutdown == 0:
print "\nKeyboard Interrupt, closing down...\n"
print("\nKeyboard Interrupt, closing down...\n")
server.runCommand(["stateShutdown"])
shutdown = shutdown + 1
pass
+3 -3
View File
@@ -55,15 +55,15 @@ def init (server, eventHandler):
window.cur_build_tv.set_model (running_build.model)
try:
cmdline = server.runCommand(["getCmdLineAction"])
print cmdline
print(cmdline)
if not cmdline:
return 1
ret = server.runCommand(cmdline)
if ret != True:
print "Couldn't get default commandline! %s" % ret
print("Couldn't get default commandline! %s" % ret)
return 1
except xmlrpclib.Fault, x:
print "XMLRPC Fault getting commandline:\n %s" % x
print("XMLRPC Fault getting commandline:\n %s" % x)
return 1
# Use a timeout function for probing the event queue to find out if we
+22 -22
View File
@@ -44,10 +44,10 @@ def init(server, eventHandler):
return 1
ret = server.runCommand(cmdline)
if ret != True:
print "Couldn't get default commandline! %s" % ret
print("Couldn't get default commandline! %s" % ret)
return 1
except xmlrpclib.Fault, x:
print "XMLRPC Fault getting commandline:\n %s" % x
print("XMLRPC Fault getting commandline:\n %s" % x)
return 1
shutdown = 0
@@ -65,39 +65,39 @@ def init(server, eventHandler):
if shutdown and helper.needUpdate:
activetasks, failedtasks = helper.getTasks()
if activetasks:
print "Waiting for %s active tasks to finish:" % len(activetasks)
print("Waiting for %s active tasks to finish:" % len(activetasks))
tasknum = 1
for task in activetasks:
print "%s: %s (pid %s)" % (tasknum, activetasks[task]["title"], task)
print("%s: %s (pid %s)" % (tasknum, activetasks[task]["title"], task))
tasknum = tasknum + 1
if isinstance(event, bb.msg.MsgPlain):
print event._message
print(event._message)
continue
if isinstance(event, bb.msg.MsgDebug):
print 'DEBUG: ' + event._message
print('DEBUG: ' + event._message)
continue
if isinstance(event, bb.msg.MsgNote):
print 'NOTE: ' + event._message
print('NOTE: ' + event._message)
continue
if isinstance(event, bb.msg.MsgWarn):
print 'WARNING: ' + event._message
print('WARNING: ' + event._message)
continue
if isinstance(event, bb.msg.MsgError):
return_value = 1
print 'ERROR: ' + event._message
print('ERROR: ' + event._message)
continue
if isinstance(event, bb.msg.MsgFatal):
return_value = 1
print 'FATAL: ' + event._message
print('FATAL: ' + event._message)
break
if isinstance(event, bb.build.TaskFailed):
return_value = 1
logfile = event.logfile
if logfile:
print "ERROR: Logfile of failure stored in: %s" % logfile
print("ERROR: Logfile of failure stored in: %s" % logfile)
if 1 or includelogs:
print "Log data follows:"
print("Log data follows:")
f = open(logfile, "r")
lines = []
while True:
@@ -110,13 +110,13 @@ def init(server, eventHandler):
if len(lines) > int(loglines):
lines.pop(0)
else:
print '| %s' % l
print('| %s' % l)
f.close()
if lines:
for line in lines:
print line
print(line)
if isinstance(event, bb.build.TaskBase):
print "NOTE: %s" % event._message
print("NOTE: %s" % event._message)
continue
if isinstance(event, bb.event.ParseProgress):
x = event.sofar
@@ -132,8 +132,8 @@ def init(server, eventHandler):
sys.stdout.write("done.")
sys.stdout.flush()
if x == y:
print("\nParsing of %d .bb files complete (%d cached, %d parsed). %d targets, %d skipped, %d masked, %d errors."
% ( event.total, event.cached, event.parsed, event.virtuals, event.skipped, event.masked, event.errors))
print(("\nParsing of %d .bb files complete (%d cached, %d parsed). %d targets, %d skipped, %d masked, %d errors."
% ( event.total, event.cached, event.parsed, event.virtuals, event.skipped, event.masked, event.errors)))
continue
if isinstance(event, bb.command.CookerCommandCompleted):
@@ -143,7 +143,7 @@ def init(server, eventHandler):
continue
if isinstance(event, bb.command.CookerCommandFailed):
return_value = 1
print "Command execution failed: %s" % event.error
print("Command execution failed: %s" % event.error)
break
if isinstance(event, bb.cooker.CookerExit):
break
@@ -165,17 +165,17 @@ def init(server, eventHandler):
continue
if isinstance(event, bb.event.RecipeParsed):
continue
print "Unknown Event: %s" % event
print("Unknown Event: %s" % event)
except KeyboardInterrupt:
if shutdown == 2:
print "\nThird Keyboard Interrupt, exit.\n"
print("\nThird Keyboard Interrupt, exit.\n")
break
if shutdown == 1:
print "\nSecond Keyboard Interrupt, stopping...\n"
print("\nSecond Keyboard Interrupt, stopping...\n")
server.runCommand(["stateStop"])
if shutdown == 0:
print "\nKeyboard Interrupt, closing down...\n"
print("\nKeyboard Interrupt, closing down...\n")
server.runCommand(["stateShutdown"])
shutdown = shutdown + 1
pass
+3 -3
View File
@@ -232,10 +232,10 @@ class NCursesUI:
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
print("XMLRPC Fault getting commandline:\n %s" % x)
return
exitflag = False
@@ -324,7 +324,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:
+5 -5
View File
@@ -110,7 +110,7 @@ class MetaDataLoader(gobject.GObject):
except Exception, e:
gobject.idle_add (MetaDataLoader.emit_error_signal, self.loader,
"Unable to download repository metadata")
print e
print(e)
def try_fetch_from_url (self, url):
# Try and download the metadata. Firing a signal if successful
@@ -326,8 +326,8 @@ class MainWindow (gtk.Window):
conf = None
if (response_id == BuildSetupDialog.RESPONSE_BUILD):
dialog.update_configuration()
print dialog.configuration.machine, dialog.configuration.distro, \
dialog.configuration.image
print(dialog.configuration.machine, dialog.configuration.distro, \
dialog.configuration.image)
conf = dialog.configuration
dialog.destroy()
@@ -383,11 +383,11 @@ def running_build_succeeded_cb (running_build, manager):
# BuildManager. It can then hook onto the signals directly and drive
# interesting things it cares about.
manager.notify_build_succeeded ()
print "build succeeded"
print("build succeeded")
def running_build_failed_cb (running_build, manager):
# As above
print "build failed"
print("build failed")
manager.notify_build_failed ()
def init (server, eventHandler):