浏览代码

Fix up the bits in the deployment script for entering dbname, etc.

import/raw
duncan.parkes 16 年前
父节点
当前提交
3b25546900
共有 2 个文件被更改,包括 10 次插入4 次删除
  1. +3
    -3
      trunk/deployment_script_common
  2. +7
    -1
      trunk/generateCGIScripts.py

+ 3
- 3
trunk/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


+ 7
- 1
trunk/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}"


正在加载...
取消
保存