1.1 --- a/imiptools/stores/database/postgresql.py Sun Apr 03 22:36:04 2016 +0200
1.2 +++ b/imiptools/stores/database/postgresql.py Sun Apr 03 22:37:11 2016 +0200
1.3 @@ -19,6 +19,7 @@
1.4 this program. If not, see <http://www.gnu.org/licenses/>.
1.5 """
1.6
1.7 +from imiptools.config import STORE_DIR, JOURNAL_DIR
1.8 from imiptools.stores.database.common import DatabaseStore, DatabaseJournal
1.9 import psycopg2
1.10
1.11 @@ -26,11 +27,11 @@
1.12
1.13 "A PostgreSQL database store of calendar objects and free/busy data."
1.14
1.15 - def __init__(self, store_dir):
1.16 + def __init__(self, store_dir=None):
1.17
1.18 "Interpret 'store_dir' as a connection string."
1.19
1.20 - connection = psycopg2.connect(store_dir)
1.21 + connection = psycopg2.connect(store_dir or STORE_DIR)
1.22 connection.autocommit = True
1.23 DatabaseStore.__init__(self, connection, psycopg2.paramstyle)
1.24
1.25 @@ -46,11 +47,11 @@
1.26
1.27 "A PostgreSQL journal system supporting quotas."
1.28
1.29 - def __init__(self, store_dir):
1.30 + def __init__(self, store_dir=None):
1.31
1.32 "Interpret 'store_dir' as a connection string."
1.33
1.34 - connection = psycopg2.connect(store_dir)
1.35 + connection = psycopg2.connect(store_dir or JOURNAL_DIR)
1.36 connection.autocommit = True
1.37 DatabaseJournal.__init__(self, connection, psycopg2.paramstyle)
1.38