1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-21 20:38:57 +00:00

Fixing terminalsize import error.

terminalsize was loaded from a location added to sys.path during
bootstrap. This appeared to be causing import issues. There is no longer
a good reason for terminalsize to be loaded that way, so just moved it
under wlauto.utils so that it can be loaded normally.
This commit is contained in:
Sergei Trofimov 2015-04-09 08:32:02 +01:00
parent 73f889b45b
commit 544f5f0b92
2 changed files with 6 additions and 3 deletions

View File

@ -18,11 +18,11 @@ import sys
import subprocess
from cStringIO import StringIO
from terminalsize import get_terminal_size # pylint: disable=import-error
from wlauto import Command, ExtensionLoader, settings
from wlauto.utils.doc import (get_summary, get_description, get_type_name, format_column, format_body,
format_paragraph, indent, strip_inlined_text)
from wlauto.utils.misc import get_pager
from wlauto.utils.terminalsize import get_terminal_size
class ShowCommand(Command):
@ -39,6 +39,7 @@ class ShowCommand(Command):
be shown.''')
def execute(self, args):
# pylint: disable=unpacking-non-sequence
ext_loader = ExtensionLoader(packages=settings.extension_packages, paths=settings.extension_paths)
extension = ext_loader.get_extension_class(args.name)
out = StringIO()

View File

@ -1,5 +1,6 @@
# Taken from
# Adapted from
# https://gist.github.com/jtriley/1108174
# pylint: disable=bare-except,unpacking-non-sequence
import os
import shlex
import struct
@ -30,6 +31,7 @@ def get_terminal_size():
def _get_terminal_size_windows():
# pylint: disable=unused-variable,redefined-outer-name,too-many-locals
try:
from ctypes import windll, create_string_buffer
# stdin handle is -10