# HG changeset patch # User Daniele Nicolodi # Date 1452544780 -3600 # Node ID 37ce0dc68cad27500f4249f7abc5e0bbeb38ac14 # Parent 4747393db602b34e7920e50c46a8cb130578f4d7 Consider configuration parhs relartive to the configuration file location diff -r 4747393db602 -r 37ce0dc68cad bnpparibas.py --- a/bnpparibas.py Mon Jan 11 21:15:53 2016 +0100 +++ b/bnpparibas.py Mon Jan 11 21:39:40 2016 +0100 @@ -319,6 +319,13 @@ conffile = sys.argv[1] conf = loadconf(conffile) + datadir = os.path.dirname(conffile) + for key in 'DATABASE', 'GNUPGHOME': + # if path is not absolute, it is interpreted as relative + # to the location of the configuration file + if not os.path.isabs(conf[key]): + conf[key] = os.path.join(datadir, conf[key]) + db = sqlite3.connect(conf['DATABASE']) db.execute('''CREATE TABLE IF NOT EXISTS messages (id TEXT PRIMARY KEY)''') db.execute('''CREATE TABLE IF NOT EXISTS transactions (id INTEGER PRIMARY KEY)''')