summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFélix Sipma <gueux@gueux.org>2012-02-22 17:28:47 +0100
committerFélix Sipma <gueux@gueux.org>2012-02-22 17:28:47 +0100
commit3fb67dd638f1cbadd52d674de27d017ca87a2a30 (patch)
tree9111809fb9c203a6d61f3bca180591c7bde750fc
parenta422088c27037d627f845e5ee629f8389f7d3f4c (diff)
add db_options
-rwxr-xr-ximdb-ratings.py9
-rw-r--r--vdbpyrc1
2 files changed, 8 insertions, 2 deletions
diff --git a/imdb-ratings.py b/imdb-ratings.py
index 2aa0810..0be84ae 100755
--- a/imdb-ratings.py
+++ b/imdb-ratings.py
@@ -28,7 +28,9 @@ confset = { # Parameters to connect to the database.
'db_password': '',
'db_database': '',
'db_user': '',
- 'db_charset': 'utf8'}
+ 'db_charset': 'utf8',
+ 'db_options': {},
+ }
#################################################################
@@ -133,6 +135,8 @@ if conffile.has_option('config', 'vdb_user'):
if conffile.has_option('config', 'db_prefix'):
VDB_PREFIX = conffile.get('config', 'db_prefix') or None
+if conffile.has_option('config', 'db_options'):
+ confset['db_options'] = conffile.get('config', 'db_options')
# ------- CONNECT TO THE DATABASE.
@@ -147,7 +151,8 @@ if VERBOSE:
try:
db = MySQLdb.connect(db=confset['db_database'], host=confset['db_server'],
user=confset['db_user'], passwd=confset['db_password'],
- charset=confset['db_charset'])
+ charset=confset['db_charset'],
+ options=confset['db_options'])
curs = db.cursor()
except MySQLdb.Error, e:
print '\nUnable to connect to the database.'
diff --git a/vdbpyrc b/vdbpyrc
index feece6b..d341da2 100644
--- a/vdbpyrc
+++ b/vdbpyrc
@@ -6,3 +6,4 @@ db_password = videodb
db_database = videodb
;db_charset = utf8
db_prefix = videodb_
+;db_options = {'ssl': {'ca':'/path/to/cert.pem',},},