# HG changeset patch # User Paul Boddie # Date 1485875935 -3600 # Node ID 2b62bfd72d3f09234f24ae5c0eb285a9adb37880 # Parent 3bc482b5f33e8dd2d304a15f61164abcbe9d7c85 Updated config-related operations in the tools. diff -r 3bc482b5f33e -r 2b62bfd72d3f tools/copy_store.py --- a/tools/copy_store.py Tue Jan 31 16:06:40 2017 +0100 +++ b/tools/copy_store.py Tue Jan 31 16:18:55 2017 +0100 @@ -3,7 +3,7 @@ """ Copy store information into another store. -Copyright (C) 2014, 2015, 2016 Paul Boddie +Copyright (C) 2014, 2015, 2016, 2017 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -31,7 +31,7 @@ if split(parent)[1] == "imip-agent": sys.path.append(parent) -from imiptools import config +from imiptools.config import settings from imiptools.data import Object from imiptools.stores import get_store, get_publisher, get_journal @@ -158,7 +158,7 @@ getvalue = lambda value, pos=0, default=None: value and value[pos] or default - from_store_type = getvalue(from_store_args, 0, config.STORE_TYPE) + from_store_type = getvalue(from_store_args, 0, settings["STORE_TYPE"]) from_store_dir = getvalue(from_store_args, 1) from_journal_dir = getvalue(from_store_args, 2) diff -r 3bc482b5f33e -r 2b62bfd72d3f tools/make_freebusy.py --- a/tools/make_freebusy.py Tue Jan 31 16:06:40 2017 +0100 +++ b/tools/make_freebusy.py Tue Jan 31 16:18:55 2017 +0100 @@ -5,7 +5,7 @@ availability schedule or the schedule of another user (using details provided when scheduling events with that user). -Copyright (C) 2014, 2015, 2016 Paul Boddie +Copyright (C) 2014, 2015, 2016, 2017 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -34,7 +34,7 @@ sys.path.append(parent) from codecs import getwriter -from imiptools import config +from imiptools.config import settings from imiptools.client import Client from imiptools.data import get_window_end, Object from imiptools.dates import get_default_timezone, to_utc_datetime @@ -266,7 +266,7 @@ getvalue = lambda value, default=None: value and value[0] or default - store_type = getvalue(store_type, config.STORE_TYPE) + store_type = getvalue(store_type, settings["STORE_TYPE"]) store_dir = getvalue(store_dir) publishing_dir = getvalue(publishing_dir) journal_dir = getvalue(journal_dir) diff -r 3bc482b5f33e -r 2b62bfd72d3f tools/set_delegates.py --- a/tools/set_delegates.py Tue Jan 31 16:06:40 2017 +0100 +++ b/tools/set_delegates.py Tue Jan 31 16:18:55 2017 +0100 @@ -3,7 +3,7 @@ """ Set delegates for a particular quota. -Copyright (C) 2016 Paul Boddie +Copyright (C) 2016, 2017 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -32,7 +32,7 @@ if split(parent)[1] == "imip-agent": sys.path.append(parent) -from imiptools import config +from imiptools.config import settings from imiptools.stores import get_journal from imiptools.text import get_table_from_stream @@ -76,7 +76,7 @@ getvalue = lambda value, default=None: value and value[0] or default - store_type = getvalue(store_type, config.STORE_TYPE) + store_type = getvalue(store_type, settings["STORE_TYPE"]) journal_dir = getvalue(journal_dir) # Obtain store-related objects. diff -r 3bc482b5f33e -r 2b62bfd72d3f tools/set_quota_groups.py --- a/tools/set_quota_groups.py Tue Jan 31 16:06:40 2017 +0100 +++ b/tools/set_quota_groups.py Tue Jan 31 16:18:55 2017 +0100 @@ -3,7 +3,7 @@ """ Set a mapping of users to groups for a quota. -Copyright (C) 2016 Paul Boddie +Copyright (C) 2016, 2017 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -32,7 +32,7 @@ if split(parent)[1] == "imip-agent": sys.path.append(parent) -from imiptools import config +from imiptools.config import settings from imiptools.stores import get_journal from imiptools.text import get_table_from_stream @@ -87,7 +87,7 @@ getvalue = lambda value, default=None: value and value[0] or default - store_type = getvalue(store_type, config.STORE_TYPE) + store_type = getvalue(store_type, settings["STORE_TYPE"]) journal_dir = getvalue(journal_dir) # Obtain store-related objects. diff -r 3bc482b5f33e -r 2b62bfd72d3f tools/set_quota_limits.py --- a/tools/set_quota_limits.py Tue Jan 31 16:06:40 2017 +0100 +++ b/tools/set_quota_limits.py Tue Jan 31 16:18:55 2017 +0100 @@ -3,7 +3,7 @@ """ Set quota limits for a collection of user groups. -Copyright (C) 2016 Paul Boddie +Copyright (C) 2016, 2017 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -32,7 +32,7 @@ if split(parent)[1] == "imip-agent": sys.path.append(parent) -from imiptools import config +from imiptools.config import settings from imiptools.stores import get_journal from imiptools.text import get_table_from_stream @@ -87,7 +87,7 @@ getvalue = lambda value, default=None: value and value[0] or default - store_type = getvalue(store_type, config.STORE_TYPE) + store_type = getvalue(store_type, settings["STORE_TYPE"]) journal_dir = getvalue(journal_dir) # Obtain store-related objects. diff -r 3bc482b5f33e -r 2b62bfd72d3f tools/update_quotas.py --- a/tools/update_quotas.py Tue Jan 31 16:06:40 2017 +0100 +++ b/tools/update_quotas.py Tue Jan 31 16:18:55 2017 +0100 @@ -3,7 +3,7 @@ """ Remove expired events from quota journals. -Copyright (C) 2014, 2015, 2016 Paul Boddie +Copyright (C) 2014, 2015, 2016, 2017 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -32,7 +32,7 @@ sys.path.append(parent) from codecs import getwriter -from imiptools import config +from imiptools.config import settings from imiptools.dates import get_datetime, get_default_timezone, get_time, \ to_utc_datetime from imiptools.stores import get_journal @@ -160,7 +160,7 @@ getvalue = lambda value, default=None: value and value[0] or default - store_type = getvalue(store_type, config.STORE_TYPE) + store_type = getvalue(store_type, settings["STORE_TYPE"]) journal_dir = getvalue(journal_dir) expiry = getvalue(expiry)