Merge pull request #59 from ThomasRubini/truthinquiry

This commit is contained in:
Thomas Rubini 2023-01-16 14:38:37 +01:00 committed by GitHub
commit 11a85a0a45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
99 changed files with 18 additions and 18 deletions

2
app.py
View File

@ -2,7 +2,7 @@
from dotenv import load_dotenv
load_dotenv()
from truthseeker import APP as app # the variable 'app' is detected by `flask run`
from truthinquiry import APP as app # the variable 'app' is detected by `flask run`
if __name__ == "__main__":
app.run()

View File

@ -6,7 +6,7 @@ from dotenv import load_dotenv
# Load dotenv file
load_dotenv()
from truthseeker import APP
from truthinquiry import APP
test_app = APP.test_client()
class TestException(Exception):

View File

@ -3,10 +3,10 @@ import os
import flask
from flask_socketio import SocketIO
from truthseeker import discord_bot
from truthinquiry import discord_bot
class TruthSeekerApp(flask.Flask):
class TruthInquiryApp(flask.Flask):
"""
Main class of the app
A single instance 'APP' of this class will be created and shared across the files
@ -17,7 +17,7 @@ class TruthSeekerApp(flask.Flask):
"""
def __init__(self):
super().__init__("truthseeker")
super().__init__("truthinquiry")
self.games_list = {}
@ -35,9 +35,9 @@ class TruthSeekerApp(flask.Flask):
else:
print("No token set. Not starting discord bot")
APP = TruthSeekerApp()
APP = TruthInquiryApp()
from truthseeker.routes import routes_api, routes_ui, routes_socketio
from truthinquiry.routes import routes_api, routes_ui, routes_socketio
APP.register_blueprint(routes_api.routes_api, url_prefix="/api/v1")
APP.register_blueprint(routes_ui.routes_ui, url_prefix="/")

View File

@ -2,7 +2,7 @@ import threading
import asyncio
import discord
import truthseeker
import truthinquiry
class DiscordBot:
@ -56,7 +56,7 @@ class DiscordBot:
"""
Update the bot's status using the app's current context
"""
games_n = len(truthseeker.APP.games_list)
games_n = len(truthinquiry.APP.games_list)
activity_name = f"Handling {games_n} game{'' if games_n==1 else 's'} !"
activity = discord.Activity(name=activity_name, type=discord.ActivityType.watching)
await self.bot.change_presence(activity=activity)

View File

@ -1,6 +1,6 @@
import os
import random
import truthseeker.logic.data_persistance.tables as tables
import truthinquiry.logic.data_persistance.tables as tables
from sqlalchemy import create_engine
from sqlalchemy.orm import Session

View File

@ -2,8 +2,8 @@ import string
import random
from typing import Union
from truthseeker.logic.data_persistance.data_access import *
from truthseeker import APP
from truthinquiry.logic.data_persistance.data_access import *
from truthinquiry import APP
def random_string(length: int) -> str:
@ -131,7 +131,7 @@ class Game:
if npc_id not in self.reaction_table:
return 0
reaction_id = self.reaction_table[npc_id]
return read_image(f"./truthseeker/static/images/npc/{npc_id}/{reaction_id}.png")
return read_image(f"./truthinquiry/static/images/npc/{npc_id}/{reaction_id}.png")
def get_player_results(self, responses: dict) -> Union[dict, None]:
"""
@ -321,4 +321,4 @@ def get_npc_image(npc_id: int):
:param npc_id: npc to get the neutral image from
:return: the byte representation of the image, none if its not found or not readable
"""
return read_image(f"./truthseeker/static/images/npc/{npc_id}/0.png")
return read_image(f"./truthinquiry/static/images/npc/{npc_id}/0.png")

View File

@ -1,8 +1,8 @@
import json
import flask
from truthseeker import APP
from truthseeker.logic import game_logic
from truthinquiry import APP
from truthinquiry.logic import game_logic
routes_api = flask.Blueprint("api", __name__)

View File

@ -2,8 +2,8 @@ import socketio
from flask_socketio import join_room
from truthseeker import APP
from truthseeker.logic import game_logic
from truthinquiry import APP
from truthinquiry.logic import game_logic
@APP.socketio_app.on('connect')

View File

Before

Width:  |  Height:  |  Size: 20 MiB

After

Width:  |  Height:  |  Size: 20 MiB

View File

Before

Width:  |  Height:  |  Size: 305 B

After

Width:  |  Height:  |  Size: 305 B

View File

Before

Width:  |  Height:  |  Size: 185 KiB

After

Width:  |  Height:  |  Size: 185 KiB

View File

Before

Width:  |  Height:  |  Size: 178 KiB

After

Width:  |  Height:  |  Size: 178 KiB

View File

Before

Width:  |  Height:  |  Size: 177 KiB

After

Width:  |  Height:  |  Size: 177 KiB

View File

Before

Width:  |  Height:  |  Size: 179 KiB

After

Width:  |  Height:  |  Size: 179 KiB

View File

Before

Width:  |  Height:  |  Size: 180 KiB

After

Width:  |  Height:  |  Size: 180 KiB

View File

Before

Width:  |  Height:  |  Size: 185 KiB

After

Width:  |  Height:  |  Size: 185 KiB

View File

Before

Width:  |  Height:  |  Size: 148 KiB

After

Width:  |  Height:  |  Size: 148 KiB

View File

Before

Width:  |  Height:  |  Size: 145 KiB

After

