From 933e4dbb5048ea84c32f2313e6c8e5ca7895fe48 Mon Sep 17 00:00:00 2001 From: Alexandru DAMIAN Date: Mon, 22 Jun 2015 14:54:08 +0100 Subject: bitbake: toastergui: enable strict variable checking In order to make sure we don't use undefined variables in the templates, we enforce strict variable checking in the templating engine. (Bitbake rev: 3928dc93188880386588fe3f440cd0aaa83d22de) Signed-off-by: Alexandru DAMIAN Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastermain/settings.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'bitbake/lib/toaster/toastermain/settings.py') diff --git a/bitbake/lib/toaster/toastermain/settings.py b/bitbake/lib/toaster/toastermain/settings.py index 3c7cb3bc4d..141ad08877 100644 --- a/bitbake/lib/toaster/toastermain/settings.py +++ b/bitbake/lib/toaster/toastermain/settings.py @@ -386,3 +386,10 @@ connection_created.connect(activate_synchronous_off) # +class InvalidString(str): + def __mod__(self, other): + from django.template.base import TemplateSyntaxError + raise TemplateSyntaxError( + "Undefined variable or unknown value for: \"%s\"" % other) + +TEMPLATE_STRING_IF_INVALID = InvalidString("%s") -- cgit v1.2.3-54-g00ecf