mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 04:01:32 -06:00
WebHost: Move module into WebHostLib to prevent shadowing WebHost.py
This commit is contained in:
@@ -2,11 +2,11 @@ import os
|
||||
import multiprocessing
|
||||
import logging
|
||||
|
||||
from WebHost import app as raw_app
|
||||
from WebHostLib import app as raw_app
|
||||
from waitress import serve
|
||||
|
||||
from WebHost.models import db
|
||||
from WebHost.autolauncher import autohost
|
||||
from WebHostLib.models import db
|
||||
from WebHostLib.autolauncher import autohost
|
||||
|
||||
configpath = "config.yaml"
|
||||
|
||||
|
@@ -108,5 +108,5 @@ def host_room(room: UUID):
|
||||
return render_template("host_room.html", room=room)
|
||||
|
||||
|
||||
from WebHost.customserver import run_server_process
|
||||
from WebHostLib.customserver import run_server_process
|
||||
from . import tracker, upload, landing # to trigger app routing picking up on it
|
@@ -20,7 +20,7 @@ from Utils import get_public_ipv4, get_public_ipv6
|
||||
class CustomClientMessageProcessor(ClientMessageProcessor):
|
||||
ctx: WebHostContext
|
||||
def _cmd_video(self, platform, user):
|
||||
"""Set a link for your name in the WebHost tracker pointing to a video stream"""
|
||||
"""Set a link for your name in the WebHostLib tracker pointing to a video stream"""
|
||||
if platform.lower().startswith("t"): # twitch
|
||||
self.ctx.video[self.client.team, self.client.slot] = "Twitch", user
|
||||
self.ctx.save()
|
||||
@@ -45,7 +45,7 @@ class WebHostContext(Context):
|
||||
super(WebHostContext, self).__init__("", 0, "", 1, 40, True, "enabled", "enabled", 0)
|
||||
self.main_loop = asyncio.get_running_loop()
|
||||
self.video = {}
|
||||
self.tags = ["Berserker", "WebHost"]
|
||||
self.tags = ["Berserker", "WebHostLib"]
|
||||
|
||||
def listen_to_db_commands(self):
|
||||
cmdprocessor = DBCommandProcessor(self)
|
||||
@@ -139,4 +139,4 @@ def run_server_process(room_id, ponyconfig: dict):
|
||||
asyncio.run(main())
|
||||
|
||||
|
||||
from WebHost import LOGS_FOLDER
|
||||
from WebHostLib import LOGS_FOLDER
|
@@ -1,5 +1,5 @@
|
||||
from flask import render_template
|
||||
from WebHost import app, cache
|
||||
from WebHostLib import app, cache
|
||||
|
||||
|
||||
@cache.memoize(timeout=300)
|
@@ -7,7 +7,7 @@ import logging
|
||||
from uuid import UUID
|
||||
|
||||
import Items
|
||||
from WebHost import app, cache, Room
|
||||
from WebHostLib import app, cache, Room
|
||||
|
||||
|
||||
def get_id(item_name):
|
@@ -6,7 +6,7 @@ import logging
|
||||
from flask import request, flash, redirect, url_for, session, render_template
|
||||
from pony.orm import commit, select
|
||||
|
||||
from WebHost import app, allowed_file, Seed, Room, Patch
|
||||
from WebHostLib import app, allowed_file, Seed, Room, Patch
|
||||
|
||||
accepted_zip_contents = {"patches": ".bmbp",
|
||||
"spoiler": ".txt",
|
Reference in New Issue
Block a user