Width:  |  Height:  |  Size: 145 KiB

View File

Before

Width:  |  Height:  |  Size: 144 KiB

After

Width:  |  Height:  |  Size: 144 KiB

View File

Before

Width:  |  Height:  |  Size: 145 KiB

After

Width:  |  Height:  |  Size: 145 KiB

View File

Before

Width:  |  Height:  |  Size: 146 KiB

After

Width:  |  Height:  |  Size: 146 KiB

View File

Before

Width:  |  Height:  |  Size: 146 KiB

After

Width:  |  Height:  |  Size: 146 KiB

View File

Before

Width:  |  Height:  |  Size: 147 KiB

After

Width:  |  Height:  |  Size: 147 KiB

View File

Before

Width:  |  Height:  |  Size: 143 KiB

After

Width:  |  Height:  |  Size: 143 KiB

View File

Before

Width:  |  Height:  |  Size: 141 KiB

After

Width:  |  Height:  |  Size: 141 KiB

View File

Before

Width:  |  Height:  |  Size: 150 KiB

After

Width:  |  Height:  |  Size: 150 KiB

View File

Before

Width:  |  Height:  |  Size: 147 KiB

After

Width:  |  Height:  |  Size: 147 KiB

View File

Before

Width:  |  Height:  |  Size: 149 KiB

After

Width:  |  Height:  |  Size: 149 KiB

View File

Before

Width:  |  Height:  |  Size: 199 KiB

After

Width:  |  Height:  |  Size: 199 KiB

View File

Before

Width:  |  Height:  |  Size: 201 KiB

After

Width:  |  Height:  |  Size: 201 KiB

View File

Before

Width:  |  Height:  |  Size: 199 KiB

After

Width:  |  Height:  |  Size: 199 KiB

View File

Before

Width:  |  Height:  |  Size: 199 KiB

After

Width:  |  Height:  |  Size: 199 KiB

View File

Before

Width:  |  Height:  |  Size: 202 KiB

After

Width:  |  Height:  |  Size: 202 KiB

View File

Before

Width:  |  Height:  |  Size: 201 KiB

After

Width:  |  Height:  |  Size: 201 KiB

View File

Before

Width:  |  Height:  |  Size: 228 KiB

After

Width:  |  Height:  |  Size: 228 KiB

View File

Before

Width:  |  Height:  |  Size: 229 KiB

After

Width:  |  Height:  |  Size: 229 KiB

View File

Before

Width:  |  Height:  |  Size: 226 KiB

After

Width:  |  Height:  |  Size: 226 KiB

View File

Before

Width:  |  Height:  |  Size: 232 KiB

After

Width:  |  Height:  |  Size: 232 KiB

View File

Before

Width:  |  Height:  |  Size: 230 KiB

After

Width:  |  Height:  |  Size: 230 KiB

View File

Before

Width:  |  Height:  |  Size: 231 KiB

After

Width:  |  Height:  |  Size: 231 KiB

View File

Before

Width:  |  Height:  |  Size: 193 KiB

After

Width:  |  Height:  |  Size: 193 KiB

View File

Before

Width:  |  Height:  |  Size: 194 KiB

After

Width:  |  Height:  |  Size: 194 KiB

View File

Before

Width:  |  Height:  |  Size: 192 KiB

After

Width:  |  Height:  |  Size: 192 KiB

View File

Before

Width:  |  Height:  |  Size: 200 KiB

After

Width:  |  Height:  |  Size: 200 KiB

View File

Before

Width:  |  Height:  |  Size: 194 KiB

After

Width:  |  Height:  |  Size: 194 KiB

View File

Before

Width:  |  Height:  |  Size: 198 KiB

After

Width:  |  Height:  |  Size: 198 KiB

View File

Before

Width:  |  Height:  |  Size: 174 KiB

After

Width:  |  Height:  |  Size: 174 KiB

View File

Before

Width:  |  Height:  |  Size: 176 KiB

After

Width:  |  Height:  |  Size: 176 KiB

View File

Before

Width:  |  Height:  |  Size: 174 KiB

After

Width:  |  Height:  |  Size: 174 KiB

View File

Before

Width:  |  Height:  |  Size: 179 KiB

After

Width:  |  Height:  |  Size: 179 KiB

View File

Before

Width:  |  Height:  |  Size: 176 KiB

After

Width:  |  Height:  |  Size: 176 KiB

View File

Before

Width:  |  Height:  |  Size: 177 KiB

After

Width:  |  Height:  |  Size: 177 KiB

View File

Before

Width:  |  Height:  |  Size: 127 KiB

After

Width:  |  Height:  |  Size: 127 KiB

View File

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 132 KiB

View File

Before

Width:  |  Height:  |  Size: 126 KiB

After

Width:  |  Height:  |  Size: 126 KiB

View File

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 132 KiB

View File

Before

Width:  |  Height:  |  Size: 129 KiB

After

Width:  |  Height:  |  Size: 129 KiB

View File

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 130 KiB

View File

Before

Width:  |  Height:  |  Size: 7.1 MiB

After

Width:  |  Height:  |  Size: 7.1 MiB

View File

Before

Width:  |  Height:  |  Size: 7.2 MiB

After

Width:  |  Height:  |  Size: 7.2 MiB

View File

Before

Width:  |  Height:  |  Size: 602 KiB

After

Width:  |  Height:  |  Size: 602 KiB

View File

Before

Width:  |  Height:  |  Size: 414 B

After

Width:  |  Height:  |  Size: 414 B