From 8b9cb2b4cf6a6e370e744fb947c40aecffb27d1b Mon Sep 17 00:00:00 2001 From: Lucas Meneghel Rodrigues Date: Thu, 2 Apr 2015 21:46:27 -0300 Subject: [PATCH] avocado.core.output: Add skip_newline to output.View.notify We need the flexibility to implement plugins that need to display setup operations. Signed-off-by: Lucas Meneghel Rodrigues --- avocado/core/output.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/avocado/core/output.py b/avocado/core/output.py index 627663fa..616c0242 100644 --- a/avocado/core/output.py +++ b/avocado/core/output.py @@ -403,14 +403,14 @@ class View(object): if self.use_paginator: self.paginator.close() - def notify(self, event='message', msg=None): + def notify(self, event='message', msg=None, skip_newline=False): mapping = {'message': self._log_ui_header, 'minor': self._log_ui_minor, 'error': self._log_ui_error, 'warning': self._log_ui_warning, 'partial': self._log_ui_partial} if msg is not None: - mapping[event](msg) + mapping[event](msg=msg, skip_newline=skip_newline) def notify_progress(self, progress): self._log_ui_throbber_progress(progress) @@ -491,37 +491,37 @@ class View(object): """ self._log_ui_info(term_support.partial_str(msg), skip_newline) - def _log_ui_header(self, msg): + def _log_ui_header(self, msg, skip_newline=False): """ Log a header message. :param msg: Message to write. """ - self._log_ui_info(term_support.header_str(msg)) + self._log_ui_info(term_support.header_str(msg), skip_newline) - def _log_ui_minor(self, msg): + def _log_ui_minor(self, msg, skip_newline=False): """ Log a minor message. :param msg: Message to write. """ - self._log_ui_info(msg) + self._log_ui_info(msg, skip_newline) - def _log_ui_error(self, msg): + def _log_ui_error(self, msg, skip_newline=False): """ Log an error message (useful for critical errors). :param msg: Message to write. """ - self._log_ui_error_base(term_support.fail_header_str(msg)) + self._log_ui_error_base(term_support.fail_header_str(msg), skip_newline) - def _log_ui_warning(self, msg): + def _log_ui_warning(self, msg, skip_newline=False): """ Log a warning message (useful for warning messages). :param msg: Message to write. """ - self._log_ui_info(term_support.warn_header_str(msg)) + self._log_ui_info(term_support.warn_header_str(msg), skip_newline) def _log_ui_status_pass(self, t_elapsed): """ -- GitLab