Skip to content

Commit

Permalink
Add example code to flake8 linter
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Jan 10, 2022
1 parent 4ee3649 commit 273a4b0
Show file tree
Hide file tree
Showing 12 changed files with 8 additions and 10 deletions.
2 changes: 0 additions & 2 deletions examples/server/aiohttp/app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import asyncio

from aiohttp import web

import socketio
Expand Down
2 changes: 0 additions & 2 deletions examples/server/asgi/app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/usr/bin/env python
import asyncio

import uvicorn

import socketio
Expand Down
2 changes: 0 additions & 2 deletions examples/server/sanic/app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import asyncio

from sanic import Sanic
from sanic.response import html

Expand Down
1 change: 1 addition & 0 deletions examples/server/tornado/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down
1 change: 0 additions & 1 deletion examples/server/wsgi/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# installed
async_mode = None

import time
from flask import Flask, render_template
import socketio

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# flake8: noqa
"""
Django settings for django_example project.
Expand Down
3 changes: 2 additions & 1 deletion examples/server/wsgi/django_example/manage.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python
# flake8: noqa
import os
import sys

Expand All @@ -11,7 +12,7 @@
# 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 "
Expand Down
1 change: 1 addition & 0 deletions examples/server/wsgi/django_example/socketio_app/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# flake8: noqa
from django.contrib import admin

# Register your models here.
1 change: 1 addition & 0 deletions examples/server/wsgi/django_example/socketio_app/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# flake8: noqa
from django.db import models

# Create your models here.
1 change: 1 addition & 0 deletions examples/server/wsgi/django_example/socketio_app/tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# flake8: noqa
from django.test import TestCase

# Create your tests here.
1 change: 0 additions & 1 deletion examples/server/wsgi/django_example/socketio_app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,3 @@ def connect(sid, environ):
@sio.event
def disconnect(sid):
print('Client disconnected')

2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 273a4b0

Please sign in to comment.