-
Notifications
You must be signed in to change notification settings - Fork 2
/
server.py
55 lines (47 loc) · 1.59 KB
/
server.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
from bottle import get, view, route, run, template, static_file
from gerador.geradorjogo import GeradorJogo
from analise.analisador import analisador
from pergunta.pergunta import pergunta
import sys
sys.path.append('analise/')
sys.path.append('base_dados/')
sys.path.append('importador/')
sys.path.append('pergunta/')
sys.path.append('gerador/')
@route('/')
@view('index')
def index():
return dict()
@get('/estoucomsorte')
def luckguy():
g = GeradorJogo()
a = analisador()
jogo = g.randomico()
analise = a.analisar_probabilidade_jogo(jogo)
return dict(magic_numbers=list(jogo), percent=analise)
@get('/pastelaria/<pedido>')
def mount(pedido):
g = GeradorJogo()
a = analisador()
p = pergunta()
jogo = None;
analise = None;
if pedido == 'melhores_repeticoes':
jogo = g.randomico_com_melhores_repeticoes(p)
if pedido == 'melhores_colunas':
jogo = g.randomico_com_melhores_colunas(p)
if pedido == 'percentual':
#pegar probabilidade desejada
jogo = g.jogo_com_percentual_de(a, p, 25)
if pedido == 'complete':
#pegar jogo do cara
jogo = g.completar_jogo([1,2,3,4,5])
if pedido == 'aleatorio':
jogo = g.randomico()
analise = a.analisar_probabilidade_jogo(jogo)
return dict(magic_numbers=list(jogo), percent=analise)
@route('/static/<filepath:path>')
def server_static(filepath):
#return static_file(filepath, root='/Development/LotoFacil/views/bootstrap/')
return static_file(filepath, root='/opt/development/workspace/python/LotoFacil/views/bootstrap/')
run(host='0.0.0.0', port=9200)