Index: cms/converters.py |
=================================================================== |
--- a/cms/converters.py |
+++ b/cms/converters.py |
@@ -308,16 +308,19 @@ |
"get_page_content": self.get_page_content, |
} |
+ source = self._params["source"] |
self._module_refs = [] |
for dirname, dictionary in [("filters", filters), ("globals", globals)]: |
- for filename in self._params["source"].list_files(dirname): |
+ for filename in source.list_files(dirname): |
root, ext = os.path.splitext(filename) |
if ext.lower() != ".py": |
continue |
path = "%s/%s" % (dirname, filename) |
- code = self._params["source"].read_file(path) |
+ code = source.read_file(path) |
module = imp.new_module(root.replace("/", ".")) |
+ if hasattr(source, "get_cache_dir"): |
+ module.CMS_CACHE_DIR = source.get_cache_dir() |
exec code in module.__dict__ |
name = os.path.basename(root) |