Commit be50999fcdb699f05ae310137e0aa797cfbffe4b
1 parent
9b067429
Exists in
master
barrabrasil.py: adicionando o config para utilizar a barra correta. build.sh: ge…
…ra o arquivo profile conforme par?metro. README: adicionado referencia a nova depend?ncia
Showing
3 changed files
with
10 additions
and
6 deletions
Show diff stats
LEIAME
@@ -9,6 +9,9 @@ Dependências: | @@ -9,6 +9,9 @@ Dependências: | ||
9 | # sudo pip install flask | 9 | # sudo pip install flask |
10 | - assetgen | 10 | - assetgen |
11 | # sudo pip install assetgen | 11 | # sudo pip install assetgen |
12 | + | ||
13 | + - Config | ||
14 | + # sudo pip install config | ||
12 | - node.js | 15 | - node.js |
13 | # sudo apt-get install python-software-properties python g++ make | 16 | # sudo apt-get install python-software-properties python g++ make |
14 | # sudo add-apt-repository ppa:chris-lea/node.js | 17 | # sudo add-apt-repository ppa:chris-lea/node.js |
app/barrabrasil.py
1 | from flask import Flask, url_for, render_template, request, Response, make_response | 1 | from flask import Flask, url_for, render_template, request, Response, make_response |
2 | +from config import Config | ||
2 | import hashlib#,webbrowser | 3 | import hashlib#,webbrowser |
3 | 4 | ||
4 | # Criar Key e certificado | 5 | # Criar Key e certificado |
@@ -39,11 +40,9 @@ def barra(): | @@ -39,11 +40,9 @@ def barra(): | ||
39 | return resposta | 40 | return resposta |
40 | 41 | ||
41 | if __name__ == '__main__': | 42 | if __name__ == '__main__': |
42 | - from sys import argv | ||
43 | - if len(argv) > 1: | ||
44 | - profile = argv[1] | ||
45 | - else: | ||
46 | - profile = 'default' | 43 | + f = file('profile') |
44 | + cfg = Config(f) | ||
45 | + profile = cfg.profile | ||
47 | #webbrowser.open("http://127.0.0.1:5000/",new=2) | 46 | #webbrowser.open("http://127.0.0.1:5000/",new=2) |
48 | app.run(debug=False) | 47 | app.run(debug=False) |
49 | #webbrowser.open("https://127.0.0.1:5000/",new=2) | 48 | #webbrowser.open("https://127.0.0.1:5000/",new=2) |
build.sh
@@ -12,7 +12,9 @@ then | @@ -12,7 +12,9 @@ then | ||
12 | cd recipes/$profile | 12 | cd recipes/$profile |
13 | sh ./compile.sh | 13 | sh ./compile.sh |
14 | cd ../../app | 14 | cd ../../app |
15 | - python barrabrasil.py $profile | 15 | + touch profile |
16 | + echo 'profile :' $profile > profile | ||
17 | + python barrabrasil.py | ||
16 | else | 18 | else |
17 | echo "Error. Profile $1 does not exist." | 19 | echo "Error. Profile $1 does not exist." |
18 | fi | 20 | fi |