From 31de43b4a9cd364da0156f6b4cb184cc35b8d774 Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Mon, 6 Jul 2015 16:13:35 +0200 Subject: [PATCH] Remove collection_human --- tests/utils/test_main.py | 3 +-- vdirsyncer/storage/base.py | 7 +------ vdirsyncer/storage/dav.py | 7 ++----- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/tests/utils/test_main.py b/tests/utils/test_main.py index 6003df4..9889323 100644 --- a/tests/utils/test_main.py +++ b/tests/utils/test_main.py @@ -205,8 +205,7 @@ def test_get_class_init_args_on_storage(): from vdirsyncer.storage.memory import MemoryStorage all, required = utils.get_class_init_args(MemoryStorage) - assert all == set(['fileext', 'collection', 'read_only', 'instance_name', - 'collection_human']) + assert all == set(['fileext', 'collection', 'read_only', 'instance_name']) assert not required diff --git a/vdirsyncer/storage/base.py b/vdirsyncer/storage/base.py index 48222e0..9fb5974 100644 --- a/vdirsyncer/storage/base.py +++ b/vdirsyncer/storage/base.py @@ -61,9 +61,6 @@ class Storage(with_metaclass(StorageMeta)): # The machine-readable name of this collection. collection = None - # The human-readable name of this collection. - collection_human = None - # A value of True means the storage does not support write-methods such as # upload, update and delete. A value of False means the storage does # support those methods. @@ -72,8 +69,7 @@ class Storage(with_metaclass(StorageMeta)): # The attribute values to show in the representation of the storage. _repr_attributes = () - def __init__(self, instance_name=None, read_only=None, collection=None, - collection_human=None): + def __init__(self, instance_name=None, read_only=None, collection=None): if read_only is None: read_only = self.read_only if self.read_only and not read_only: @@ -84,7 +80,6 @@ class Storage(with_metaclass(StorageMeta)): instance_name = '{}/{}'.format(instance_name, collection) self.instance_name = instance_name self.collection = collection - self.collection_human = collection_human @classmethod def discover(cls, **kwargs): diff --git a/vdirsyncer/storage/dav.py b/vdirsyncer/storage/dav.py index 9774290..3ece32f 100644 --- a/vdirsyncer/storage/dav.py +++ b/vdirsyncer/storage/dav.py @@ -93,7 +93,6 @@ class Discover(object): - """ @@ -177,22 +176,20 @@ class Discover(object): if props.find('{*}resourcetype/{*}' + self._resourcetype) is None: continue - displayname = getattr(props.find('{*}displayname'), 'text', '') href = response.find('{*}href') if href is None: raise InvalidXMLResponse() href = utils.compat.urlparse.urljoin(r.url, href.text) if href not in done: done.add(href) - yield {'href': href, 'displayname': displayname} + yield {'href': href} def discover(self): for c in self.find_collections(): url = c['href'] collection = _get_collection_from_url(url) storage_args = dict(self.kwargs) - storage_args.update({'url': url, 'collection': collection, - 'collection_human': c['displayname']}) + storage_args.update({'url': url, 'collection': collection}) yield storage_args def create(self, collection):