avocado.core.output: View() -> change list_mode to use_paginator

Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
上级 8f8d668b
......@@ -318,8 +318,18 @@ class View(object):
term_support.MOVE_BACK + THROBBER_STEPS[2],
term_support.MOVE_BACK + THROBBER_STEPS[3]]
def __init__(self, console_logger='avocado.app', list_mode=False):
self.list_mode = list_mode
def __init__(self, console_logger='avocado.app', use_paginator=False):
"""
Set up the console logger and the paginator mode.
:param console_logger: logging.Logger identifier for the main app logger.
:type console_logger: str
:param use_paginator: Whether to use paginator mode. Set it to True if
the program is supposed to output a large list of
lines to the user and you want the user to be able
to scroll through them at will (think git log).
"""
self.use_paginator = use_paginator
self.console_log = logging.getLogger(console_logger)
self.paginator = get_paginator()
self.throbber_pos = 0
......@@ -332,7 +342,7 @@ class View(object):
:type msg: string
"""
extra = {'skip_newline': skip_newline}
if self.list_mode:
if self.use_paginator:
if not skip_newline:
msg += '\n'
self.paginator.write(msg)
......
......@@ -53,7 +53,7 @@ class TestLister(plugin.Plugin):
:param args: Command line args received from the list subparser.
"""
view = output.View(list_mode=True)
view = output.View(use_paginator=True)
base_test_dir = data_dir.get_test_dir()
test_files = os.listdir(base_test_dir)
test_dirs = []
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册