Example #1
0
def series_mbox(series_id):
    series = Series.query.filter_by(id=series_id).first_or_404()
    f = StringIO()
    mb = mbox(f)
    for patch in series.patches.order_by("Patch.date asc"):
        mb.add(patch.mbox)

    filename = "{}-{}-series.mbox".format(series_id, slugify(g.project.name))

    headers = {"Content-Disposition":'attachment;filename="%s"' % filename}

    return Response(f.getvalue(),
                    mimetype='application/mbox',
                    headers=headers)
Example #2
0
def patch():
    filename = "{}-{}.patch".format(g.patch.id, slugify(g.patch.name))
    headers = {"Content-Disposition":'attachment;filename="%s"' % filename}

    return Response(g.patch.content, mimetype='text/x-patch', headers=headers)
Example #3
0
def mbox():
    filename = "{}-{}.mbox".format(g.patch.id, slugify(g.patch.name))
    headers = {"Content-Disposition":'attachment;filename="%s"' % filename}

    return Response(g.patch.mbox, mimetype='application/mbox', headers=headers)