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