From patchwork Fri Jun 8 13:41:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [bitbake-devel, v4, 05/18] knotty.py: Add the ability to spawn screen directly from knotty with OE_TERMINAL=screen_inline Date: Fri, 08 Jun 2012 13:41:40 -0000 From: Jason Wessel X-Patchwork-Id: 29489 Message-Id: <1339162913-23759-6-git-send-email-jason.wessel@windriver.com> To: The oe-core has a change pending to add the screen_inline class. This change allows the simple use case of directly using a devshell from the controlling terminal that started bitbake which is a significant convience for some use cases. Signed-off-by: Jason Wessel --- lib/bb/ui/knotty.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/bb/ui/knotty.py b/lib/bb/ui/knotty.py index 7a7a1b2..b4125f6 100644 --- a/lib/bb/ui/knotty.py +++ b/lib/bb/ui/knotty.py @@ -174,6 +174,10 @@ def main(server, eventHandler, tf = TerminalFilter): includelogs = server.runCommand(["getVariable", "BBINCLUDELOGS"]) loglines = server.runCommand(["getVariable", "BBINCLUDELOGS_LINES"]) consolelogfile = server.runCommand(["getVariable", "BB_CONSOLELOG"]) + if sys.stdin.isatty() and sys.stdout.isatty(): + runscreen = True + else: + runscreen = False # MultiTail affected varialbles numthreads = server.runCommand(["getVariable", "BB_NUMBER_THREADS"]) @@ -260,6 +264,12 @@ def main(server, eventHandler, tf = TerminalFilter): errors = errors + 1 return_value = 1 elif event.levelno == format.WARNING: + msg = event.getMessage() + if runscreen and event.name == "BitBake.OE.Terminal" and msg.startswith("Screen Connect Command: "): + msg = msg[24:] + print "Starting terminal with: %s" % msg + os.system(msg) + continue warnings = warnings + 1 # For "normal" logging conditions, don't show note logs from tasks # but do show them if the user has changed the default log level to