remove some linting warnings

This commit is contained in:
Thomas Rubini 2023-01-13 13:32:41 +01:00
parent 4a889aa559
commit f682d39c5a
No known key found for this signature in database
GPG Key ID: C7D287C8C1CAC373
7 changed files with 18 additions and 15 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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