Remove old config format

Fix #148
This commit is contained in:
Markus Unterwaditzer 2014-12-31 01:13:26 +01:00
parent b0d969df0d
commit 0d3dc10b35
3 changed files with 4 additions and 26 deletions

View file

@ -15,6 +15,7 @@ Version 0.4.0
*yet to be released* *yet to be released*
- The ``passwordeval`` parameter has been renamed to ``passwordconfig``. - The ``passwordeval`` parameter has been renamed to ``passwordconfig``.
- The old way of writing certain config values such as lists is now gone.
- Collection discovery has been rewritten. Old configuration files should be - Collection discovery has been rewritten. Old configuration files should be
compatible with it, but vdirsyncer now caches the results of the collection compatible with it, but vdirsyncer now caches the results of the collection
discovery. You have to run ``vdirsyncer discover`` if collections were added discovery. You have to run ``vdirsyncer discover`` if collections were added

View file

@ -95,19 +95,6 @@ def validate_section_name(name, section_type):
chars_display)) chars_display))
def _parse_old_config_list_value(d, key):
value = d.get(key, [])
if isinstance(value, str):
# XXX: Deprecation
old_form = value
value = list(filter(bool, (x.strip() for x in value.split(','))))
cli_logger.warning(
'{!r} is deprecated, please use:\n{} = {}\n'
'The old form will be removed in 0.4.0.'
.format(old_form, key, json.dumps(value)))
return value
def get_status_name(pair, collection): def get_status_name(pair, collection):
if collection is None: if collection is None:
return pair return pair
@ -201,7 +188,7 @@ def _get_coll(pair_name, storage_name, collection, discovered, config):
def _collections_for_pair_impl(status_path, name_a, name_b, pair_name, def _collections_for_pair_impl(status_path, name_a, name_b, pair_name,
config_a, config_b, pair_options): config_a, config_b, pair_options):
shortcuts = set(_parse_old_config_list_value(pair_options, 'collections')) shortcuts = set(pair_options.get('collections', ()))
if not shortcuts: if not shortcuts:
yield None, (config_a, config_b) yield None, (config_a, config_b)
else: else:

View file

@ -571,18 +571,8 @@ class CaldavStorage(DavStorage):
def __init__(self, start_date=None, end_date=None, def __init__(self, start_date=None, end_date=None,
item_types=('VTODO', 'VEVENT'), **kwargs): item_types=('VTODO', 'VEVENT'), **kwargs):
super(CaldavStorage, self).__init__(**kwargs) super(CaldavStorage, self).__init__(**kwargs)
if isinstance(item_types, str): if not isinstance(item_types, (list, tuple)):
orig_item_types = item_types raise ValueError('item_types must be a list.')
item_types = list(filter(
bool, (x.strip() for x in item_types.split(','))
))
# XXX: Deprecation
import json
dav_logger.warning(
'{!r} is deprecated, please use:\nitem_types = {}\n'
'The old form will be removed in 0.4.0.'
.format(orig_item_types, json.dumps(item_types)))
self.item_types = tuple(item_types) self.item_types = tuple(item_types)
if (start_date is None) != (end_date is None): if (start_date is None) != (end_date is None):