diff options
| author | Chris Larson <chris_larson@mentor.com> | 2010-04-09 19:46:14 -0700 |
|---|---|---|
| committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-07-02 15:41:33 +0100 |
| commit | ad543e2e41b7e86d83cf0518b096ef82627bf891 (patch) | |
| tree | f8f3c5d4f759f3169a937db1da6858a11aa938fa /bitbake | |
| parent | 978b5c946683885a64ee9e7c2064ff696f05cddb (diff) | |
| download | openembedded-core-ad543e2e41b7e86d83cf0518b096ef82627bf891.tar.gz openembedded-core-ad543e2e41b7e86d83cf0518b096ef82627bf891.tar.bz2 openembedded-core-ad543e2e41b7e86d83cf0518b096ef82627bf891.zip | |
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>
Diffstat (limited to 'bitbake')
| -rw-r--r-- | bitbake/lib/bb/COW.py | 119 | ||||
| -rw-r--r-- | bitbake/lib/bb/cooker.py | 33 | ||||
| -rw-r--r-- | bitbake/lib/bb/event.py | 4 | ||||
| -rw-r--r-- | bitbake/lib/bb/fetch/__init__.py | 2 | ||||
| -rw-r--r-- | bitbake/lib/bb/fetch/git.py | 2 | ||||
| -rw-r--r-- | bitbake/lib/bb/fetch/ssh.py | 2 | ||||
| -rw-r--r-- | bitbake/lib/bb/msg.py | 12 | ||||
| -rw-r--r-- | bitbake/lib/bb/runqueue.py | 4 | ||||
| -rw-r--r-- | bitbake/lib/bb/server/xmlrpc.py | 4 | ||||
| -rw-r--r-- | bitbake/lib/bb/shell.py | 146 | ||||
| -rw-r--r-- | bitbake/lib/bb/ui/crumbs/buildmanager.py | 4 | ||||
| -rw-r--r-- | bitbake/lib/bb/ui/depexp.py | 18 | ||||
| -rw-r--r-- | bitbake/lib/bb/ui/goggle.py | 6 | ||||
| -rw-r--r-- | bitbake/lib/bb/ui/knotty.py | 44 | ||||
| -rw-r--r-- | bitbake/lib/bb/ui/ncurses.py | 6 | ||||
| -rw-r--r-- | bitbake/lib/bb/ui/puccho.py | 10 | ||||
| -rw-r--r-- | bitbake/lib/bb/utils.py | 22 |
17 files changed, 220 insertions, 218 deletions
diff --git a/bitbake/lib/bb/COW.py b/bitbake/lib/bb/COW.py index 224213db5c..b0afb5fa08 100644 --- a/bitbake/lib/bb/COW.py +++ b/bitbake/lib/bb/COW.py @@ -23,6 +23,7 @@ # Assign a file to __warn__ to get warnings about slow operations. # +from __future__ import print_function import copy import types types.ImmutableTypes = tuple([ \ @@ -77,7 +78,7 @@ class COWDictMeta(COWMeta): return value if not cls.__warn__ is False and not isinstance(value, COWMeta): - print >> cls.__warn__, "Warning: Doing a copy because %s is a mutable type." % key + print("Warning: Doing a copy because %s is a mutable type." % key, file=cls.__warn__) try: value = value.copy() except AttributeError, e: @@ -153,11 +154,11 @@ class COWDictMeta(COWMeta): return cls.iter("keys") def itervalues(cls, readonly=False): if not cls.__warn__ is False and cls.__hasmutable__ and readonly is False: - print >> cls.__warn__, "Warning: If you arn't going to change any of the values call with True." + print("Warning: If you arn't going to change any of the values call with True.", file=cls.__warn__) return cls.iter("values", readonly) def iteritems(cls, readonly=False): if not cls.__warn__ is False and cls.__hasmutable__ and readonly is False: - print >> cls.__warn__, "Warning: If you arn't going to change any of the values call with True." + print("Warning: If you arn't going to change any of the values call with True.", file=cls.__warn__) return cls.iter("items", readonly) class COWSetMeta(COWDictMeta): @@ -199,120 +200,120 @@ if __name__ == "__main__": import sys COWDictBase.__warn__ = sys.stderr a = COWDictBase() - print "a", a + print("a", a) a['a'] = 'a' a['b'] = 'b' a['dict'] = {} b = a.copy() - print "b", b + print("b", b) b['c'] = 'b' - print + print() - print "a", a + print("a", a) for x in a.iteritems(): - print x - print "--" - print "b", b + print(x) + print("--") + print("b", b) for x in b.iteritems(): - print x - print + print(x) + print() b['dict']['a'] = 'b' b['a'] = 'c' - print "a", a + print("a", a) for x in a.iteritems(): - print x - print "--" - print "b", b + print(x) + print("--") + print("b", b) for x in b.iteritems(): - print x - print + print(x) + print() try: b['dict2'] except KeyError, e: - print "Okay!" + print("Okay!") a['set'] = COWSetBase() a['set'].add("o1") a['set'].add("o1") a['set'].add("o2") - print "a", a + print("a", a) for x in a['set'].itervalues(): - print x - print "--" - print "b", b + print(x) + print("--") + print("b", b) for x in b['set'].itervalues(): - print x - print + print(x) + print() b['set'].add('o3') - print "a", a + print("a", a) for x in a['set'].itervalues(): - print x - print "--" - print "b", b + print(x) + print("--") + print("b", b) for x in b['set'].itervalues(): - print x - print + print(x) + print() a['set2'] = set() a['set2'].add("o1") a['set2'].add("o1") a['set2'].add("o2") - print "a", a + print("a", a) for x in a.iteritems(): - print x - print "--" - print "b", b + print(x) + print("--") + print("b", b) for x in b.iteritems(readonly=True): - print x - print + print(x) + print() del b['b'] try: - print b['b'] + print(b['b']) except KeyError: - print "Yay! deleted key raises error" + print("Yay! deleted key raises error") if b.has_key('b'): - print "Boo!" + print("Boo!") else: - print "Yay - has_key with delete works!" + print("Yay - has_key with delete works!") - print "a", a + print("a", a) for x in a.iteritems(): - print x - print "--" - print "b", b + print(x) + print("--") + print("b", b) for x in b.iteritems(readonly=True): - print x - print + print(x) + print() b.__revertitem__('b') - print "a", a + print("a", a) for x in a.iteritems(): - print x - print "--" - print "b", b + print(x) + print("--") + print("b", b) for x in b.iteritems(readonly=True): - print x - print + print(x) + print() b.__revertitem__('dict') - print "a", a + print("a", a) for x in a.iteritems(): - print x - print "--" - print "b", b + print(x) + print("--") + print("b", b) for x in b.iteritems(readonly=True): - print x - print + print(x) + print() diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 6090efcad9..eaee797cb5 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py @@ -22,6 +22,7 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +from __future__ import print_function import sys, os, glob, os.path, re, time import bb from bb import utils, data, parse, event, cache, providers, taskdata, command, runqueue @@ -396,51 +397,51 @@ class BBCooker: # Prints a flattened form of package-depends below where subpackages of a package are merged into the main pn depends_file = file('pn-depends.dot', 'w' ) - print >> depends_file, "digraph depends {" + print("digraph depends {", file=depends_file) for pn in depgraph["pn"]: fn = depgraph["pn"][pn]["filename"] version = depgraph["pn"][pn]["version"] - print >> depends_file, '"%s" [label="%s %s\\n%s"]' % (pn, pn, version, fn) + print('"%s" [label="%s %s\\n%s"]' % (pn, pn, version, fn), file=depends_file) for pn in depgraph["depends"]: for depend in depgraph["depends"][pn]: - print >> depends_file, '"%s" -> "%s"' % (pn, depend) + print('"%s" -> "%s"' % (pn, depend), file=depends_file) for pn in depgraph["rdepends-pn"]: for rdepend in depgraph["rdepends-pn"][pn]: - print >> depends_file, '"%s" -> "%s" [style=dashed]' % (pn, rdepend) - print >> depends_file, "}" + print('"%s" -> "%s" [style=dashed]' % (pn, rdepend), file=depends_file) + print("}", file=depends_file) bb.msg.plain("PN dependencies saved to 'pn-depends.dot'") depends_file = file('package-depends.dot', 'w' ) - print >> depends_file, "digraph depends {" + print("digraph depends {", file=depends_file) for package in depgraph["packages"]: pn = depgraph["packages"][package]["pn"] fn = depgraph["packages"][package]["filename"] version = depgraph["packages"][package]["version"] if package == pn: - print >> depends_file, '"%s" [label="%s %s\\n%s"]' % (pn, pn, version, fn) + print('"%s" [label="%s %s\\n%s"]' % (pn, pn, version, fn), file=depends_file) else: - print >> depends_file, '"%s" [label="%s(%s) %s\\n%s"]' % (package, package, pn, version, fn) + print('"%s" [label="%s(%s) %s\\n%s"]' % (package, package, pn, version, fn), file=depends_file) for depend in depgraph["depends"][pn]: - print >> depends_file, '"%s" -> "%s"' % (package, depend) + print('"%s" -> "%s"' % (package, depend), file=depends_file) for package in depgraph["rdepends-pkg"]: for rdepend in depgraph["rdepends-pkg"][package]: - print >> depends_file, '"%s" -> "%s" [style=dashed]' % (package, rdepend) + print('"%s" -> "%s" [style=dashed]' % (package, rdepend), file=depends_file) for package in depgraph["rrecs-pkg"]: for rdepend in depgraph["rrecs-pkg"][package]: - print >> depends_file, '"%s" -> "%s" [style=dashed]' % (package, rdepend) - print >> depends_file, "}" + print('"%s" -> "%s" [style=dashed]' % (package, rdepend), file=depends_file) + print("}", file=depends_file) bb.msg.plain("Package dependencies saved to 'package-depends.dot'") tdepends_file = file('task-depends.dot', 'w' ) - print >> tdepends_file, "digraph depends {" + print("digraph depends {", file=tdepends_file) for task in depgraph["tdepends"]: (pn, taskname) = task.rsplit(".", 1) fn = depgraph["pn"][pn]["filename"] version = depgraph["pn"][pn]["version"] - print >> tdepends_file, '"%s.%s" [label="%s %s\\n%s\\n%s"]' % (pn, taskname, pn, taskname, version, fn) + print('"%s.%s" [label="%s %s\\n%s\\n%s"]' % (pn, taskname, pn, taskname, version, fn), file=tdepends_file) for dep in depgraph["tdepends"][task]: - print >> tdepends_file, '"%s" -> "%s"' % (task, dep) - print >> tdepends_file, "}" + print('"%s" -> "%s"' % (task, dep), file=tdepends_file) + print("}", file=tdepends_file) bb.msg.plain("Task dependencies saved to 'task-depends.dot'") def buildDepgraph( self ): diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py index f0690b4f2b..c0a8db15aa 100644 --- a/bitbake/lib/bb/event.py +++ b/bitbake/lib/bb/event.py @@ -104,13 +104,13 @@ def worker_fire(event, d): data = "<event>" + pickle.dumps(event) + "</event>" try: if os.write(worker_pipe, data) != len (data): - print "Error sending event to server (short write)" + print("Error sending event to server (short write)") except OSError: sys.exit(1) def fire_from_worker(event, d): if not event.startswith("<event>") or not event.endswith("</event>"): - print "Error, not an event" + print("Error, not an event") return event = pickle.loads(event[7:-8]) fire_ui_handlers(event, d) diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py index 09c83b0264..b4d08d6cdd 100644 --- a/bitbake/lib/bb/fetch/__init__.py +++ b/bitbake/lib/bb/fetch/__init__.py @@ -412,7 +412,7 @@ def runfetchcmd(cmd, d, quiet = False): if not line: break if not quiet: - print line, + print(line, end=' ') output += line status = stdout_handle.close() or 0 diff --git a/bitbake/lib/bb/fetch/git.py b/bitbake/lib/bb/fetch/git.py index 5332686252..8c91de9db1 100644 --- a/bitbake/lib/bb/fetch/git.py +++ b/bitbake/lib/bb/fetch/git.py @@ -197,7 +197,7 @@ class Git(Fetch): # Check if we have the rev already if not os.path.exists(ud.clonedir): - print "no repo" + print("no repo") self.go(None, ud, d) if not os.path.exists(ud.clonedir): bb.msg.error(bb.msg.domain.Fetcher, "GIT repository for %s doesn't exist in %s, cannot get sortable buildnumber, using old value" % (url, ud.clonedir)) diff --git a/bitbake/lib/bb/fetch/ssh.py b/bitbake/lib/bb/fetch/ssh.py index 68e6fdb1df..86c76f4e44 100644 --- a/bitbake/lib/bb/fetch/ssh.py +++ b/bitbake/lib/bb/fetch/ssh.py @@ -114,5 +114,5 @@ class SSH(Fetch): (exitstatus, output) = commands.getstatusoutput(cmd) if exitstatus != 0: - print output + print(output) raise FetchError('Unable to fetch %s' % url) diff --git a/bitbake/lib/bb/msg.py b/bitbake/lib/bb/msg.py index 788e1dddf7..0d90f959d3 100644 --- a/bitbake/lib/bb/msg.py +++ b/bitbake/lib/bb/msg.py @@ -110,7 +110,7 @@ def debug(level, msgdomain, msg, fn = None): if debug_level[msgdomain] >= level: bb.event.fire(MsgDebug(msg), None) if not bb.event._ui_handlers: - print 'DEBUG: ' + msg + print('DEBUG: ' + msg) def note(level, msgdomain, msg, fn = None): if not msgdomain: @@ -119,25 +119,25 @@ def note(level, msgdomain, msg, fn = None): if level == 1 or verbose or debug_level[msgdomain] >= 1: bb.event.fire(MsgNote(msg), None) if not bb.event._ui_handlers: - print 'NOTE: ' + msg + print('NOTE: ' + msg) def warn(msgdomain, msg, fn = None): bb.event.fire(MsgWarn(msg), None) if not bb.event._ui_handlers: - print 'WARNING: ' + msg + print('WARNING: ' + msg) def error(msgdomain, msg, fn = None): bb.event.fire(MsgError(msg), None) if not bb.event._ui_handlers: - print 'ERROR: ' + msg + print('ERROR: ' + msg) def fatal(msgdomain, msg, fn = None): bb.event.fire(MsgFatal(msg), None) if not bb.event._ui_handlers: - print 'FATAL: ' + msg + print('FATAL: ' + msg) sys.exit(1) def plain(msg, fn = None): bb.event.fire(MsgPlain(msg), None) if not bb.event._ui_handlers: - print msg + print(msg) diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 9881315b9d..de1160eb87 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py @@ -852,7 +852,7 @@ class RunQueue: return False if self.state is runQueueChildProcess: - print "Child process" + print("Child process") return False # Loop @@ -1194,5 +1194,5 @@ class runQueuePipe(): while self.read(): continue if len(self.queue) > 0: - print "Warning, worker left partial message" + print("Warning, worker left partial message") os.close(self.fd) diff --git a/bitbake/lib/bb/server/xmlrpc.py b/bitbake/lib/bb/server/xmlrpc.py index e1e514fc9a..3844a1e33e 100644 --- a/bitbake/lib/bb/server/xmlrpc.py +++ b/bitbake/lib/bb/server/xmlrpc.py @@ -42,7 +42,7 @@ from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler import inspect, select if sys.hexversion < 0x020600F0: - print "Sorry, python 2.6 or later is required for bitbake's XMLRPC mode" + print("Sorry, python 2.6 or later is required for bitbake's XMLRPC mode") sys.exit(1) class BitBakeServerCommands(): @@ -74,7 +74,7 @@ class BitBakeServerCommands(): Trigger the server to quit """ self.server.quit = True - print "Server (cooker) exitting" + print("Server (cooker) exitting") return def ping(self): diff --git a/bitbake/lib/bb/shell.py b/bitbake/lib/bb/shell.py index 71dd599ed6..0dcf45dd5f 100644 --- a/bitbake/lib/bb/shell.py +++ b/bitbake/lib/bb/shell.py @@ -98,7 +98,7 @@ class BitBakeShellCommands: def _checkParsed( self ): if not parsed: - print "SHELL: This command needs to parse bbfiles..." + print("SHELL: This command needs to parse bbfiles...") self.parse( None ) def _findProvider( self, item ): @@ -119,28 +119,28 @@ class BitBakeShellCommands: """Register a new name for a command""" new, old = params if not old in cmds: - print "ERROR: Command '%s' not known" % old + print("ERROR: Command '%s' not known" % old) else: cmds[new] = cmds[old] - print "OK" + print("OK") alias.usage = "<alias> <command>" def buffer( self, params ): """Dump specified output buffer""" index = params[0] - print self._shell.myout.buffer( int( index ) ) + print(self._shell.myout.buffer( int( index ) )) buffer.usage = "<index>" def buffers( self, params ): """Show the available output buffers""" commands = self._shell.myout.bufferedCommands() if not commands: - print "SHELL: No buffered commands available yet. Start doing something." + print("SHELL: No buffered commands available yet. Start doing something.") else: - print "="*35, "Available Output Buffers", "="*27 + print("="*35, "Available Output Buffers", "="*27) for index, cmd in enumerate( commands ): - print "| %s %s" % ( str( index ).ljust( 3 ), cmd ) - print "="*88 + print("| %s %s" % ( str( index ).ljust( 3 ), cmd )) + print("="*88) def build( self, params, cmd = "build" ): """Build a providee""" @@ -149,7 +149,7 @@ class BitBakeShellCommands: self._checkParsed() names = globfilter( cooker.status.pkg_pn, globexpr ) if len( names ) == 0: names = [ globexpr ] - print "SHELL: Building %s" % ' '.join( names ) + print("SHELL: Building %s" % ' '.join( names )) td = taskdata.TaskData(cooker.configuration.abort) localdata = data.createCopy(cooker.configuration.data) @@ -174,16 +174,16 @@ class BitBakeShellCommands: rq.execute_runqueue() except Providers.NoProvider: - print "ERROR: No Provider" + print("ERROR: No Provider") last_exception = Providers.NoProvider except runqueue.TaskFailure, fnids: for fnid in fnids: - print "ERROR: '%s' failed" % td.fn_index[fnid] + print("ERROR: '%s' failed" % td.fn_index[fnid]) last_exception = runqueue.TaskFailure except build.EventException, e: - print "ERROR: Couldn't build '%s'" % names + print("ERROR: Couldn't build '%s'" % names) last_exception = e @@ -216,7 +216,7 @@ class BitBakeShellCommands: if bbfile is not None: os.system( "%s %s" % ( os.environ.get( "EDITOR", "vi" ), bbfile ) ) else: - print "ERROR: Nothing provides '%s'" % name + print("ERROR: Nothing provides '%s'" % name) edit.usage = "<providee>" def environment( self, params ): @@ -239,14 +239,14 @@ class BitBakeShellCommands: global last_exception name = params[0] bf = completeFilePath( name ) - print "SHELL: Calling '%s' on '%s'" % ( cmd, bf ) + print("SHELL: Calling '%s' on '%s'" % ( cmd, bf )) try: cooker.buildFile(bf, cmd) except parse.ParseError: - print "ERROR: Unable to open or parse '%s'" % bf + print("ERROR: Unable to open or parse '%s'" % bf) except build.EventException, e: - print "ERROR: Couldn't build '%s'" % name + print("ERROR: Couldn't build '%s'" % name) last_exception = e fileBuild.usage = "<bbfile>" @@ -270,62 +270,62 @@ class BitBakeShellCommands: def fileReparse( self, params ): """(re)Parse a bb file""" bbfile = params[0] - print "SHELL: Parsing '%s'" % bbfile + print("SHELL: Parsing '%s'" % bbfile) parse.update_mtime( bbfile ) cooker.bb_cache.cacheValidUpdate(bbfile) fromCache = cooker.bb_cache.loadData(bbfile, cooker.configuration.data, cooker.status) cooker.bb_cache.sync() if False: #fromCache: - print "SHELL: File has not been updated, not reparsing" + print("SHELL: File has not been updated, not reparsing") else: - print "SHELL: Parsed" + print("SHELL: Parsed") fileReparse.usage = "<bbfile>" def abort( self, params ): """Toggle abort task execution flag (see bitbake -k)""" cooker.configuration.abort = not cooker.configuration.abort - print "SHELL: Abort Flag is now '%s'" % repr( cooker.configuration.abort ) + print("SHELL: Abort Flag is now '%s'" % repr( cooker.configuration.abort )) def force( self, params ): """Toggle force task execution flag (see bitbake -f)""" cooker.configuration.force = not cooker.configuration.force - print "SHELL: Force Flag is now '%s'" % repr( cooker.configuration.force ) + print("SHELL: Force Flag is now '%s'" % repr( cooker.configuration.force )) def help( self, params ): """Show a comprehensive list of commands and their purpose""" - print "="*30, "Available Commands", "="*30 + print("="*30, "Available Commands", "="*30) for cmd in sorted(cmds): function, numparams, usage, helptext = cmds[cmd] - print "| %s | %s" % (usage.ljust(30), helptext) - print "="*78 + print("| %s | %s" % (usage.ljust(30), helptext)) + print("="*78) def lastError( self, params ): """Show the reason or log that was produced by the last BitBake event exception""" if last_exception is None: - print "SHELL: No Errors yet (Phew)..." + print("SHELL: No Errors yet (Phew)...") else: reason, event = last_exception.args - print "SHELL: Reason for the last error: '%s'" % reason + print("SHELL: Reason for the last error: '%s'" % reason) if ':' in reason: msg, filename = reason.split( ':' ) filename = filename.strip() - print "SHELL: Dumping log file for last error:" + print("SHELL: Dumping log file for last error:") try: - print open( filename ).read() + print(open( filename ).read()) except IOError: - print "ERROR: Couldn't open '%s'" % filename + print("ERROR: Couldn't open '%s'" % filename) def match( self, params ): """Dump all files or providers matching a glob expression""" what, globexpr = params if what == "files": self._checkParsed() - for key in globfilter( cooker.status.pkg_fn, globexpr ): print key + for key in globfilter( cooker.status.pkg_fn, globexpr ): print(key) elif what == "providers": self._checkParsed() - for key in globfilter( cooker.status.pkg_pn, globexpr ): print key + for key in globfilter( cooker.status.pkg_pn, globexpr ): print(key) else: - print "Usage: match %s" % self.print_.usage + print("Usage: match %s" % self.print_.usage) match.usage = "<files|providers> <glob>" def new( self, params ): @@ -335,15 +335,15 @@ class BitBakeShellCommands: fulldirname = "%s/%s" % ( packages, dirname ) if not os.path.exists( fulldirname ): - print "SHELL: Creating '%s'" % fulldirname + print("SHELL: Creating '%s'" % fulldirname) os.mkdir( fulldirname ) if os.path.exists( fulldirname ) and os.path.isdir( fulldirname ): if os.path.exists( "%s/%s" % ( fulldirname, filename ) ): - print "SHELL: ERROR: %s/%s already exists" % ( fulldirname, filename ) + print("SHELL: ERROR: %s/%s already exists" % ( fulldirname, filename )) return False - print "SHELL: Creating '%s/%s'" % ( fulldirname, filename ) + print("SHELL: Creating '%s/%s'" % ( fulldirname, filename )) newpackage = open( "%s/%s" % ( fulldirname, filename ), "w" ) - print >>newpackage, """DESCRIPTION = "" + print("""DESCRIPTION = "" SECTION = "" AUTHOR = "" HOMEPAGE = "" @@ -370,7 +370,7 @@ SRC_URI = "" #do_install() { # #} -""" +""", file=newpackage) newpackage.close() os.system( "%s %s/%s" % ( os.environ.get( "EDITOR" ), fulldirname, filename ) ) new.usage = "<directory> <filename>" @@ -390,14 +390,14 @@ SRC_URI = "" def pasteLog( self, params ): """Send the last event exception error log (if there is one) to http://rafb.net/paste""" if last_exception is None: - print "SHELL: No Errors yet (Phew)..." + print("SHELL: No Errors yet (Phew)...") else: reason, event = last_exception.args - print "SHELL: Reason for the last error: '%s'" % reason + print("SHELL: Reason for the last error: '%s'" % reason) if ':' in reason: msg, filename = reason.split( ':' ) filename = filename.strip() - print "SHELL: Pasting log file to pastebin..." + print("SHELL: Pasting log file to pastebin...") file = open( filename ).read() sendToPastebin( "contents of " + filename, file ) @@ -419,23 +419,23 @@ SRC_URI = "" cooker.buildDepgraph() global parsed parsed = True - print + print() def reparse( self, params ): """(re)Parse a providee's bb file""" bbfile = self._findProvider( params[0] ) if bbfile is not None: - print "SHELL: Found bbfile '%s' for '%s'" % ( bbfile, params[0] ) + print("SHELL: Found bbfile '%s' for '%s'" % ( bbfile, params[0] )) self.fileReparse( [ bbfile ] ) else: - print "ERROR: Nothing provides '%s'" % params[0] + print("ERROR: Nothing provides '%s'" % params[0]) reparse.usage = "<providee>" def getvar( self, params ): """Dump the contents of an outer BitBake environment variable""" var = params[0] value = data.getVar( var, cooker.configuration.data, 1 ) - print value + print(value) getvar.usage = "<variable>" def peek( self, params ): @@ -445,9 +445,9 @@ SRC_URI = "" if bbfile is not None: the_data = cooker.bb_cache.loadDataFull(bbfile, cooker.configuration.data) value = the_data.getVar( var, 1 ) - print value + print(value) else: - print "ERROR: Nothing provides '%s'" % name + print("ERROR: Nothing provides '%s'" % name) peek.usage = "<providee> <variable>" def poke( self, params ): @@ -455,7 +455,7 @@ SRC_URI = "" name, var, value = params bbfile = self._findProvider( name ) if bbfile is not None: - print "ERROR: Sorry, this functionality is currently broken" + print("ERROR: Sorry, this functionality is currently broken") #d = cooker.pkgdata[bbfile] #data.setVar( var, value, d ) @@ -463,7 +463,7 @@ SRC_URI = "" #cooker.pkgdata.setDirty(bbfile, d) #print "OK" else: - print "ERROR: Nothing provides '%s'" % name + print("ERROR: Nothing provides '%s'" % name) poke.usage = "<providee> <variable> <value>" def print_( self, params ): @@ -471,12 +471,12 @@ SRC_URI = "" what = params[0] if what == "files": self._checkParsed() - for key in cooker.status.pkg_fn: print key + for key in cooker.status.pkg_fn: print(key) elif what == "providers": self._checkParsed() - for key in cooker.status.providers: print key + for key in cooker.status.providers: print(key) else: - print "Usage: print %s" % self.print_.usage + print("Usage: print %s" % self.print_.usage) print_.usage = "<files|providers>" def python( self, params ): @@ -496,7 +496,7 @@ SRC_URI = "" """Set an outer BitBake environment variable""" var, value = params data.setVar( var, value, cooker.configuration.data ) - print "OK" + print("OK") setVar.usage = "<variable> <value>" def rebuild( self, params ): @@ -508,7 +508,7 @@ SRC_URI = "" def shell( self, params ): """Execute a shell command and dump the output""" if params != "": - print commands.getoutput( " ".join( params ) ) + print(commands.getoutput( " ".join( params ) )) shell.usage = "<...>" def stage( self, params ): @@ -518,17 +518,17 @@ SRC_URI = "" def status( self, params ): """<just for testing>""" - print "-" * 78 - print "building list = '%s'" % cooker.building_list - print "build path = '%s'" % cooker.build_path - print "consider_msgs_cache = '%s'" % cooker.consider_msgs_cache - print "build stats = '%s'" % cooker.stats - if last_exception is not None: print "last_exception = '%s'" % repr( last_exception.args ) - print "memory output contents = '%s'" % self._shell.myout._buffer + print("-" * 78) + print("building list = '%s'" % cooker.building_list) + print("build path = '%s'" % cooker.build_path) + print("consider_msgs_cache = '%s'" % cooker.consider_msgs_cache) + print("build stats = '%s'" % cooker.stats) + if last_exception is not None: print("last_exception = '%s'" % repr( last_exception.args )) + print("memory output contents = '%s'" % self._shell.myout._buffer) def test( self, params ): """<just for testing>""" - print "testCommand called with '%s'" % params + print("testCommand called with '%s'" % params) def unpack( self, params ): """Execute 'unpack' on a providee""" @@ -553,12 +553,12 @@ SRC_URI = "" try: providers = cooker.status.providers[item] except KeyError: - print "SHELL: ERROR: Nothing provides", preferred + print("SHELL: ERROR: Nothing provides", preferred) else: for provider in providers: if provider == pf: provider = " (***) %s" % provider else: provider = " %s" % provider - print provider + print(provider) which.usage = "<providee>" ########################################################################## @@ -594,9 +594,9 @@ def sendToPastebin( desc, content ): if response.status == 302: location = response.getheader( "location" ) or "unknown" - print "SHELL: Pasted to http://%s%s" % ( host, location ) + print("SHELL: Pasted to http://%s%s" % ( |
