예제 #1
0
    def get_response(self):
        tarname = "%s@%s.tar.gz" % (self.context['repo'].name,
                                    sanitize_branch_name(self.context['rev']))
        headers = {
            'Content-Disposition': "attachment; filename=%s" % tarname,
            'Cache-Control': "no-store",  # Disables browser caching
        }

        tar_stream = dulwich.archive.tar_stream(
            self.context['repo'],
            self.context['blob_or_tree'],
            self.context['commit'].commit_time,
            format="gz")
        return Response(tar_stream,
                        mimetype="application/x-tgz",
                        headers=headers)
예제 #2
0
파일: views.py 프로젝트: srinivas32/klaus
    def get_response(self):
        basename = "%s@%s" % (
            self.context["repo"].name,
            sanitize_branch_name(self.context["rev"]),
        )
        tarname = basename + ".tar.gz"
        headers = {
            "Content-Disposition": "attachment; filename=%s" % tarname,
            "Cache-Control": "no-store",  # Disables browser caching
        }

        tar_stream = dulwich.archive.tar_stream(
            self.context["repo"],
            self.context["blob_or_tree"],
            self.context["commit"].commit_time,
            format="gz",
            prefix=encode_for_git(basename),
        )
        return Response(tar_stream, mimetype="application/x-tgz", headers=headers)
예제 #3
0
파일: views.py 프로젝트: jahir/klaus
    def get_response(self):
        tarname = "%s@%s.tar.gz" % (self.context['repo'].name,
                                    sanitize_branch_name(self.context['rev']))
        headers = {
            'Content-Disposition': "attachment; filename=%s" % tarname,
            'Cache-Control': "no-store",  # Disables browser caching
        }

        tar_stream = dulwich.archive.tar_stream(
            self.context['repo'],
            self.context['blob_or_tree'],
            self.context['commit'].commit_time,
            format="gz"
        )
        return Response(
            tar_stream,
            mimetype="application/x-tgz",
            headers=headers
        )