diff --git a/.gitignore b/.gitignore index d10124d..6141e4c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ file/ gpxlen.py quickest* +config.py +__pycache__ diff --git a/test.py b/import.py similarity index 71% rename from test.py rename to import.py index fff8f85..afd58d7 100755 --- a/test.py +++ b/import.py @@ -2,15 +2,16 @@ import json import sys from pprint import pprint +from config import database import MySQLdb try: - db = MySQLdb.connect(host="localhost", # your host, usually localhost - user="root", # your username - passwd="Findus", # your password - db="citybike") # name of the data base + db = MySQLdb.connect(database["host"], + database["user"], + database["passwd"], + database["db"]) cur = db.cursor() diff --git a/iterations.py b/iterations.py index c15e14f..9f3a549 100755 --- a/iterations.py +++ b/iterations.py @@ -6,12 +6,13 @@ import xml.dom.minidom from pprint import pprint import MySQLdb +from config import database from gpxlen import getTrackLength -db = MySQLdb.connect(host="localhost", # your host, usually localhost - user="root", # your username - passwd="Findus", # your password - db="citybike") # name of the data base +db = MySQLdb.connect(database["host"], + database["user"], + database["passwd"], + database["db"]) cur = db.cursor() diff --git a/nearest.py b/nearest.py index 12a7b79..8c62603 100755 --- a/nearest.py +++ b/nearest.py @@ -3,13 +3,13 @@ import subprocess import json from pprint import pprint - +from config import database import MySQLdb -db = MySQLdb.connect(host="localhost", # your host, usually localhost - user="root", # your username - passwd="Findus", # your password - db="citybike") # name of the data base +db = MySQLdb.connect(database["host"], + database["user"], + database["passwd"], + database["db"]) cur = db.cursor()