Browse Source

Add example code to flake8 linter

pull/856/head
Miguel Grinberg 3 years ago
parent
commit
273a4b0439
No known key found for this signature in database GPG Key ID: 36848B262DF5F06C
  1. 2
      examples/server/aiohttp/app.py
  2. 2
      examples/server/asgi/app.py
  3. 2
      examples/server/sanic/app.py
  4. 1
      examples/server/tornado/app.py
  5. 1
      examples/server/wsgi/app.py
  6. 1
      examples/server/wsgi/django_example/django_example/settings.py
  7. 3
      examples/server/wsgi/django_example/manage.py
  8. 1
      examples/server/wsgi/django_example/socketio_app/admin.py
  9. 1
      examples/server/wsgi/django_example/socketio_app/models.py
  10. 1
      examples/server/wsgi/django_example/socketio_app/tests.py
  11. 1
      examples/server/wsgi/django_example/socketio_app/views.py
  12. 2
      tox.ini

2
examples/server/aiohttp/app.py

@ -1,5 +1,3 @@
import asyncio
from aiohttp import web from aiohttp import web
import socketio import socketio

2
examples/server/asgi/app.py

@ -1,6 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python
import asyncio
import uvicorn import uvicorn
import socketio import socketio

2
examples/server/sanic/app.py

@ -1,5 +1,3 @@
import asyncio
from sanic import Sanic from sanic import Sanic
from sanic.response import html from sanic.response import html

1
examples/server/tornado/app.py

@ -42,6 +42,7 @@ async def join(sid, message):
await sio.emit('my_response', {'data': 'Entered room: ' + message['room']}, await sio.emit('my_response', {'data': 'Entered room: ' + message['room']},
room=sid) room=sid)
@sio.event @sio.event
async def leave(sid, message): async def leave(sid, message):
sio.leave_room(sid, message['room']) sio.leave_room(sid, message['room'])

1
examples/server/wsgi/app.py

@ -3,7 +3,6 @@
# installed # installed
async_mode = None async_mode = None
import time
from flask import Flask, render_template from flask import Flask, render_template
import socketio import socketio

1
examples/server/wsgi/django_example/django_example/settings.py

@ -1,3 +1,4 @@
# flake8: noqa
""" """
Django settings for django_example project. Django settings for django_example project.

3
examples/server/wsgi/django_example/manage.py

@ -1,4 +1,5 @@
#!/usr/bin/env python #!/usr/bin/env python
# flake8: noqa
import os import os
import sys import sys
@ -11,7 +12,7 @@ if __name__ == "__main__":
# issue is really that Django is missing to avoid masking other # issue is really that Django is missing to avoid masking other
# exceptions on Python 2. # exceptions on Python 2.
try: try:
import django import django # pragma: F401
except ImportError: except ImportError:
raise ImportError( raise ImportError(
"Couldn't import Django. Are you sure it's installed and " "Couldn't import Django. Are you sure it's installed and "

1
examples/server/wsgi/django_example/socketio_app/admin.py

@ -1,3 +1,4 @@
# flake8: noqa
from django.contrib import admin from django.contrib import admin
# Register your models here. # Register your models here.

1
examples/server/wsgi/django_example/socketio_app/models.py

@ -1,3 +1,4 @@
# flake8: noqa
from django.db import models from django.db import models
# Create your models here. # Create your models here.

1
examples/server/wsgi/django_example/socketio_app/tests.py

@ -1,3 +1,4 @@
# flake8: noqa
from django.test import TestCase from django.test import TestCase
# Create your tests here. # Create your tests here.

1
examples/server/wsgi/django_example/socketio_app/views.py

@ -80,4 +80,3 @@ def connect(sid, environ):
@sio.event @sio.event
def disconnect(sid): def disconnect(sid):
print('Client disconnected') print('Client disconnected')

2
tox.ini

@ -23,7 +23,7 @@ deps=
deps= deps=
flake8 flake8
commands= commands=
flake8 --exclude=".*" --ignore=W503,E402,E722 src/socketio tests flake8 --exclude=".*" --ignore=W503,E402,E722 src/socketio tests examples
[testenv:docs] [testenv:docs]
changedir=docs changedir=docs

Loading…
Cancel
Save