def _template_modified(self, path): """Returns the last modified time of the given path, or None if the path does not exist. Override if templates are not on disk, for example. """ if path: return modtime(path) else: return None
def _compiled_is_current(self, template_name): """Returns True if template_name and its compiled name exists and they have the same mtime. """ compiled_name = self._compiled_filename(template_name) if not compiled_name: return False compiled_mtime = modtime(compiled_name) if not compiled_mtime: return False template_mtime = self._template_modified(template_name) if not template_mtime: return False return compiled_mtime == template_mtime