コード例 #1
0
def display_event_schedule_pentabarf(identifier):
    event = get_published_event_or_abort(identifier)
    if not event.has_session_speakers:
        abort(404)
    accepted_sessions_count = get_count(DataGetter.get_sessions(event.id))
    if accepted_sessions_count == 0 or not event.schedule_published_on:
        abort(404)
    response = make_response(PentabarfExporter.export(event.id))
    response.headers["Content-Type"] = "application/xml"
    return response
コード例 #2
0
def display_event_schedule_pentabarf(identifier):
    event = get_published_event_or_abort(identifier)
    if not event.has_session_speakers:
        abort(404)
    accepted_sessions_count = get_count(DataGetter.get_sessions(event.id))
    if accepted_sessions_count == 0 or not event.schedule_published_on:
        abort(404)
    response = make_response(PentabarfExporter.export(event.id))
    response.headers["Content-Type"] = "application/xml"
    return response
コード例 #3
0
def export_pentabarf_task(event_id):
    event = DataGetter.get_event(event_id)
    try:
        os.mkdir(app.config['TEMP_UPLOADS_FOLDER'])
    except OSError as exc:
        if exc.errno != errno.EEXIST:
            raise exc
    filename = "pentabarf.xml"
    file_path = app.config['TEMP_UPLOADS_FOLDER'] + "/" + filename
    with open(file_path, "w") as temp_file:
        temp_file.write(PentabarfExporter.export(event_id))
    pentabarf_file = UploadedFile(file_path=file_path, filename=filename)
    event.pentabarf_url = upload(pentabarf_file, UPLOAD_PATHS['exports'][
                                 'pentabarf'].format(event_id=event_id))
    save_to_db(event)
コード例 #4
0
def export_pentabarf_task(event_id):
    event = DataGetter.get_event(event_id)
    try:
        os.mkdir(app.config['TEMP_UPLOADS_FOLDER'])
    except OSError as exc:
        if exc.errno != errno.EEXIST:
            raise exc
    filename = "pentabarf.xml"
    file_path = app.config['TEMP_UPLOADS_FOLDER'] + "/" + filename
    with open(file_path, "w") as temp_file:
        temp_file.write(PentabarfExporter.export(event_id))
    pentabarf_file = UploadedFile(file_path=file_path, filename=filename)
    event.pentabarf_url = upload(
        pentabarf_file,
        UPLOAD_PATHS['exports']['pentabarf'].format(event_id=event_id))
    save_to_db(event)
コード例 #5
0
def pentabarf_export_view(event_id):
    response = make_response(PentabarfExporter.export(event_id))
    response.headers["Content-Type"] = "application/xml"
    response.headers[
        "Content-Disposition"] = "attachment; filename=pentabarf.xml"
    return response
コード例 #6
0
def pentabarf_export_view(event_id):
    response = make_response(PentabarfExporter.export(event_id))
    response.headers["Content-Type"] = "application/xml"
    response.headers["Content-Disposition"] = "attachment; filename=pentabarf.xml"
    return response