Home | History | Annotate | Download | only in jinja2

Lines Matching full:path

15 from os import path
23 """Split a path into segments and perform a sanity check. If it detects
24 '..' in the path it will raise a `TemplateNotFound` error.
28 if path.sep in piece \
29 or (path.altsep and path.altsep in piece) or \
30 piece == path.pardir:
47 from os.path import join, exists, getmtime
51 def __init__(self, path):
52 self.path = path
55 path = join(self.path, template)
56 if not exists(path):
58 mtime = getmtime(path)
59 with file(path) as f:
61 return source, path, lambda: mtime == getmtime(path)
142 The loader takes the path to the templates as string, or if multiple
146 >>> loader = FileSystemLoader('/path/to/templates')
147 >>> loader = FileSystemLoader(['/path/to/templates', '/other/path'])
162 filename = path.join(searchpath, *pieces)
171 mtime = path.getmtime(filename)
174 return path.getmtime(filename) == mtime
185 template = os.path.join(dirpath, filename) \
186 [len(searchpath):].strip(os.path.sep) \
187 .replace(os.path.sep, '/')
197 the name of the python package and the path to the templates in that
202 If the package path is not given, ``'templates'`` is assumed.
230 mtime = path.getmtime(filename)
233 return path.getmtime(filename) == mtime
241 path = self.package_path
242 if path[:2] == './':
243 path = path[2:]
244 elif path == '.':
245 path = ''
246 offset = len(path)
248 def _walk(path):
249 for filename in self.provider.resource_listdir(path):
250 fullname = path + '/' + filename
255 _walk(path)
372 ... FileSystemLoader('/path/to/user/templates'),
373 ... FileSystemLoader('/path/to/system/templates')
417 ... ModuleLoader('/path/to/compiled/templates'),
418 ... FileSystemLoader('/path/to/templates')
426 def __init__(self, path):
430 # path given.
432 if isinstance(path, string_types):
433 path = [path]
435 path = list(path)
436 mod.__path__ = path