1.1 --- a/imiptools/stores/__init__.py Wed Oct 18 00:19:26 2017 +0200
1.2 +++ b/imiptools/stores/__init__.py Wed Oct 18 00:58:00 2017 +0200
1.3 @@ -32,8 +32,11 @@
1.4 configuration defaults where the parameters are given as None.
1.5 """
1.6
1.7 - return stores[store_type or settings["STORE_TYPE"]].Store(
1.8 - store_dir or settings["STORE_DIR"])
1.9 + if store_dir or not store_type or store_type == settings["STORE_TYPE"]:
1.10 + return stores[store_type or settings["STORE_TYPE"]].Store(
1.11 + store_dir or settings["STORE_DIR"])
1.12 + else:
1.13 + raise StoreInitialisationError, "Store type cannot be changed arbitrarily."
1.14
1.15 def get_publisher(publishing_dir=None):
1.16
1.17 @@ -52,7 +55,10 @@
1.18 configuration defaults where the parameters are given as None.
1.19 """
1.20
1.21 - return stores[store_type or settings["STORE_TYPE"]].Journal(
1.22 - journal_dir or settings["JOURNAL_DIR"])
1.23 + if journal_dir or not store_type or store_type == settings["STORE_TYPE"]:
1.24 + return stores[store_type or settings["STORE_TYPE"]].Journal(
1.25 + journal_dir or settings["JOURNAL_DIR"])
1.26 + else:
1.27 + raise StoreInitialisationError, "Journal type cannot be changed arbitrarily."
1.28
1.29 # vim: tabstop=4 expandtab shiftwidth=4