Exemple #1
0
import base64

from mysqldb import Mysql
from influx import Influx
from addPlayer import addPlayer
from addMatches import addMatches
from createPieChart import createPieChart
from config import dbPlayersLayout
from dbCredentials import token, org, url, bucket, host, user, password, database

# --------------- ON START ACTIONS ---------------

app = dash.Dash(__name__, title='Faceit Stats')

# initialize database connections
db = Mysql(host=host, user=user, password=password, database=database)
influx = Influx(token=token, org=org, bucket=bucket, url=url)

# check if table 'players' exists
result = db.checkIfTableExists('players')
if not result:
    db.addTable(dbPlayersLayout)

# select all names from the 'players' table
players = db.select('players', None, 'name')

# ------------------ APP LAYOUT ------------------

app.layout = html.Div([
    html.H1("Analyze your Faceit CS:GO Statistics and compare it with others!",
            style={"color": "#fff"}),
Exemple #2
0
def test_database():
    ''' Returns a MySql DB object '''
    return Mysql(host=host, user=user, password=password, database=database)
def test_database():
    ''' Returns a MySql DB object '''
    return Mysql(host="localhost", user="******", password="******", database="faceit")
Exemple #4
0
def test_error_database():
    ''' Returns a faulty MySql DB object '''
    return Mysql(host="these", user="******", password="******", database="wrong")