kopia lustrzana https://github.com/Yakifo/amqtt
flake8: Fix all E402 import warnings
rodzic
177bfb627c
commit
1b5ead2e08
|
@ -8,10 +8,6 @@ import asyncio
|
|||
import sys
|
||||
import re
|
||||
from asyncio import Queue, CancelledError
|
||||
if sys.version_info < (3, 5):
|
||||
from asyncio import async as ensure_future
|
||||
else:
|
||||
from asyncio import ensure_future
|
||||
from collections import deque
|
||||
|
||||
from functools import partial
|
||||
|
@ -29,6 +25,11 @@ from hbmqtt.adapters import (
|
|||
WebSocketsWriter)
|
||||
from .plugins.manager import PluginManager, BaseContext
|
||||
|
||||
if sys.version_info < (3, 5):
|
||||
from asyncio import async as ensure_future
|
||||
else:
|
||||
from asyncio import ensure_future
|
||||
|
||||
_defaults = {
|
||||
'timeout-disconnect-delay': 2,
|
||||
'auth': {
|
||||
|
|
|
@ -4,10 +4,6 @@
|
|||
import asyncio
|
||||
from asyncio import futures
|
||||
import sys
|
||||
if sys.version_info < (3, 5):
|
||||
from asyncio import async as ensure_future
|
||||
else:
|
||||
from asyncio import ensure_future
|
||||
from hbmqtt.mqtt.protocol.handler import ProtocolHandler, EVENT_MQTT_PACKET_RECEIVED
|
||||
from hbmqtt.mqtt.packet import *
|
||||
from hbmqtt.mqtt.disconnect import DisconnectPacket
|
||||
|
@ -22,6 +18,11 @@ from hbmqtt.mqtt.connack import ConnackPacket
|
|||
from hbmqtt.session import Session
|
||||
from hbmqtt.plugins.manager import PluginManager
|
||||
|
||||
if sys.version_info < (3, 5):
|
||||
from asyncio import async as ensure_future
|
||||
else:
|
||||
from asyncio import ensure_future
|
||||
|
||||
|
||||
class ClientProtocolHandler(ProtocolHandler):
|
||||
def __init__(self, plugins_manager: PluginManager, session: Session=None, loop=None):
|
||||
|
|
|
@ -9,13 +9,14 @@ import logging
|
|||
import asyncio
|
||||
import copy
|
||||
import sys
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
if sys.version_info < (3, 5):
|
||||
from asyncio import async as ensure_future
|
||||
else:
|
||||
from asyncio import ensure_future
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
Plugin = namedtuple('Plugin', ['name', 'ep', 'object'])
|
||||
|
||||
plugins_manager = dict()
|
||||
|
|
|
@ -6,11 +6,12 @@ from hbmqtt.mqtt.packet import PUBLISH
|
|||
from hbmqtt.codecs import int_to_bytes_str
|
||||
import asyncio
|
||||
import sys
|
||||
from collections import deque
|
||||
|
||||
if sys.version_info < (3, 5):
|
||||
from asyncio import async as ensure_future
|
||||
else:
|
||||
from asyncio import ensure_future
|
||||
from collections import deque
|
||||
|
||||
DOLLAR_SYS_ROOT = '$SYS/broker/'
|
||||
STAT_BYTES_SENT = 'bytes_sent'
|
||||
|
|
1
tox.ini
1
tox.ini
|
@ -1,6 +1,5 @@
|
|||
[flake8]
|
||||
ignore =
|
||||
E402, # module level import not at top of file (~24 warnings)
|
||||
F401, # 'x' imported but unused (~12 warnings)
|
||||
F403, # 'from x import *' used; unable to detect undefined names (~29 warnings)
|
||||
F821, # undefined name 'x' (~1 warnings)
|
||||
|
|
Ładowanie…
Reference in New Issue