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
import socketio

2
examples/server/asgi/app.py

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

2
examples/server/sanic/app.py

@ -1,5 +1,3 @@
import asyncio
from sanic import Sanic
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']},
room=sid)
@sio.event
async def leave(sid, message):
sio.leave_room(sid, message['room'])

1
examples/server/wsgi/app.py

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

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

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

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

@ -1,4 +1,5 @@
#!/usr/bin/env python
# flake8: noqa
import os
import sys
@ -11,7 +12,7 @@ if __name__ == "__main__":
# issue is really that Django is missing to avoid masking other
# exceptions on Python 2.
try:
import django
import django # pragma: F401
except ImportError:
raise ImportError(
"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
# 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
# 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
# Create your tests here.

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

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

2
tox.ini

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

Loading…
Cancel
Save