Revision: e470302e8a8b
Author:   Pekka Klärck
Date:     Thu Feb 16 05:37:32 2012
Log:      Added Application.console method and changed LibDoc to use it.
http://code.google.com/p/robotframework/source/detail?r=e470302e8a8b

Modified:
 /src/robot/libdoc.py
 /src/robot/utils/application.py

=======================================
--- /src/robot/libdoc.py        Thu Feb 16 05:23:27 2012
+++ /src/robot/libdoc.py        Thu Feb 16 05:37:32 2012
@@ -84,7 +84,7 @@
         lib_or_res, outfile = args
         libdoc = LibraryDocumentation(lib_or_res, argument, name, version)
         libdoc.save(outfile, self._get_format(format, outfile))
-        print os.path.abspath(outfile)
+        self.console(os.path.abspath(outfile))

     def _get_format(self, format, output):
         return format if format else os.path.splitext(output)[1][1:]
=======================================
--- /src/robot/utils/application.py     Mon Feb 13 01:49:59 2012
+++ /src/robot/utils/application.py     Thu Feb 16 05:37:32 2012
@@ -44,6 +44,9 @@
             rc = self._execute(arguments, options)
         self._exit(rc)

+    def console(self, msg):
+        print encode_output(msg)
+
     @contextmanager
     def _logging(self):
         self._logger.register_file_logger()
@@ -83,8 +86,8 @@
         else:
             return rc or 0

-    def _report_info(self, msg):
-        print encode_output(unicode(msg))
+    def _report_info(self, err):
+        self.console(unicode(err))
         self._exit(INFO_PRINTED)

def _report_error(self, message, details=None, help=False, rc=DATA_ERROR,

Reply via email to