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
+++ b/bitsyblog/bitsyblog.py
@@ -75,17 +75,20 @@ class BitsyBlog(object):
         self.users = FilespaceUsers(self.file_dir)
         self.blog = FileBlog(self.file_dir)
         self.cooker = self.restructuredText
         self.feed_items = int(self.feed_items)
 
         # 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)
                                      
 
         # helpfile
         if self.help_file and os.path.exists(self.help_file):
             help = file(self.help_file).read()