1.1 --- a/imiptools/stores/__init__.py Sun Oct 01 22:32:11 2017 +0200
1.2 +++ b/imiptools/stores/__init__.py Sun Oct 01 23:09:50 2017 +0200
1.3 @@ -24,12 +24,33 @@
1.4 # Access functions.
1.5
1.6 def get_store(store_type, store_dir):
1.7 +
1.8 + """
1.9 + Return a store for the given 'store_type' and 'store_dir'. If 'store_dir'
1.10 + is given as a null or false value then the configured default is used.
1.11 + """
1.12 +
1.13 return stores[store_type].Store(store_dir)
1.14
1.15 def get_publisher(publishing_dir):
1.16 - return stores["file"].Publisher(publishing_dir)
1.17 +
1.18 + """
1.19 + Return a publishing resource employing 'publishing_dir'. If the specified
1.20 + directory is given as a null or false value, None is returned. Thus, all
1.21 + free/busy publishing can be disabled by changing the configuration to use
1.22 + None as the directory.
1.23 + """
1.24 +
1.25 + return publishing_dir and stores["file"].Publisher(publishing_dir) or None
1.26
1.27 def get_journal(store_type, journal_dir):
1.28 +
1.29 + """
1.30 + Return a journal for the given 'store_type' and 'journal_dir'. If
1.31 + 'journal_dir' is given as a null or false value then the configured default
1.32 + is used.
1.33 + """
1.34 +
1.35 return stores[store_type].Journal(journal_dir)
1.36
1.37 # vim: tabstop=4 expandtab shiftwidth=4