Merge pull request #59 from ThomasRubini/truthinquiry
2
app.py
@ -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()
|
||||
|
@ -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):
|
||||
|
@ -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="/")
|
@ -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)
|
@ -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
|
@ -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")
|
@ -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__)
|
@ -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')
|
Before Width: | Height: | Size: 20 MiB After Width: | Height: | Size: 20 MiB |
Before Width: | Height: | Size: 305 B After Width: | Height: | Size: 305 B |
Before Width: | Height: | Size: 185 KiB After Width: | Height: | Size: 185 KiB |
Before Width: | Height: | Size: 178 KiB After Width: | Height: | Size: 178 KiB |
Before Width: | Height: | Size: 177 KiB After Width: | Height: | Size: 177 KiB |
Before Width: | Height: | Size: 179 KiB After Width: | Height: | Size: 179 KiB |
Before Width: | Height: | Size: 180 KiB After Width: | Height: | Size: 180 KiB |
Before Width: | Height: | Size: 185 KiB After Width: | Height: | Size: 185 KiB |
Before Width: | Height: | Size: 148 KiB After Width: | Height: | Size: 148 KiB |
Before Width: | Height: | Size: 145 KiB After Width: | Height: | Size: 145 KiB |
Before Width: | Height: | Size: 144 KiB After Width: | Height: | Size: 144 KiB |
Before Width: | Height: | Size: 145 KiB After Width: | Height: | Size: 145 KiB |
Before Width: | Height: | Size: 146 KiB After Width: | Height: | Size: 146 KiB |
Before Width: | Height: | Size: 146 KiB After Width: | Height: | Size: 146 KiB |
Before Width: | Height: | Size: 147 KiB After Width: | Height: | Size: 147 KiB |
Before Width: | Height: | Size: 143 KiB After Width: | Height: | Size: 143 KiB |
Before Width: | Height: | Size: 141 KiB After Width: | Height: | Size: 141 KiB |
Before Width: | Height: | Size: 150 KiB After Width: | Height: | Size: 150 KiB |
Before Width: | Height: | Size: 147 KiB After Width: | Height: | Size: 147 KiB |
Before Width: | Height: | Size: 149 KiB After Width: | Height: | Size: 149 KiB |
Before Width: | Height: | Size: 199 KiB After Width: | Height: | Size: 199 KiB |
Before Width: | Height: | Size: 201 KiB After Width: | Height: | Size: 201 KiB |
Before Width: | Height: | Size: 199 KiB After Width: | Height: | Size: 199 KiB |
Before Width: | Height: | Size: 199 KiB After Width: | Height: | Size: 199 KiB |
Before Width: | Height: | Size: 202 KiB After Width: | Height: | Size: 202 KiB |
Before Width: | Height: | Size: 201 KiB After Width: | Height: | Size: 201 KiB |
Before Width: | Height: | Size: 228 KiB After Width: | Height: | Size: 228 KiB |
Before Width: | Height: | Size: 229 KiB After Width: | Height: | Size: 229 KiB |
Before Width: | Height: | Size: 226 KiB After Width: | Height: | Size: 226 KiB |
Before Width: | Height: | Size: 232 KiB After Width: | Height: | Size: 232 KiB |
Before Width: | Height: | Size: 230 KiB After Width: | Height: | Size: 230 KiB |
Before Width: | Height: | Size: 231 KiB After Width: | Height: | Size: 231 KiB |
Before Width: | Height: | Size: 193 KiB After Width: | Height: | Size: 193 KiB |
Before Width: | Height: | Size: 194 KiB After Width: | Height: | Size: 194 KiB |
Before Width: | Height: | Size: 192 KiB After Width: | Height: | Size: 192 KiB |
Before Width: | Height: | Size: 200 KiB After Width: | Height: | Size: 200 KiB |
Before Width: | Height: | Size: 194 KiB After Width: | Height: | Size: 194 KiB |
Before Width: | Height: | Size: 198 KiB After Width: | Height: | Size: 198 KiB |
Before Width: | Height: | Size: 174 KiB After Width: | Height: | Size: 174 KiB |
Before Width: | Height: | Size: 176 KiB After Width: | Height: | Size: 176 KiB |
Before Width: | Height: | Size: 174 KiB After Width: | Height: | Size: 174 KiB |
Before Width: | Height: | Size: 179 KiB After Width: | Height: | Size: 179 KiB |
Before Width: | Height: | Size: 176 KiB After Width: | Height: | Size: 176 KiB |
Before Width: | Height: | Size: 177 KiB After Width: | Height: | Size: 177 KiB |
Before Width: | Height: | Size: 127 KiB After Width: | Height: | Size: 127 KiB |
Before Width: | Height: | Size: 132 KiB After Width: | Height: | Size: 132 KiB |
Before Width: | Height: | Size: 126 KiB After Width: | Height: | Size: 126 KiB |
Before Width: | Height: | Size: 132 KiB After Width: | Height: | Size: 132 KiB |
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 129 KiB |
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 130 KiB |
Before Width: | Height: | Size: 7.1 MiB After Width: | Height: | Size: 7.1 MiB |
Before Width: | Height: | Size: 7.2 MiB After Width: | Height: | Size: 7.2 MiB |
Before Width: | Height: | Size: 602 KiB After Width: | Height: | Size: 602 KiB |
Before Width: | Height: | Size: 414 B After Width: | Height: | Size: 414 B |