Désactivation de SocketIO pour l’instant
authorOlivier Tétard <olivier.tetard@miskin.fr>
Thu, 19 Nov 2015 13:34:28 +0000 (14:34 +0100)
committerOlivier Tétard <olivier.tetard@miskin.fr>
Thu, 19 Nov 2015 13:34:28 +0000 (14:34 +0100)
femtoblackweb.py
requirements.txt

index 14d556e..52223b5 100644 (file)
@@ -8,8 +8,6 @@ from werkzeug import secure_filename
 
 from datetime import datetime
 
-from flask.ext.socketio import SocketIO, emit, join_room, leave_room, close_room, rooms, disconnect
-
 from flask_bootstrap import Bootstrap
 
 import json
@@ -32,7 +30,6 @@ app.config.update({
 app.config.from_envvar('FEMTOBLACK_SETTINGS', silent=True)
 
 Bootstrap(app)
-socketio = SocketIO(app)
 
 @app.errorhandler(404)
 def page_not_found(e):
@@ -118,81 +115,6 @@ def analyze_file(filename):
     else:
         abort(404)
 
-@app.route('/testio')
-def testio():
-    return render_template('testio.html')
-
-
-@socketio.on('my event', namespace='/test')
-def test_message(message):
-    session['receive_count'] = session.get('receive_count', 0) + 1
-    emit('my response',
-         {'data': message['data'], 'count': session['receive_count']})
-
-
-@socketio.on('my broadcast event', namespace='/test')
-def test_broadcast_message(message):
-    session['receive_count'] = session.get('receive_count', 0) + 1
-    emit('my response',
-         {'data': message['data'], 'count': session['receive_count']},
-         broadcast=True)
-
-
-@socketio.on('join', namespace='/test')
-def join(message):
-    join_room(message['room'])
-    session['receive_count'] = session.get('receive_count', 0) + 1
-    emit('my response',
-         {'data': 'In rooms: ' + ', '.join(rooms()),
-          'count': session['receive_count']})
-
-
-@socketio.on('leave', namespace='/test')
-def leave(message):
-    leave_room(message['room'])
-    session['receive_count'] = session.get('receive_count', 0) + 1
-    emit('my response',
-         {'data': 'In rooms: ' + ', '.join(rooms()),
-          'count': session['receive_count']})
-
-
-@socketio.on('close room', namespace='/test')
-def close(message):
-    session['receive_count'] = session.get('receive_count', 0) + 1
-    emit('my response', {'data': 'Room ' + message['room'] + ' is closing.',
-                         'count': session['receive_count']},
-         room=message['room'])
-    close_room(message['room'])
-
-
-@socketio.on('my room event', namespace='/test')
-def send_room_message(message):
-    session['receive_count'] = session.get('receive_count', 0) + 1
-    emit('my response',
-         {'data': message['data'], 'count': session['receive_count']},
-         room=message['room'])
-
-
-@socketio.on('disconnect request', namespace='/test')
-def disconnect_request():
-    session['receive_count'] = session.get('receive_count', 0) + 1
-    emit('my response',
-         {'data': 'Disconnected!', 'count': session['receive_count']})
-    disconnect()
-
-
-@socketio.on('connect', namespace='/test')
-def test_connect():
-    emit('my response', {'data': 'Connected', 'count': 0})
-
-
-@socketio.on('disconnect', namespace='/test')
-def test_disconnect():
-    print('Client disconnected', request.sid)
-
-
-
 
 if __name__ == "__main__":
-    socketio.run(app)
-    #app.run(debug=True)
+    app.run(debug=True)
index 005711d..c0b4e8e 100644 (file)
@@ -8,7 +8,5 @@ dominate==2.1.16
 eventlet==0.17.4
 greenlet==0.4.9
 itsdangerous==0.24
-python-engineio==0.7.1
-python-socketio==0.6.1
 six==1.10.0
 visitor==0.1.2