changeset 63:e3c72e2c881e

better error message
author egj@socialplanning.org
date Tue, 02 Feb 2010 18:18:22 +0000
parents 4038c2a052da
children 292aeb1741f3
files bitsyblog/bitsyblog.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/bitsyblog/bitsyblog.py	Tue Jan 19 14:50:44 2010 -0500
+++ b/bitsyblog/bitsyblog.py	Tue Feb 02 18:18:22 2010 +0000
@@ -80,7 +80,10 @@
         # template renderer
         self.auto_reload = self.auto_reload.lower()=='true'
         self.template_directories = self.template_directories.split() # no spaces in directory names, for now
-        assert sum([os.path.isdir(directory) for directory in self.template_directories]) == len(self.template_directories)
+
+        for directory in self.template_directories:
+            assert os.path.isdir(directory), "Bitsyblog template directory %s does not exist!" % directory
+        
         self.template_directories.append(resource_filename(__name__, 'templates'))
         self.loader = TemplateLoader(self.template_directories,
                                      auto_reload=self.auto_reload)