From be50999fcdb699f05ae310137e0aa797cfbffe4b Mon Sep 17 00:00:00 2001 From: carlos.vieira Date: Thu, 17 Apr 2014 12:54:49 -0300 Subject: [PATCH] barrabrasil.py: adicionando o config para utilizar a barra correta. build.sh: gera o arquivo profile conforme par?metro. README: adicionado referencia a nova depend?ncia --- LEIAME | 3 +++ app/barrabrasil.py | 9 ++++----- build.sh | 4 +++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/LEIAME b/LEIAME index b4ad58d..14f2947 100644 --- a/LEIAME +++ b/LEIAME @@ -9,6 +9,9 @@ DependĂȘncias: # sudo pip install flask - assetgen # sudo pip install assetgen + + - Config + # sudo pip install config - node.js # sudo apt-get install python-software-properties python g++ make # sudo add-apt-repository ppa:chris-lea/node.js diff --git a/app/barrabrasil.py b/app/barrabrasil.py index 23c61fe..eceef1a 100644 --- a/app/barrabrasil.py +++ b/app/barrabrasil.py @@ -1,4 +1,5 @@ from flask import Flask, url_for, render_template, request, Response, make_response +from config import Config import hashlib#,webbrowser # Criar Key e certificado @@ -39,11 +40,9 @@ def barra(): return resposta if __name__ == '__main__': - from sys import argv - if len(argv) > 1: - profile = argv[1] - else: - profile = 'default' + f = file('profile') + cfg = Config(f) + profile = cfg.profile #webbrowser.open("http://127.0.0.1:5000/",new=2) app.run(debug=False) #webbrowser.open("https://127.0.0.1:5000/",new=2) diff --git a/build.sh b/build.sh index b17477a..9ed5886 100755 --- a/build.sh +++ b/build.sh @@ -12,7 +12,9 @@ then cd recipes/$profile sh ./compile.sh cd ../../app - python barrabrasil.py $profile + touch profile + echo 'profile :' $profile > profile + python barrabrasil.py else echo "Error. Profile $1 does not exist." fi -- libgit2 0.21.2