@app.route('/import', methods=['GET', 'POST'])
@login_required
def move_import():
    xmlfiles = request.files.getlist('files')
    imported_moves = []

    for xmlfile in xmlfiles:
        filename = xmlfile.filename
        if filename:
            app.logger.info("importing '%s'" % filename)
            move = imports.move_import(xmlfile, filename, current_user, request.form)
            if move:
                imported_moves.append(move)

    if imported_moves:
        if len(imported_moves) == 1:
            move = imported_moves[0]
            flash("imported '%s': move %d" % (xmlfile.filename, move.id))
            return redirect(url_for('move', id=move.id))
        else:
            flash(len(imported_moves) % "imported %d moves")
            return redirect(url_for('moves'))
    else:
        return render_template('import.html')
dataset/ETHPy150Open bwaldvogel/openmoves/openmoves.py/move_import/swapped operands of `%`