Refactor helpers to own directory

This commit is contained in:
amcmanu3 2024-08-11 13:31:55 -04:00
parent aaba6c6989
commit 9e5abe8014
39 changed files with 49 additions and 50 deletions

View File

@ -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__)

View File

@ -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__)

View File

@ -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

View File

@ -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

View File

@ -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__)

View File

@ -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

View File

@ -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__)

View File

@ -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__)

View File

@ -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

View File

@ -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__)

View File

@ -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

View File

@ -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__)

View File

@ -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

View File

@ -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__)

View File

@ -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

View File

@ -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__)

View File

@ -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__)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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__)

View File

@ -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__)

View File

@ -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 = {

View File

@ -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

View File

@ -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__)

View File

@ -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

View File

@ -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__)

View File

@ -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__)

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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()

View File

@ -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__)

View File

@ -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):

View File

@ -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__)

View File

@ -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