mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Refactor helpers to own directory
This commit is contained in:
parent
aaba6c6989
commit
9e5abe8014
@ -5,7 +5,7 @@ from prometheus_client import CollectorRegistry, Gauge
|
||||
|
||||
from app.classes.models.management import HelpersManagement, HelpersWebhooks
|
||||
from app.classes.models.servers import HelperServers
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -3,7 +3,7 @@ import typing as t
|
||||
|
||||
from app.classes.models.roles import HelperRoles
|
||||
from app.classes.models.server_permissions import PermissionsServers, RoleServers
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -6,13 +6,13 @@ import pathlib
|
||||
import typing as t
|
||||
|
||||
from app.classes.controllers.roles_controller import RolesController
|
||||
from app.classes.shared.file_helpers import FileHelpers
|
||||
from app.classes.helpers.file_helpers import FileHelpers
|
||||
|
||||
from app.classes.shared.singleton import Singleton
|
||||
from app.classes.shared.server import ServerInstance
|
||||
from app.classes.shared.console import Console
|
||||
from app.classes.shared.backup_mgr import BackupManager
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
from app.classes.shared.main_models import DatabaseShortcuts
|
||||
|
||||
from app.classes.minecraft.stats import Stats
|
||||
|
@ -14,7 +14,7 @@ import ssl
|
||||
import time
|
||||
import certifi
|
||||
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
from app.classes.shared.console import Console
|
||||
from app.classes.shared.websocket_manager import WebSocketManager
|
||||
|
@ -8,7 +8,7 @@ import requests
|
||||
|
||||
from app.classes.controllers.servers_controller import ServersController
|
||||
from app.classes.models.server_permissions import PermissionsServers
|
||||
from app.classes.shared.file_helpers import FileHelpers
|
||||
from app.classes.helpers.file_helpers import FileHelpers
|
||||
from app.classes.shared.websocket_manager import WebSocketManager
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -10,7 +10,7 @@ from app.classes.minecraft.mc_ping import ping
|
||||
from app.classes.models.management import HostStats
|
||||
from app.classes.models.servers import HelperServers
|
||||
from app.classes.shared.null_writer import NullWriter
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
|
||||
with redirect_stderr(NullWriter()):
|
||||
import psutil
|
||||
|
@ -16,7 +16,7 @@ from app.classes.models.base_model import BaseModel
|
||||
from app.classes.models.users import HelperUsers
|
||||
from app.classes.models.servers import Servers
|
||||
from app.classes.models.server_permissions import PermissionsServers
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
from app.classes.shared.websocket_manager import WebSocketManager
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -11,7 +11,7 @@ from peewee import (
|
||||
from playhouse.shortcuts import model_to_dict
|
||||
|
||||
from app.classes.models.base_model import BaseModel
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -4,7 +4,7 @@ import datetime
|
||||
from datetime import timedelta
|
||||
|
||||
from app.classes.models.servers import Servers, HelperServers
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
from app.classes.shared.main_models import DatabaseShortcuts
|
||||
from app.classes.shared.migration import MigrationManager
|
||||
|
||||
|
@ -13,7 +13,7 @@ from app.classes.shared.main_models import DatabaseShortcuts
|
||||
from app.classes.models.base_model import BaseModel
|
||||
|
||||
# from app.classes.models.users import Users
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -15,7 +15,7 @@ from peewee import (
|
||||
)
|
||||
from playhouse.shortcuts import model_to_dict
|
||||
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
from app.classes.models.base_model import BaseModel
|
||||
from app.classes.models.roles import Roles, HelperRoles
|
||||
|
||||
|
@ -14,7 +14,7 @@ from app.classes.models.management import HelpersManagement
|
||||
from app.classes.models.users import HelperUsers
|
||||
from app.classes.models.server_permissions import PermissionsServers
|
||||
from app.classes.shared.console import Console
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
from app.classes.shared.websocket_manager import WebSocketManager
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -7,7 +7,7 @@ import getpass
|
||||
from app.classes.shared.console import Console
|
||||
from app.classes.shared.import3 import Import3
|
||||
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
from app.classes.shared.tasks import TasksManager
|
||||
from app.classes.shared.migration import MigrationManager
|
||||
from app.classes.shared.main_controller import Controller
|
||||
|
@ -6,8 +6,8 @@ import threading
|
||||
|
||||
from app.classes.controllers.server_perms_controller import PermissionsServers
|
||||
from app.classes.controllers.servers_controller import ServersController
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.shared.file_helpers import FileHelpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
from app.classes.helpers.file_helpers import FileHelpers
|
||||
from app.classes.shared.websocket_manager import WebSocketManager
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -30,8 +30,8 @@ from app.classes.controllers.server_perms_controller import ServerPermsControlle
|
||||
from app.classes.controllers.servers_controller import ServersController
|
||||
from app.classes.shared.authentication import Authentication
|
||||
from app.classes.shared.console import Console
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.shared.file_helpers import FileHelpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
from app.classes.helpers.file_helpers import FileHelpers
|
||||
from app.classes.shared.import_helper import ImportHelpers
|
||||
from app.classes.minecraft.bigbucket import BigBucket
|
||||
from app.classes.shared.websocket_manager import WebSocketManager
|
||||
|
@ -1,7 +1,7 @@
|
||||
import logging
|
||||
from playhouse.shortcuts import model_to_dict
|
||||
|
||||
from app.classes.shared.helpers import Helpers # pylint: disable=unused-import
|
||||
from app.classes.helpers.helpers import Helpers # pylint: disable=unused-import
|
||||
from app.classes.shared.console import Console
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -17,7 +17,7 @@ from playhouse.migrate import (
|
||||
)
|
||||
|
||||
from app.classes.shared.console import Console
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -31,10 +31,9 @@ from app.classes.models.server_stats import HelperServerStats
|
||||
from app.classes.models.management import HelpersManagement, HelpersWebhooks
|
||||
from app.classes.models.users import HelperUsers
|
||||
from app.classes.models.server_permissions import PermissionsServers
|
||||
from app.classes.shared.backup_mgr import BackupManager
|
||||
from app.classes.shared.console import Console
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.shared.file_helpers import FileHelpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
from app.classes.helpers.file_helpers import FileHelpers
|
||||
from app.classes.shared.null_writer import NullWriter
|
||||
from app.classes.shared.websocket_manager import WebSocketManager
|
||||
from app.classes.web.webhooks.webhook_factory import WebhookFactory
|
||||
|
@ -16,8 +16,8 @@ from app.classes.models.management import HelpersManagement
|
||||
from app.classes.models.users import HelperUsers
|
||||
from app.classes.controllers.users_controller import UsersController
|
||||
from app.classes.shared.console import Console
|
||||
from app.classes.shared.file_helpers import FileHelpers
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.helpers.file_helpers import FileHelpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
from app.classes.shared.main_controller import Controller
|
||||
from app.classes.web.tornado_handler import Webserver
|
||||
from app.classes.shared.websocket_manager import WebSocketManager
|
||||
|
@ -8,8 +8,8 @@ import tornado.web
|
||||
from app.classes.models.crafty_permissions import EnumPermissionsCrafty
|
||||
from app.classes.models.server_permissions import EnumPermissionsServer
|
||||
from app.classes.models.users import ApiKeys
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.shared.file_helpers import FileHelpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
from app.classes.helpers.file_helpers import FileHelpers
|
||||
from app.classes.shared.main_controller import Controller
|
||||
from app.classes.shared.translation import Translation
|
||||
from app.classes.shared.main_models import DatabaseShortcuts
|
||||
|
@ -22,7 +22,7 @@ from app.classes.models.server_permissions import EnumPermissionsServer
|
||||
from app.classes.models.crafty_permissions import EnumPermissionsCrafty
|
||||
from app.classes.models.management import HelpersManagement
|
||||
from app.classes.controllers.roles_controller import RolesController
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
from app.classes.shared.main_models import DatabaseShortcuts
|
||||
from app.classes.web.base_handler import BaseHandler
|
||||
from app.classes.web.webhooks.webhook_factory import WebhookFactory
|
||||
|
@ -4,7 +4,7 @@ import nh3
|
||||
from jsonschema import validate
|
||||
from jsonschema.exceptions import ValidationError
|
||||
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
from app.classes.models.users import HelperUsers
|
||||
from app.classes.web.base_handler import BaseHandler
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import logging
|
||||
from app.classes.web.base_api_handler import BaseApiHandler
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -3,7 +3,7 @@ import json
|
||||
from jsonschema import validate
|
||||
from jsonschema.exceptions import ValidationError
|
||||
from app.classes.models.users import Users
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
from app.classes.web.base_api_handler import BaseApiHandler
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -3,7 +3,7 @@ import json
|
||||
from jsonschema import ValidationError, validate
|
||||
import orjson
|
||||
from playhouse.shortcuts import model_to_dict
|
||||
from app.classes.shared.file_helpers import FileHelpers
|
||||
from app.classes.helpers.file_helpers import FileHelpers
|
||||
from app.classes.web.base_api_handler import BaseApiHandler
|
||||
|
||||
config_json_schema = {
|
||||
|
@ -5,7 +5,7 @@ import html
|
||||
from jsonschema import validate
|
||||
from jsonschema.exceptions import ValidationError
|
||||
from app.classes.models.crafty_permissions import EnumPermissionsCrafty
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
from app.classes.web.base_api_handler import BaseApiHandler
|
||||
from app.classes.web.websocket_handler import WebSocketManager
|
||||
|
||||
|
@ -2,7 +2,7 @@ import os
|
||||
import logging
|
||||
import shutil
|
||||
from app.classes.models.server_permissions import EnumPermissionsServer
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
from app.classes.web.base_api_handler import BaseApiHandler
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -3,7 +3,7 @@ import os
|
||||
import json
|
||||
from app.classes.models.server_permissions import EnumPermissionsServer
|
||||
from app.classes.models.servers import Servers
|
||||
from app.classes.shared.file_helpers import FileHelpers
|
||||
from app.classes.helpers.file_helpers import FileHelpers
|
||||
from app.classes.web.base_api_handler import BaseApiHandler
|
||||
|
||||
|
||||
|
@ -5,9 +5,9 @@ from apscheduler.jobstores.base import JobLookupError
|
||||
from jsonschema import validate
|
||||
from jsonschema.exceptions import ValidationError
|
||||
from app.classes.models.server_permissions import EnumPermissionsServer
|
||||
from app.classes.shared.file_helpers import FileHelpers
|
||||
from app.classes.helpers.file_helpers import FileHelpers
|
||||
from app.classes.web.base_api_handler import BaseApiHandler
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -5,8 +5,8 @@ import html
|
||||
from jsonschema import validate
|
||||
from jsonschema.exceptions import ValidationError
|
||||
from app.classes.models.server_permissions import EnumPermissionsServer
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.shared.file_helpers import FileHelpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
from app.classes.helpers.file_helpers import FileHelpers
|
||||
from app.classes.web.base_api_handler import BaseApiHandler
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -4,7 +4,7 @@ import tornado.web
|
||||
import tornado.escape
|
||||
|
||||
from app.classes.models.crafty_permissions import EnumPermissionsCrafty
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
from app.classes.shared.main_models import DatabaseShortcuts
|
||||
from app.classes.web.base_handler import BaseHandler
|
||||
|
||||
|
@ -4,7 +4,7 @@ try:
|
||||
import tornado.web
|
||||
|
||||
except ModuleNotFoundError as e:
|
||||
from app.classes.shared.helpers import helper
|
||||
from app.classes.helpers.helpers import helper
|
||||
|
||||
helper.auto_installer_fix(e)
|
||||
|
||||
|
@ -13,8 +13,8 @@ import tornado.httpserver
|
||||
|
||||
from app.classes.models.management import HelpersManagement
|
||||
from app.classes.shared.console import Console
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.shared.file_helpers import FileHelpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
from app.classes.helpers.file_helpers import FileHelpers
|
||||
from app.classes.shared.main_controller import Controller
|
||||
from app.classes.web.public_handler import PublicHandler
|
||||
from app.classes.web.panel_handler import PanelHandler
|
||||
|
@ -2,7 +2,7 @@ from abc import ABC, abstractmethod
|
||||
import logging
|
||||
import requests
|
||||
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
helper = Helpers()
|
||||
|
@ -5,7 +5,7 @@ from urllib.parse import parse_qsl
|
||||
import tornado.websocket
|
||||
|
||||
from app.classes.shared.main_controller import Controller
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
from app.classes.shared.websocket_manager import WebSocketManager
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -1,6 +1,6 @@
|
||||
import peewee
|
||||
import datetime
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
|
||||
|
||||
def migrate(migrator, database, **kwargs):
|
||||
|
@ -5,10 +5,10 @@ import peewee
|
||||
import logging
|
||||
|
||||
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
from app.classes.shared.console import Console
|
||||
from app.classes.shared.migration import Migrator
|
||||
from app.classes.shared.file_helpers import FileHelpers
|
||||
from app.classes.helpers.file_helpers import FileHelpers
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
4
main.py
4
main.py
@ -9,10 +9,10 @@ import signal
|
||||
import peewee
|
||||
from packaging import version as pkg_version
|
||||
|
||||
from app.classes.shared.file_helpers import FileHelpers
|
||||
from app.classes.helpers.file_helpers import FileHelpers
|
||||
from app.classes.shared.import3 import Import3
|
||||
from app.classes.shared.console import Console
|
||||
from app.classes.shared.helpers import Helpers
|
||||
from app.classes.helpers.helpers import Helpers
|
||||
from app.classes.models.users import HelperUsers
|
||||
from app.classes.models.management import HelpersManagement
|
||||
from app.classes.shared.import_helper import ImportHelpers
|
||||
|
Loading…
Reference in New Issue
Block a user