From 78327164888bb07f7d28044f36bd92b33ad210ba Mon Sep 17 00:00:00 2001 From: "duncan.parkes" Date: Sun, 8 Mar 2009 19:54:16 +0000 Subject: [PATCH] Fix up the bits in the deployment script for entering dbname, etc. --- deployment_script_common | 6 +++--- generateCGIScripts.py | 8 +++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/deployment_script_common b/deployment_script_common index f01e490..9b771ba 100644 --- a/deployment_script_common +++ b/deployment_script_common @@ -39,13 +39,13 @@ echo echo "Enter mysql db name:" read MYSQL_DB_NAME echo $MYSQL_DB_NAME -export $MYSQL_DB_NAME +export MYSQL_DB_NAME echo "Enter mysql username:" read MYSQL_USERNAME -export $MYSQL_USERNAME +export MYSQL_USERNAME echo "Enter mysql password:" read MYSQL_PASSWORD -export $MYSQL_PASSWORD +export MYSQL_PASSWORD echo "Generating python scrapers" # Generate the python cgi files diff --git a/generateCGIScripts.py b/generateCGIScripts.py index bd89209..1246203 100755 --- a/generateCGIScripts.py +++ b/generateCGIScripts.py @@ -48,7 +48,13 @@ csv_reader = csv.DictReader( template= open(template_filename).read() # Get a mysql cursor -mysql_connection = MySQLdb.connect(db="planning") +import pdb;pdb.set_trace() + +mysql_connection = MySQLdb.connect( + db=environ['MYSQL_DB_NAME'], + user=environ['MYSQL_USERNAME'], + passwd=environ['MYSQL_PASSWORD'], + ) mysql_cursor = mysql_connection.cursor() python_scraper_location = "/cgi-bin/%s.cgi?day={day}&month={month}&year={year}"