From 87fad95d4bb3e8e9e907e38f033fb13061db0665 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 30 Aug 2011 13:24:16 +0530 Subject: [PATCH] added as_table option to msgprint --- cgi-bin/webnotes/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cgi-bin/webnotes/__init__.py b/cgi-bin/webnotes/__init__.py index 551a719af8..2dcc8e4748 100644 --- a/cgi-bin/webnotes/__init__.py +++ b/cgi-bin/webnotes/__init__.py @@ -94,10 +94,13 @@ def errprint(msg): """ debug_log.append(cstr(msg or '')) -def msgprint(msg, small=0, raise_exception=0): +def msgprint(msg, small=0, raise_exception=0, as_table=False): """ Append to the :data:`message_log` """ + if as_table and type(msg) in (list, tuple): + msg = '' + ''.join([''+''.join(['' % c for c in r])+'' for r in msg]) + '
%s
' + message_log.append((small and '__small:' or '')+cstr(msg or '')) if raise_exception: raise ValidationError