diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-20 11:57:44 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-06-02 08:24:01 +0100 |
commit | 3b3997174831931ea472167ba6cc854a4972ccce (patch) | |
tree | 861b0bcb54e70fbe59bf7920862954dcec40a1e8 /meta/lib/oe/terminal.py | |
parent | 52c4b7f247618f185a11dfb1cf15d0490d074379 (diff) | |
download | poky-3b3997174831931ea472167ba6cc854a4972ccce.tar.gz |
classes/lib: Complete transition to python3
This patch contains all the other misc pieces of the transition to
python3 which didn't make sense to be broken into individual patches.
(From OE-Core rev: fcd6b38bab8517d83e1ed48eef1bca9a9a190f57)
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] |