mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 13:51:33 +00:00
Refactor project structure
This commit is contained in:
parent
23cc381495
commit
0d41b4c8e9
@ -1,6 +1,6 @@
|
||||
import json
|
||||
|
||||
from server_connector import ServerConnector
|
||||
from .networking.server_connector import ServerConnector
|
||||
|
||||
|
||||
class EventHandlerBase:
|
@ -1,7 +1,7 @@
|
||||
import json
|
||||
from datetime import datetime
|
||||
|
||||
from server_connector import ServerUplinkConnector
|
||||
from .networking.server_connector import ServerUplinkConnector
|
||||
|
||||
|
||||
class MessageSender:
|
@ -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()
|
@ -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()
|
||||
|
@ -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__)
|
||||
|
||||
|
@ -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):
|
@ -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
|
||||
|
||||
|
||||
|
@ -1 +0,0 @@
|
||||
from .zmq_websocket_handler import FSMManagingSocketHandler
|
@ -1,4 +1,4 @@
|
||||
from fsm_base import FSMBase
|
||||
from tfw.fsm_base import FSMBase
|
||||
|
||||
|
||||
class SQLInjectionFSM(FSMBase):
|
||||
|
@ -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):
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
@ -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__)
|
||||
|
||||
|
||||
|
@ -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__)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user