# HG changeset patch # User Paul Boddie # Date 1508281080 -7200 # Node ID 80ff4874ce5082856a637f1386641e62c03aefa9 # Parent ef0326fbdc1dd440d21b2423260013f9e27af768# Parent f184dc45aadfa13a1951f1cb557192b93500ac8e Merged changes from the default branch. diff -r ef0326fbdc1d -r 80ff4874ce50 imiptools/__init__.py --- a/imiptools/__init__.py Wed Oct 18 00:19:26 2017 +0200 +++ b/imiptools/__init__.py Wed Oct 18 00:58:00 2017 +0200 @@ -64,9 +64,9 @@ def get_store(self): - "Return any configured store or None if not explicitly configured." + "Return any configured store." - return self.store_dir and get_store(self.store_type, self.store_dir) or None + return get_store(self.store_type, self.store_dir) def get_publisher(self): diff -r ef0326fbdc1d -r 80ff4874ce50 imiptools/stores/__init__.py --- a/imiptools/stores/__init__.py Wed Oct 18 00:19:26 2017 +0200 +++ b/imiptools/stores/__init__.py Wed Oct 18 00:58:00 2017 +0200 @@ -32,8 +32,11 @@ configuration defaults where the parameters are given as None. """ - return stores[store_type or settings["STORE_TYPE"]].Store( - store_dir or settings["STORE_DIR"]) + if store_dir or not store_type or store_type == settings["STORE_TYPE"]: + return stores[store_type or settings["STORE_TYPE"]].Store( + store_dir or settings["STORE_DIR"]) + else: + raise StoreInitialisationError, "Store type cannot be changed arbitrarily." def get_publisher(publishing_dir=None): @@ -52,7 +55,10 @@ configuration defaults where the parameters are given as None. """ - return stores[store_type or settings["STORE_TYPE"]].Journal( - journal_dir or settings["JOURNAL_DIR"]) + if journal_dir or not store_type or store_type == settings["STORE_TYPE"]: + return stores[store_type or settings["STORE_TYPE"]].Journal( + journal_dir or settings["JOURNAL_DIR"]) + else: + raise StoreInitialisationError, "Journal type cannot be changed arbitrarily." # vim: tabstop=4 expandtab shiftwidth=4