WebHost: Move module into WebHostLib to prevent shadowing WebHost.py
This commit is contained in:
parent
b06f528f72
commit
cdee9e5a3a
|
@ -2,11 +2,11 @@ import os
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from WebHost import app as raw_app
|
from WebHostLib import app as raw_app
|
||||||
from waitress import serve
|
from waitress import serve
|
||||||
|
|
||||||
from WebHost.models import db
|
from WebHostLib.models import db
|
||||||
from WebHost.autolauncher import autohost
|
from WebHostLib.autolauncher import autohost
|
||||||
|
|
||||||
configpath = "config.yaml"
|
configpath = "config.yaml"
|
||||||
|
|
||||||
|
|
|
@ -108,5 +108,5 @@ def host_room(room: UUID):
|
||||||
return render_template("host_room.html", room=room)
|
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
|
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):
|
class CustomClientMessageProcessor(ClientMessageProcessor):
|
||||||
ctx: WebHostContext
|
ctx: WebHostContext
|
||||||
def _cmd_video(self, platform, user):
|
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
|
if platform.lower().startswith("t"): # twitch
|
||||||
self.ctx.video[self.client.team, self.client.slot] = "Twitch", user
|
self.ctx.video[self.client.team, self.client.slot] = "Twitch", user
|
||||||
self.ctx.save()
|
self.ctx.save()
|
||||||
|
@ -45,7 +45,7 @@ class WebHostContext(Context):
|
||||||
super(WebHostContext, self).__init__("", 0, "", 1, 40, True, "enabled", "enabled", 0)
|
super(WebHostContext, self).__init__("", 0, "", 1, 40, True, "enabled", "enabled", 0)
|
||||||
self.main_loop = asyncio.get_running_loop()
|
self.main_loop = asyncio.get_running_loop()
|
||||||
self.video = {}
|
self.video = {}
|
||||||
self.tags = ["Berserker", "WebHost"]
|
self.tags = ["Berserker", "WebHostLib"]
|
||||||
|
|
||||||
def listen_to_db_commands(self):
|
def listen_to_db_commands(self):
|
||||||
cmdprocessor = DBCommandProcessor(self)
|
cmdprocessor = DBCommandProcessor(self)
|
||||||
|
@ -139,4 +139,4 @@ def run_server_process(room_id, ponyconfig: dict):
|
||||||
asyncio.run(main())
|
asyncio.run(main())
|
||||||
|
|
||||||
|
|
||||||
from WebHost import LOGS_FOLDER
|
from WebHostLib import LOGS_FOLDER
|
|
@ -1,5 +1,5 @@
|
||||||
from flask import render_template
|
from flask import render_template
|
||||||
from WebHost import app, cache
|
from WebHostLib import app, cache
|
||||||
|
|
||||||
|
|
||||||
@cache.memoize(timeout=300)
|
@cache.memoize(timeout=300)
|
|
@ -7,7 +7,7 @@ import logging
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
import Items
|
import Items
|
||||||
from WebHost import app, cache, Room
|
from WebHostLib import app, cache, Room
|
||||||
|
|
||||||
|
|
||||||
def get_id(item_name):
|
def get_id(item_name):
|
|
@ -6,7 +6,7 @@ import logging
|
||||||
from flask import request, flash, redirect, url_for, session, render_template
|
from flask import request, flash, redirect, url_for, session, render_template
|
||||||
from pony.orm import commit, select
|
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",
|
accepted_zip_contents = {"patches": ".bmbp",
|
||||||
"spoiler": ".txt",
|
"spoiler": ".txt",
|
Loading…
Reference in New Issue