mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-22 04:49:00 +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:
parent
73f889b45b
commit
544f5f0b92
@ -18,11 +18,11 @@ import sys
|
|||||||
import subprocess
|
import subprocess
|
||||||
from cStringIO import StringIO
|
from cStringIO import StringIO
|
||||||
|
|
||||||
from terminalsize import get_terminal_size # pylint: disable=import-error
|
|
||||||
from wlauto import Command, ExtensionLoader, settings
|
from wlauto import Command, ExtensionLoader, settings
|
||||||
from wlauto.utils.doc import (get_summary, get_description, get_type_name, format_column, format_body,
|
from wlauto.utils.doc import (get_summary, get_description, get_type_name, format_column, format_body,
|
||||||
format_paragraph, indent, strip_inlined_text)
|
format_paragraph, indent, strip_inlined_text)
|
||||||
from wlauto.utils.misc import get_pager
|
from wlauto.utils.misc import get_pager
|
||||||
|
from wlauto.utils.terminalsize import get_terminal_size
|
||||||
|
|
||||||
|
|
||||||
class ShowCommand(Command):
|
class ShowCommand(Command):
|
||||||
@ -39,6 +39,7 @@ class ShowCommand(Command):
|
|||||||
be shown.''')
|
be shown.''')
|
||||||
|
|
||||||
def execute(self, args):
|
def execute(self, args):
|
||||||
|
# pylint: disable=unpacking-non-sequence
|
||||||
ext_loader = ExtensionLoader(packages=settings.extension_packages, paths=settings.extension_paths)
|
ext_loader = ExtensionLoader(packages=settings.extension_packages, paths=settings.extension_paths)
|
||||||
extension = ext_loader.get_extension_class(args.name)
|
extension = ext_loader.get_extension_class(args.name)
|
||||||
out = StringIO()
|
out = StringIO()
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
# Taken from
|
# Adapted from
|
||||||
# https://gist.github.com/jtriley/1108174
|
# https://gist.github.com/jtriley/1108174
|
||||||
|
# pylint: disable=bare-except,unpacking-non-sequence
|
||||||
import os
|
import os
|
||||||
import shlex
|
import shlex
|
||||||
import struct
|
import struct
|
||||||
@ -30,6 +31,7 @@ def get_terminal_size():
|
|||||||
|
|
||||||
|
|
||||||
def _get_terminal_size_windows():
|
def _get_terminal_size_windows():
|
||||||
|
# pylint: disable=unused-variable,redefined-outer-name,too-many-locals
|
||||||
try:
|
try:
|
||||||
from ctypes import windll, create_string_buffer
|
from ctypes import windll, create_string_buffer
|
||||||
# stdin handle is -10
|
# stdin handle is -10
|
||||||
@ -88,5 +90,5 @@ def _get_terminal_size_linux():
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
sizex, sizey = get_terminal_size()
|
sizex, sizey = get_terminal_size()
|
||||||
print 'width =', sizex, 'height =', sizey
|
print 'width =', sizex, 'height =', sizey
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user