Make tfw.networking more structured, remove relative import hell

This commit is contained in:
Kristóf Tóth 2018-02-06 14:19:41 +01:00
parent 5e34835ed6
commit b75709b3e5
9 changed files with 15 additions and 16 deletions

View File

@ -1,5 +1,5 @@
from .networking.serialization import deserialize_all
from .networking.server_connector import ServerConnector
from tfw.networking.serialization import deserialize_all
from tfw.networking.event_handlers.server_connector import ServerConnector
class EventHandlerBase:

View File

@ -1,6 +1,6 @@
from datetime import datetime
from .networking.server_connector import ServerUplinkConnector
from tfw.networking.event_handlers.server_connector import ServerUplinkConnector
class MessageSender:

View File

@ -3,9 +3,9 @@ from functools import partial
from zmq.eventloop import ioloop
from zmq.eventloop.zmqstream import ZMQStream
from .serialization import serialize_all
from ..config import PUBLISHER_PORT, RECEIVER_PORT
from ..util import ZMQConnectorBase
from tfw.networking.serialization import serialize_all
from tfw.config import PUBLISHER_PORT, RECEIVER_PORT
from tfw.util import ZMQConnectorBase
ioloop.install()

View File

View File

@ -2,11 +2,11 @@ import zmq
from zmq.eventloop import ioloop
from zmq.eventloop.zmqstream import ZMQStream
from .serialization import serialize_all
from ..config import PUBLISHER_PORT, RECEIVER_PORT
from ..config.logs import logging
from tfw.networking.serialization import serialize_all
from tfw.config import PUBLISHER_PORT, RECEIVER_PORT
from tfw.config.logs import logging
log = logging.getLogger(__name__)
from ..util import ZMQConnectorBase
from tfw.util import ZMQConnectorBase
ioloop.install()

View File

@ -1,10 +1,9 @@
import json
from tornado.websocket import WebSocketHandler
from .serialization import deserialize_all
from .event_handler_connector import EventHandlerConnector
from ..config.logs import logging
from tfw.networking.serialization import deserialize_all
from tfw.networking.server.event_handler_connector import EventHandlerConnector
from tfw.config.logs import logging
log = logging.getLogger(__name__)

View File

@ -1,4 +1,4 @@
import json, xmlrpc.client, zmq
import xmlrpc.client, zmq
from .config.envvars import SUPERVISOR_HTTP_URI

View File

@ -7,7 +7,7 @@ from tornado.ioloop import IOLoop
from tfw.config import WEB_PORT
from tfw.config.logs import logging
log = logging.getLogger(__name__)
from tfw.networking.zmq_websocket_handler import FSMManagingSocketHandler
from tfw.networking.server.zmq_websocket_handler import FSMManagingSocketHandler
from sql_injection_fsm import SQLInjectionFSM