WebHost: Move module into WebHostLib to prevent shadowing WebHost.py

This commit is contained in:
Berserker66 2020-07-11 16:59:37 +02:00
parent b06f528f72
commit cdee9e5a3a
18 changed files with 10 additions and 10 deletions

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
from flask import render_template
from WebHost import app, cache
from WebHostLib import app, cache
@cache.memoize(timeout=300)

View File

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

View File

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