Refactor project structure

This commit is contained in:
Kristóf Tóth 2018-01-31 15:50:52 +01:00
parent 23cc381495
commit 0d41b4c8e9
20 changed files with 27 additions and 28 deletions

View File

@ -1,6 +1,6 @@
import json
from server_connector import ServerConnector
from .networking.server_connector import ServerConnector
class EventHandlerBase:

View File

@ -1,7 +1,7 @@
import json
from datetime import datetime
from server_connector import ServerUplinkConnector
from .networking.server_connector import ServerUplinkConnector
class MessageSender:

View File

@ -2,10 +2,10 @@ import zmq
from zmq.eventloop import ioloop
from zmq.eventloop.zmqstream import ZMQStream
from config import PUBLISHER_PORT, RECEIVER_PORT
from config.logs import logging
from ..config import PUBLISHER_PORT, RECEIVER_PORT
from ..config.logs import logging
log = logging.getLogger(__name__)
from util import parse_anchor_from_message, ZMQConnectorBase
from ..util import parse_anchor_from_message, ZMQConnectorBase
ioloop.install()

View File

@ -1,11 +1,11 @@
from functools import partial
import zmq
from functools import partial
from zmq.eventloop import ioloop
from zmq.eventloop.zmqstream import ZMQStream
from config import PUBLISHER_PORT, RECEIVER_PORT
from util import ZMQConnectorBase
from ..config import PUBLISHER_PORT, RECEIVER_PORT
from ..util import ZMQConnectorBase
ioloop.install()

View File

@ -1,9 +1,9 @@
import json
from tornado.websocket import WebSocketHandler
from util import parse_anchor_from_message
from event_handler_connector import EventHandlerConnector
from config.logs import logging
from ..util import parse_anchor_from_message
from .event_handler_connector import EventHandlerConnector
from ..config.logs import logging
log = logging.getLogger(__name__)

View File

@ -1,6 +1,6 @@
import json, xmlrpc.client, zmq
from config.envvars import SUPERVISOR_HTTP_URI
from .config.envvars import SUPERVISOR_HTTP_URI
def parse_anchor_from_message(message):

View File

@ -4,10 +4,10 @@ import zmq
from tornado.web import Application
from tornado.ioloop import IOLoop
from config import WEB_PORT
from config.logs import logging
from tfw.config import WEB_PORT
from tfw.config.logs import logging
log = logging.getLogger(__name__)
from handlers import FSMManagingSocketHandler
from tfw.networking.zmq_websocket_handler import FSMManagingSocketHandler
from sql_injection_fsm import SQLInjectionFSM

View File

@ -1 +0,0 @@
from .zmq_websocket_handler import FSMManagingSocketHandler

View File

@ -1,4 +1,4 @@
from fsm_base import FSMBase
from tfw.fsm_base import FSMBase
class SQLInjectionFSM(FSMBase):

View File

@ -3,9 +3,9 @@ from os.path import splitext
from contextlib import suppress
from xmlrpc.client import Fault as SupervisorFault
from util import SupervisorMixin
from config import LOGIN_APP_DIR
from event_handler_base import EventHandlerBase
from tfw.util import SupervisorMixin
from tfw.config import LOGIN_APP_DIR
from tfw.event_handler_base import EventHandlerBase
class SourceCodeEventHandler(EventHandlerBase, SupervisorMixin):

View File

@ -3,7 +3,7 @@ import json
from tornado.ioloop import IOLoop
from tornado.web import RequestHandler, Application
from config import LOGIN_APP_PORT
from tfw.config import LOGIN_APP_PORT
from login_component import authorize_login

View File

@ -1,9 +1,9 @@
from shutil import rmtree, copytree
from event_handler_base import EventHandlerBase
from util import SupervisorMixin
from config import TERMINADO_DIR
from config.logs import logging
from tfw.event_handler_base import EventHandlerBase
from tfw.util import SupervisorMixin
from tfw.config import TERMINADO_DIR
from tfw.config.logs import logging
log = logging.getLogger(__name__)

View File

@ -2,8 +2,8 @@ from tornado.ioloop import IOLoop
from tornado.web import Application
from terminado import TermSocket, UniqueTermManager
from config import TERMINADO_PORT, TERMINADO_WD
from config.logs import logging
from tfw.config import TERMINADO_PORT, TERMINADO_WD
from tfw.config.logs import logging
log = logging.getLogger(__name__)