Lines Matching refs:path
25 """Split a path into segments and perform a sanity check. If it detects
26 '..' in the path it will raise a `TemplateNotFound` error.
31 os.path.sep in piece
32 or (os.path.altsep and os.path.altsep in piece)
33 or piece == os.path.pardir
51 from os.path import join, exists, getmtime
55 def __init__(self, path):
56 self.path = path
59 path = join(self.path, template)
60 if not exists(path):
62 mtime = getmtime(path)
63 with open(path) as f:
65 return source, path, lambda: mtime == getmtime(path)
154 The path can be relative or absolute. Relative paths are relative to
168 :param searchpath: A path, or list of paths, to the directory that
172 :param followlinks: Follow symbolic links in the path.
201 if os.path.isfile(filename):
209 mtime = os.path.getmtime(filename)
213 return os.path.getmtime(filename) == mtime
218 return contents, os.path.normpath(filename), uptodate
227 os.path.join(dirpath, filename)[len(searchpath) :]
228 .strip(os.path.sep)
229 .replace(os.path.sep, "/")
277 package_path = os.path.normpath(package_path).rstrip(os.path.sep)
280 if package_path == os.path.curdir:
282 elif package_path[:2] == os.path.curdir + os.path.sep:
303 template_root = os.path.join(pkgdir, package_path).rstrip(os.path.sep)
313 roots.append(os.path.dirname(spec.origin))
316 root = os.path.join(root, package_path)
318 if os.path.isdir(root):
336 p = os.path.normpath(
343 if not os.path.isfile(p):
349 mtime = os.path.getmtime(p)
352 return os.path.isfile(p) and os.path.getmtime(p) == mtime
376 dirpath = dirpath[offset:].lstrip(os.path.sep)
378 os.path.join(dirpath, name).replace(os.path.sep, "/")
390 self._template_root[len(self._archive) :].lstrip(os.path.sep)
391 + os.path.sep
397 if name.startswith(prefix) and name[-1] != os.path.sep:
398 results.append(name[offset:].replace(os.path.sep, "/"))
542 ... FileSystemLoader('/path/to/user/templates'),
543 ... FileSystemLoader('/path/to/system/templates')
594 ... ModuleLoader('/path/to/compiled/templates'),
595 ... FileSystemLoader('/path/to/templates')
604 self, path: t.Union[str, os.PathLike, t.Sequence[t.Union[str, os.PathLike]]]
609 # path given.
612 if not isinstance(path, abc.Iterable) or isinstance(path, str):
613 path = [path]
615 mod.__path__ = [os.fspath(p) for p in path]