'Load cache file and return cached data'

def _load_cache(self):

    max_refresh_date = timedelta(days=7)
    cached_data = {}
    try:
        with open(self.cache_file, 'rb') as f:
            cached_data = pickle.load(f)
    except Exception as e:
        logger.debug('Cannot    read    version    from    cache    file:    {}    ({})'.format(self.cache_file, e))
    else:
        logger.debug('Read    version    from    cache    file')
        if ((cached_data['installed_version'] != self.installed_version()) or ((datetime.now() - cached_data['refresh_date']) > max_refresh_date)):
            cached_data = {}
    return cached_data
