From 8e3f0ab05f32fbc5908b532e3fae107efdf38bca Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Thu, 9 Jul 2015 09:51:37 +0200 Subject: [PATCH] Move discovery_cache_version --- vdirsyncer/__init__.py | 4 ---- vdirsyncer/cli/utils.py | 7 +++++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/vdirsyncer/__init__.py b/vdirsyncer/__init__.py index 6e32578..bd1b9be 100644 --- a/vdirsyncer/__init__.py +++ b/vdirsyncer/__init__.py @@ -8,7 +8,3 @@ __version__ = pkg_resources.get_distribution('vdirsyncer').version PROJECT_HOME = 'https://github.com/untitaker/vdirsyncer' DOCS_HOME = 'https://vdirsyncer.readthedocs.org/en/latest' - -# Increase whenever upgrade potentially breaks discovery cache and collections -# should be re-discovered -discovery_cache_version = 1 diff --git a/vdirsyncer/cli/utils.py b/vdirsyncer/cli/utils.py index 84a4b14..ce30fcf 100644 --- a/vdirsyncer/cli/utils.py +++ b/vdirsyncer/cli/utils.py @@ -34,6 +34,10 @@ except ImportError: STATUS_PERMISSIONS = 0o600 STATUS_DIR_PERMISSIONS = 0o700 +# Increase whenever upgrade potentially breaks discovery cache and collections +# should be re-discovered +DISCOVERY_CACHE_VERSION = 1 + class _StorageIndex(object): def __init__(self): @@ -145,10 +149,9 @@ def get_status_name(pair, collection): def _get_collections_cache_key(pair_options, config_a, config_b): - from vdirsyncer import discovery_cache_version m = hashlib.sha256() j = json.dumps([ - discovery_cache_version, + DISCOVERY_CACHE_VERSION, pair_options.get('collections', None), config_a, config_b