summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/terminal.py
diff options
context:
space:
mode:
authorMorten Minde Neergaard <mneergaa@cisco.com>2012-10-19 12:37:07 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-10-24 12:50:46 +0100
commitc45a7d127e76a43069f12483b7453a3778ae0126 (patch)
tree1539f43e6b76e0052ace73882ffdcc9f125b6660 /meta/lib/oe/terminal.py
parent6309eea2a8fa97ec46a5d1583d72a6a9ba02754e (diff)
downloadpoky-c45a7d127e76a43069f12483b7453a3778ae0126.tar.gz
terminal: Add support for running custom terminals.
Example config: OE_TERMINAL = "custom" OE_TERMINAL_CUSTOMCMD = "mysuperterm" (From OE-Core rev: c76da87511d2668479745c2f18b8a9b8116c7489) Signed-off-by: Morten Minde Neergaard <mneergaa@cisco.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/terminal.py')
-rw-r--r--meta/lib/oe/terminal.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py
index 71d8a43410..4c1e318c7c 100644
--- a/meta/lib/oe/terminal.py
+++ b/meta/lib/oe/terminal.py
@@ -47,7 +47,7 @@ class Terminal(Popen):
47 47
48class XTerminal(Terminal): 48class XTerminal(Terminal):
49 def __init__(self, sh_cmd, title=None, env=None, d=None): 49 def __init__(self, sh_cmd, title=None, env=None, d=None):
50 Terminal.__init__(self, sh_cmd, title, env) 50 Terminal.__init__(self, sh_cmd, title, env, d)
51 if not os.environ.get('DISPLAY'): 51 if not os.environ.get('DISPLAY'):
52 raise UnsupportedTerminal(self.name) 52 raise UnsupportedTerminal(self.name)
53 53
@@ -105,6 +105,21 @@ class Screen(Terminal):
105 else: 105 else:
106 logger.warn(msg) 106 logger.warn(msg)
107 107
108class Custom(Terminal):
109 command = 'false' # This is a placeholder
110 priority = 3
111
112 def __init__(self, sh_cmd, title=None, env=None, d=None):
113 self.command = d and d.getVar('OE_TERMINAL_CUSTOMCMD', True)
114 if self.command:
115 if not '{command}' in self.command:
116 self.command += ' {command}'
117 Terminal.__init__(self, sh_cmd, title, env, d)
118 logger.warn('Custom terminal was started.')
119 else:
120 logger.debug(1, 'No custom terminal (OE_TERMINAL_CUSTOMCMD) set')
121 raise UnsupportedTerminal('OE_TERMINAL_CUSTOMCMD not set')
122
108 123
109def prioritized(): 124def prioritized():
110 return Registry.prioritized() 125 return Registry.prioritized()