def get_tempo_recommendations(self, seed_tracks):
        seed_tracks_id = ""
        for seed_track in seed_tracks:
            seed_tracks_id += seed_track.id + ","
        seed_tracks_id = seed_tracks_id[:-1]

        url = f"https://api.spotify.com/v1/audio-features?ids={seed_tracks_id}"
        response = self._place_get_api_request(url)
        response_json = response.json()

        tempo_audio = [Tempo(tempo["tempo"]) for tempo in response_json["audio_features"]]

        return tempo_audio
Exemple #2
0
from os import system
from tempo import Tempo
from time import sleep
import random as rd
tempo = Tempo()


class Personagem():
    def __init__(self):
        self.__energia = 100
        self.__energiaMax = 100
        self.__dinheiro = 100
        self.__salario = 0
        self.__expHtml = 0
        self.__expJava = 0
        self.__trabalhoDia = 0
        self.nivel = "Sem experiência"
        self.trabalho = False
        self.__contaBanco = 0
        self.carregamento = "[-----------------]"

    def __str__(self):
        return f'\nStatus do personagem:\n\nExperiência HTML: {self.expHtml}\nExperiência Java: {self.expJava}\nNível: {self.nivel}'

    # ENCAPSULAMENTO
    @property
    def energia(self):
        return self.__energia

    @property
    def energiaMax(self):
Exemple #3
0
# Set this variable to "threading", "eventlet" or "gevent" to test the
# different async modes, or leave it set to None for the applicationlication to choose
# the best option based on installed packages.
async_mode = None

application = Flask(__name__, static_folder='../build', static_url_path='/')
application.config['SECRET_KEY'] = 'secret!'
cors = CORS(application)
application.config['CORS_HEADERS'] = "Content-Type"

socketio = SocketIO(application,
                    logger=True,
                    binary=True,
                    cors_allowed_origins="*")

tempo_obj = Tempo()
volume_obj = Volume()


@application.route('/')
def index():
    return application.send_static_file('index.html')


@socketio.on('connect', namespace="/test")
def connect():
    session['local_tempos'] = []
    session['local_volumes'] = []
    emit('server_response', {'data': 'connected'})