'Determines if the cache files have expired, or if it is still valid'

def is_cache_valid(self):

    if self.args.tags_only:
        to_check = self.cache_path_tags
    else:
        to_check = self.cache_path_cache
    if os.path.isfile(to_check):
        mod_time = os.path.getmtime(to_check)
        current_time = time()
        if ((mod_time + self.cache_max_age) > current_time):
            if os.path.isfile(self.cache_path_index):
                return True
    return False
