Author: leidel
Date: Sat Nov 1 17:05:48 2008
New Revision: 59
Modified:
trunk/dbtemplates/cache.py
trunk/dbtemplates/loader.py
Log:
Fixed docstring in template loader.
Fixed wrong return types in FileSystemBackend.
Modified: trunk/dbtemplates/cache.py
==============================================================================
--- trunk/dbtemplates/cache.py (original)
+++ trunk/dbtemplates/cache.py Sat Nov 1 17:05:48 2008
@@ -62,7 +62,7 @@
self.cache_dir = getattr(settings, 'DBTEMPLATES_CACHE_DIR',
None)
self.cache_dir = os.path.normpath(self.cache_dir)
if not os.path.isdir(self.cache_dir):
- raise Exception
+ pass
except:
raise ImproperlyConfigured('You\'re using the dbtemplates\'
file system cache backend without having set the DBTEMPLATES_CACHE_DIR
setting to a valid value. Make sure the directory exists and is writeable
for the user your Django instance is running with.')
super(FileSystemBackend, self).__init__()
@@ -75,7 +75,7 @@
filepath = self._filepath(name)
return open(filepath).read().decode('utf-8')
except:
- raise None
+ return None
def save(self, name, content, retry=False):
try:
Modified: trunk/dbtemplates/loader.py
==============================================================================
--- trunk/dbtemplates/loader.py (original)
+++ trunk/dbtemplates/loader.py Sat Nov 1 17:05:48 2008
@@ -7,12 +7,10 @@
def load_template_source(template_name, template_dirs=None):
"""
- Tries to load the template from DBTEMPLATES_CACHE_DIR. If it does not
- exist loads templates from the database by querying the database field
- ``name`` with a template path and ``sites`` with the current site,
- and tries to save the template as DBTEMPLATES_CACHE_DIR/``name`` for
- subsequent requests. If DBTEMPLATES_CACHE_DIR is not configured falls
- back to database-only operation.
+ Tries to load the template from the dbtemplates cache backend specified
+ by the DBTEMPLATES_CACHE_BACKEND setting. If it does not find a
template
+ it falls back to query the database field ``name`` with the template
path
+ and ``sites`` with the current site.
"""
display_name = 'db:%s:%s' % (settings.DATABASE_ENGINE, template_name)
if backend:
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pinax-updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pinax-updates?hl=en
-~----------~----~----~----~------~----~------~--~---