diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-05-09 16:31:22 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-16 23:32:39 +0100 |
commit | 1fc840ffc0267ecf3a15c4a59ab44869ef1d6339 (patch) | |
tree | b2932a0d0d7146bde799db47497236063050fc84 /meta/lib/oe/terminal.py | |
parent | 22c8ed6484e0ee9328e3844c9e794f3d89ebb9f7 (diff) | |
download | poky-1fc840ffc0267ecf3a15c4a59ab44869ef1d6339.tar.gz |
meta: python3 megapatch
This needs splutting into smaller units, WIP atm.
(From OE-Core rev: 21529228a7dca96a6a1b44ed9380c523efdeeb3e)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/terminal.py')
-rw-r--r-- | meta/lib/oe/terminal.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py index 634daa9033..dc25d14ff6 100644 --- a/meta/lib/oe/terminal.py +++ b/meta/lib/oe/terminal.py | |||
@@ -25,9 +25,7 @@ class Registry(oe.classutils.ClassRegistry): | |||
25 | return bool(cls.command) | 25 | return bool(cls.command) |
26 | 26 | ||
27 | 27 | ||
28 | class Terminal(Popen): | 28 | class Terminal(Popen, metaclass=Registry): |
29 | __metaclass__ = Registry | ||
30 | |||
31 | def __init__(self, sh_cmd, title=None, env=None, d=None): | 29 | def __init__(self, sh_cmd, title=None, env=None, d=None): |
32 | fmt_sh_cmd = self.format_command(sh_cmd, title) | 30 | fmt_sh_cmd = self.format_command(sh_cmd, title) |
33 | try: | 31 | try: |
@@ -41,7 +39,7 @@ class Terminal(Popen): | |||
41 | 39 | ||
42 | def format_command(self, sh_cmd, title): | 40 | def format_command(self, sh_cmd, title): |
43 | fmt = {'title': title or 'Terminal', 'command': sh_cmd} | 41 | fmt = {'title': title or 'Terminal', 'command': sh_cmd} |
44 | if isinstance(self.command, basestring): | 42 | if isinstance(self.command, str): |
45 | return shlex.split(self.command.format(**fmt)) | 43 | return shlex.split(self.command.format(**fmt)) |
46 | else: | 44 | else: |
47 | return [element.format(**fmt) for element in self.command] | 45 | return [element.format(**fmt) for element in self.command] |