Patchwork [bitbake-devel,5/6] knotty.py: Add the ability to spawn screen directly from knotty with OE_TERMINAL=screen_inline

login
register
mail settings
Submitter Jason Wessel
Date May 31, 2012, 5:14 a.m.
Message ID <1338441241-32230-6-git-send-email-jason.wessel@windriver.com>
Download mbox | patch
Permalink /patch/28987/
State New
Headers show

Comments

Jason Wessel - May 31, 2012, 5:14 a.m.
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 <jason.wessel@windriver.com>
---
 lib/bb/ui/knotty.py |   11 +++++++++++
 1 file changed, 11 insertions(+)

Patch

diff --git a/lib/bb/ui/knotty.py b/lib/bb/ui/knotty.py
index 7a7a1b2..6eca0b5 100644
--- a/lib/bb/ui/knotty.py
+++ b/lib/bb/ui/knotty.py
@@ -174,6 +174,11 @@  def main(server, eventHandler, tf = TerminalFilter):
     includelogs = server.runCommand(["getVariable", "BBINCLUDELOGS"])
     loglines = server.runCommand(["getVariable", "BBINCLUDELOGS_LINES"])
     consolelogfile = server.runCommand(["getVariable", "BB_CONSOLELOG"])
+    oeterminal = server.runCommand(["getVariable", "OE_TERMINAL"])
+    if oeterminal == "screen_inline" and sys.stdin.isatty() and sys.stdout.isatty():
+        runscreen = True
+    else:
+        runscreen = False
 
     # MultiTail affected varialbles
     numthreads = server.runCommand(["getVariable", "BB_NUMBER_THREADS"])
@@ -260,6 +265,12 @@  def main(server, eventHandler, tf = TerminalFilter):
                     errors = errors + 1
                     return_value = 1
                 elif event.levelno == format.WARNING:
+                    msg = event.getMessage()
+                    if runscreen 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