style corrections
This commit is contained in:
parent
7da002eb00
commit
f1a57c16e4
|
@ -5,6 +5,7 @@ from apscheduler.schedulers.background import BackgroundScheduler
|
||||||
from tlapbot.db import get_db
|
from tlapbot.db import get_db
|
||||||
from tlapbot.owncast_requests import is_stream_live, give_points_to_chat
|
from tlapbot.owncast_requests import is_stream_live, give_points_to_chat
|
||||||
|
|
||||||
|
|
||||||
def create_app(test_config=None):
|
def create_app(test_config=None):
|
||||||
app = Flask(__name__, instance_relative_config=True)
|
app = Flask(__name__, instance_relative_config=True)
|
||||||
|
|
||||||
|
@ -41,7 +42,6 @@ def create_app(test_config=None):
|
||||||
app.logger.warning(f"Redeem '{redeem}' has spaces in its name.")
|
app.logger.warning(f"Redeem '{redeem}' has spaces in its name.")
|
||||||
app.logger.warning("Redeems with spaces are impossible to redeem.")
|
app.logger.warning("Redeems with spaces are impossible to redeem.")
|
||||||
|
|
||||||
|
|
||||||
# prepare webhooks and redeem dashboard blueprints
|
# prepare webhooks and redeem dashboard blueprints
|
||||||
from . import owncast_webhooks
|
from . import owncast_webhooks
|
||||||
from . import tlapbot_dashboard
|
from . import tlapbot_dashboard
|
||||||
|
|
|
@ -6,6 +6,7 @@ from flask.cli import with_appcontext
|
||||||
|
|
||||||
from tlapbot.redeems import milestone_complete
|
from tlapbot.redeems import milestone_complete
|
||||||
|
|
||||||
|
|
||||||
def get_db():
|
def get_db():
|
||||||
if 'db' not in g:
|
if 'db' not in g:
|
||||||
g.db = sqlite3.connect(
|
g.db = sqlite3.connect(
|
||||||
|
@ -127,7 +128,7 @@ def refresh_milestones():
|
||||||
|
|
||||||
|
|
||||||
def reset_milestone(milestone):
|
def reset_milestone(milestone):
|
||||||
if not milestone in current_app.config['REDEEMS']:
|
if milestone not in current_app.config['REDEEMS']:
|
||||||
print(f"Failed resetting milestone, {milestone} not in redeems file.")
|
print(f"Failed resetting milestone, {milestone} not in redeems file.")
|
||||||
return False
|
return False
|
||||||
try:
|
try:
|
||||||
|
@ -147,7 +148,6 @@ def reset_milestone(milestone):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@click.command('init-db')
|
@click.command('init-db')
|
||||||
@with_appcontext
|
@with_appcontext
|
||||||
def init_db_command():
|
def init_db_command():
|
||||||
|
|
|
@ -2,6 +2,7 @@ from flask import current_app
|
||||||
from sqlite3 import Error
|
from sqlite3 import Error
|
||||||
from re import sub
|
from re import sub
|
||||||
|
|
||||||
|
|
||||||
# # # db stuff # # #
|
# # # db stuff # # #
|
||||||
def read_users_points(db, user_id):
|
def read_users_points(db, user_id):
|
||||||
"""Errors out if user doesn't exist."""
|
"""Errors out if user doesn't exist."""
|
||||||
|
|
|
@ -45,4 +45,3 @@ def send_chat(message):
|
||||||
current_app.logger.error(f"Check owncast instance url and access key.")
|
current_app.logger.error(f"Check owncast instance url and access key.")
|
||||||
return
|
return
|
||||||
return r.json()
|
return r.json()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue