示例#1
0
def api_exportArchive(simulation_type, simulation_id, filename):
    req = http_request.parse_params(
        filename=filename,
        id=simulation_id,
        type=simulation_type,
    )
    from sirepo import exporter
    return exporter.create_archive(req)
示例#2
0
文件: server.py 项目: arboret/sirepo
def api_exportArchive(simulation_type, simulation_id, filename):
    from sirepo import exporter
    fn, mt = exporter.create_archive(simulation_type, simulation_id, filename)
    return flask.send_file(
        str(fn),
        as_attachment=True,
        attachment_filename=filename,
        mimetype=mt,
    )
示例#3
0
文件: server.py 项目: yeeon/sirepo
def api_exportArchive(simulation_type, simulation_id, filename):
    from sirepo import exporter
    fn, mt = exporter.create_archive(simulation_type, simulation_id, filename)
    return flask.send_file(
        str(fn),
        as_attachment=True,
        attachment_filename=filename,
        mimetype=mt,
        #TODO(pjm): the browser caches HTML files, may need to add explicit times
        # to other calls to send_file()
        cache_timeout=1,
    )