Generate calleable to return the content of the template on disk
        :param path:
        :return:
484077
def generate_file_template_load(path):
        
        path = os.path.expanduser(os.path.abspath(
                path
        ))

        def read_file():
            """
            Read file from path and return file contents
            :return:
            """
            with open(path) as template:
                return template.read()

        return read_file
882542
def displayable_path(path, separator=u'; '):
    
    if isinstance(path, (list, tuple)):
        return separator.join(displayable_path(p) for p in path)
    elif isinstance(path, six.text_type):
        return path
    elif not isinstance(path, bytes):
        # A non-string object: just get its unicode representation.
        return six.text_type(path)

    try:
        return path.decode(_fsencoding(), 'ignore')
    except (UnicodeError, LookupError):
        return path.decode('utf8', 'ignore')
323944
def get_template(self, template_name, **parameters):
        """"""
        template_path = pathlib.Path(self.template_dir).joinpath(template_name)
        return get_template(template_path, **parameters)
629299
def get(self, path):
        
        data = self.app.test_client().get("/%s" % path).data
        return data
755817
def load(self, path):
        
        self.dct = wrapper.Dictionary()
        self.guide = wrapper.Guide()

        with open(path, 'rb') as f:
            self.dct.read(f)
            self.guide.read(f)

        return self
33607
def Get(self, path, rootpy=True, **kwargs):
        
        thing = super(_DirectoryBase, self).Get(path)
        if not thing:
            raise DoesNotExist

        # Ensure that the file we took the object from is alive at least as
        # long as the object being taken from it.

        # Note, Python does *not* own `thing`, it is ROOT's responsibility to
        # delete it in the C++ sense. (SetOwnership is False). However, ROOT
        # will delete the object when the TFile's destructor is run.
        # Therefore, when `thing` goes out of scope and the file referred to
        # by `this` has no references left, the file is destructed and calls
        # `thing`'s delete.

        # (this is thanks to the fact that weak referents (used by keepalive)
        #  are notified when they are dead).

        keepalive(thing, self)

        if rootpy:
            return asrootpy(thing, **kwargs)
        return thing
794525
def cd(path, on=os):
    
    
    original = on.getcwd()
    on.chdir(path)
    
    yield
    
    on.chdir(original)
438641
def _serve_file(self, path):
        
        static = PkgResourcesParser('pylons', 'pylons')
        request.environ['PATH_INFO'] = '/%s' % path
        return static(request.environ, self.start_response)
185434
def get_file_contents(self, path):
        
        path = self._normalize_path(path)
        res = self._session.get(
            self._webdav_url + parse.quote(self._encode_string(path))
        )
        if res.status_code == 200:
            return res.content
        elif res.status_code >= 400:
            raise HTTPResponseError(res)
        return False
15269
def restore(cls, path=None):
        

        if path is None:
            path = cls._PATH_API_CONTEXT_DEFAULT

        with open(path, cls._FILE_MODE_READ) as file_:
            return cls.from_json(file_.read())
1312768
def tar_files(self, path: Path) -> bytes:
        
        tarstream = BytesIO()
        tar = tarfile.TarFile(fileobj=tarstream, mode='w')
        tar.add(str(path), arcname="data", recursive=True)
        tar.close()
        return tarstream.getvalue()
1260936
def get_compiled_file_content(path)
      begin
        Tilt.new(path.to_s).render({}, {
          :spec => spec
        })
      rescue RuntimeError
        File.read(path)
      end
    end
550031
def gen_template_files(path):
    "  "

    path = path.rstrip(op.sep)
    for root, _, files in walk(path):
        for f in filter(lambda x: not x in (TPLNAME, CFGNAME), files):
            yield op.relpath(op.join(root, f), path)
943271
def download(path)
      resp, body = content_request('/files/download', path: path)
      return FileMetadata.new(resp), body
    end
736741
def getFileFormat(self, name, args):
		
		# récupération du nom du fichier
		template_pathname = self.get(name, "--")
		if not os.path.isfile(template_pathname):
			return False

		# configuration
		content = ""
		with open(template_pathname) as fp:
			# Create a text/plain message
			content = fp.read().format(**args)

		# retour ok
		return content
1065698
def _delegate(self, path):
        # type: (Text) -> Optional[FS]
        
        for _name, fs in self.iterate_fs():
            if fs.exists(path):
                return fs
        return None
1113518
def render_template_for_path(request, path, context=None, use_cache=True, def_name=None):
    '''
    
    '''
    return get_template_for_path(path, use_cache).render(context, request, def_name)