[entropy.client.interfaces.cache] add new method is_ugc_cached()

This commit is contained in:
Fabio Erculiani
2010-01-06 20:56:06 +01:00
parent 5c5fe80b6f
commit 0994cb05fc
@@ -67,6 +67,26 @@ class CacheMixin:
status = False
return status
def is_ugc_cached(self, repository):
"""
Determine whether User Generated Content cache is available for
given repository.
@param repository: Entropy repository identifier
@type repository: string
@return: True if available
@rtype: bool
"""
down_cache = self.UGC.UGCCache.get_downloads_cache(repository)
if down_cache is None:
return False
vote_ache = self.UGC.UGCCache.get_vote_cache(repository)
if vote_ache is None:
return False
return True
def _get_available_packages_chash(self):
# client digest not needed, cache is kept updated
return str(hash("%s|%s|%s" % (