remove some linting warnings
This commit is contained in:
parent
4a889aa559
commit
f682d39c5a
@ -1,9 +1,11 @@
|
|||||||
import flask
|
|
||||||
from flask_socketio import SocketIO
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
import flask
|
||||||
|
from flask_socketio import SocketIO
|
||||||
|
|
||||||
from truthseeker import discord_bot
|
from truthseeker import discord_bot
|
||||||
|
|
||||||
|
|
||||||
class TruthSeekerApp(flask.Flask):
|
class TruthSeekerApp(flask.Flask):
|
||||||
"""
|
"""
|
||||||
Main class of the app
|
Main class of the app
|
||||||
@ -26,14 +28,10 @@ class TruthSeekerApp(flask.Flask):
|
|||||||
self.discord_bot = discord_bot.DiscordBot()
|
self.discord_bot = discord_bot.DiscordBot()
|
||||||
token = os.getenv("DISCORD_BOT_TOKEN")
|
token = os.getenv("DISCORD_BOT_TOKEN")
|
||||||
if token:
|
if token:
|
||||||
pass
|
|
||||||
self.discord_bot.start(token)
|
self.discord_bot.start(token)
|
||||||
else:
|
else:
|
||||||
print("No token set. Not starting discord bot")
|
print("No token set. Not starting discord bot")
|
||||||
|
|
||||||
def run_app(self):
|
|
||||||
self.socketio_app.run(self)
|
|
||||||
|
|
||||||
APP = TruthSeekerApp()
|
APP = TruthSeekerApp()
|
||||||
|
|
||||||
from truthseeker.routes import routes_api, routes_ui, routes_socketio
|
from truthseeker.routes import routes_api, routes_ui, routes_socketio
|
||||||
|
@ -1,14 +1,17 @@
|
|||||||
import discord
|
|
||||||
import threading
|
import threading
|
||||||
import truthseeker
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
|
import discord
|
||||||
|
import truthseeker
|
||||||
|
|
||||||
|
|
||||||
class DiscordBot:
|
class DiscordBot:
|
||||||
"""
|
"""
|
||||||
Wrapper around a discord bot, providing utility methods to interact with it
|
Wrapper around a discord bot, providing utility methods to interact with it
|
||||||
|
|
||||||
:attr Client bot: the underlying discord bot from discord.py
|
:attr Client bot: the underlying discord bot from discord.py
|
||||||
:attr TextChannel __channel__: the channel used by the bot to send messages
|
:attr TextChannel __channel__: the channel used by the bot to send messages
|
||||||
|
:attr event_loop: event_loop used by discord.py. Used to schedule tasks from another thread
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
from sqlalchemy import Column, Integer, Text, ForeignKey, VARCHAR
|
from sqlalchemy import Column, Integer, Text, ForeignKey, VARCHAR
|
||||||
from sqlalchemy.orm import declarative_base, relationship
|
from sqlalchemy.orm import declarative_base, relationship
|
||||||
|
|
||||||
Base = declarative_base()
|
|
||||||
|
|
||||||
|
Base = declarative_base()
|
||||||
|
|
||||||
class Locale(Base):
|
class Locale(Base):
|
||||||
__tablename__ = 'T_LOCALE'
|
__tablename__ = 'T_LOCALE'
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import string
|
import string
|
||||||
import random
|
import random
|
||||||
|
from typing import Union
|
||||||
|
|
||||||
from truthseeker.logic.data_persistance.data_access import *
|
from truthseeker.logic.data_persistance.data_access import *
|
||||||
from datetime import datetime, timedelta
|
|
||||||
from truthseeker import APP
|
from truthseeker import APP
|
||||||
from typing import Union, Optional
|
|
||||||
|
|
||||||
def random_string(length: int) ->str:
|
def random_string(length: int) ->str:
|
||||||
"""
|
"""
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
import flask
|
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
import flask
|
||||||
|
|
||||||
from truthseeker import APP
|
from truthseeker import APP
|
||||||
from truthseeker.logic import game_logic
|
from truthseeker.logic import game_logic
|
||||||
|
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
from flask_socketio import join_room
|
|
||||||
import socketio
|
import socketio
|
||||||
|
|
||||||
|
from flask_socketio import join_room
|
||||||
|
|
||||||
from truthseeker import APP
|
from truthseeker import APP
|
||||||
from truthseeker.logic import game_logic
|
from truthseeker.logic import game_logic
|
||||||
|
|
||||||
|
|
||||||
@APP.socketio_app.on('connect')
|
@APP.socketio_app.on('connect')
|
||||||
def connect(auth):
|
def connect(auth):
|
||||||
if not (auth and "game_id" in auth):
|
if not (auth and "game_id" in auth):
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
import flask
|
import flask
|
||||||
|
|
||||||
from truthseeker.logic import game_logic
|
|
||||||
|
|
||||||
|
|
||||||
routes_ui = flask.Blueprint("ui", __name__)
|
routes_ui = flask.Blueprint("ui", __name__)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user