# HG changeset patch # User Nicolas Chauvat # Date 1279704510 -7200 # Node ID 98ca82aae3a1656590163f079e639c6589311e75 # Parent eaf8219f8b7d7db3b0205aa69ef2e18d46432b97 [uiprops] check that STYLESHEETS* and JAVASCRIPTS are lists diff -r eaf8219f8b7d -r 98ca82aae3a1 web/propertysheet.py --- a/web/propertysheet.py Tue Jul 20 16:45:11 2010 +0200 +++ b/web/propertysheet.py Wed Jul 21 11:28:30 2010 +0200 @@ -23,6 +23,10 @@ import os import os.path as osp +TYPE_CHECKS = [('STYLESHEETS', list), ('JAVASCRIPTS', list), + ('STYLESHEETS_IE', list), ('STYLESHEETS_PRINT', list), + ] + class lazystr(object): def __init__(self, string, context): self.string = string @@ -54,6 +58,11 @@ scriptglobals = self.context.copy() scriptglobals['__file__'] = fpath execfile(fpath, scriptglobals, self) + for name, type in TYPE_CHECKS: + if name in self: + if not isinstance(self[name], type): + msg = "Configuration error: %s.%s should be a %s" % (fpath, name, type) + raise Exception(msg) self._propfile_mtime[fpath] = os.stat(fpath)[-2] self._ordered_propfiles.append(fpath)