Revision: 4001
Author: pekka.klarck
Date: Tue Aug 31 02:27:07 2010
Log: Cleanup. This and prev commit changed some messages slightly which will break the build.
http://code.google.com/p/robotframework/source/detail?r=4001

Modified:
 /trunk/src/robot/output/logger.py
 /trunk/src/robot/variables/variables.py

=======================================
--- /trunk/src/robot/output/logger.py   Mon Aug 30 05:53:20 2010
+++ /trunk/src/robot/output/logger.py   Tue Aug 31 02:27:07 2010
@@ -17,7 +17,7 @@

 from robot import utils

-from loggerhelper import AbstractLogger, AbstractLoggerProxy
+from loggerhelper import AbstractLogger, AbstractLoggerProxy, Message
 from filelogger import FileLogger
 from monitor import CommandLineMonitor

@@ -103,6 +103,10 @@
             msg.linkable = True
             self.message(msg)

+    def warn(self, msg, log=False):
+        method = self.log_message if log else self.message
+        method(Message(msg, 'WARN'))
+
     def output_file(self, name, path):
"""Finished output, report, log, summary or debug file (incl. split)"""
         for logger in self._loggers:
=======================================
--- /trunk/src/robot/variables/variables.py     Mon Aug 30 06:46:18 2010
+++ /trunk/src/robot/variables/variables.py     Tue Aug 31 02:27:07 2010
@@ -22,7 +22,7 @@

 from robot import utils
 from robot.errors import DataError
-from robot.output import LOGGER, Message
+from robot.output import LOGGER

 from isvar import is_var, is_scalar_var

@@ -61,12 +61,8 @@
         if path:
             msg += " in file '%s'" % path
         msg += " before Robot Framework 2.6."
-        # If path is not known we are executing keywords and can use
-        # log_message which will create also links.
-        if not path:
-            LOGGER.log_message(Message(msg, 'WARN'))
-        else:
-            LOGGER.warn(msg)
+ # If path is not known we are executing keywords and can log message
+        LOGGER.warn(msg, log=not path)

     def __getitem__(self, name):
         if not is_var(name):
@@ -282,14 +278,13 @@
     def _get_var_table_scalar_value(self, name, value, path=None):
         if len(value) == 1:
             return self.replace_scalar(value[0])
-        msg = ("Creating scalar variable with more than one value is "
-               "deprecated and this functionality will be removed in "
+ msg = ("Creating a scalar variable with a list value in the Variable " + "table is deprecated and this functionality will be removed in "
                "Robot Framework 2.6. Create a list variable '@%s' and use "
                "it as a scalar variable '%s' instead" % (name[1:], name))
         if path:
             msg += " in file '%s'" % path
-        msg += '.'
-        LOGGER.warn(msg)
+        LOGGER.warn(msg + '.')
         return self.replace_list(value)

     def _get_variables_from_module(self, module, args):

Reply via email to