Lines Matching refs: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'])
154 >>> loader = FileSystemLoader('/path/to/templates', followlinks=True)
170 filename = path.join(searchpath, *pieces)
179 mtime = path.getmtime(filename)
183 return path.getmtime(filename) == mtime
195 template = os.path.join(dirpath, filename) \
196 [len(searchpath):].strip(os.path.sep) \
197 .replace(os.path.sep, '/')
207 the name of the python package and the path to the templates in that
212 If the package path is not given, ``'templates'`` is assumed.
240 mtime = path.getmtime(filename)
243 return path.getmtime(filename) == mtime
251 path = self.package_path
252 if path[:2] == './':
253 path = path[2:]
254 elif path == '.':
255 path = ''
256 offset = len(path)
258 def _walk(path):
259 for filename in self.provider.resource_listdir(path):
260 fullname = path + '/' + filename
265 _walk(path)
382 ... FileSystemLoader('/path/to/user/templates'),
383 ... FileSystemLoader('/path/to/system/templates')
427 ... ModuleLoader('/path/to/compiled/templates'),
428 ... FileSystemLoader('/path/to/templates')
436 def __init__(self, path):
440 # path given.
442 if isinstance(path, string_types):
443 path = [path]
445 path = list(path)
446 mod.__path__ = path