[entropy.db] implement support for listAllExtraDownloads()

This commit is contained in:
Fabio Erculiani
2011-08-29 06:07:03 +02:00
parent 15d9dfed58
commit 8f9b4e2391
2 changed files with 35 additions and 0 deletions
+22
View File
@@ -4703,6 +4703,28 @@ class EntropyRepository(EntropyRepositoryBase):
return results
def listAllExtraDownloads(self, do_sort = True):
"""
Reimplemented from EntropyRepositoryBase.
"""
order_string = ''
if do_sort:
order_string = ' ORDER BY download'
try:
cur = self._cursor().execute("""
SELECT download FROM packagedownloads
""" + order_string)
except OperationalError:
if self._doesTableExist("packagedownloads"):
raise
return tuple()
if do_sort:
results = self._cur2tuple(cur)
else:
results = self._cur2frozenset(cur)
return results
def listAllFiles(self, clean = False, count = False):
"""
Reimplemented from EntropyRepositoryBase.
+13
View File
@@ -3505,6 +3505,19 @@ class EntropyRepositoryBase(TextInterface, EntropyRepositoryPluginStore):
"""
raise NotImplementedError()
def listAllExtraDownloads(self, do_sort = True):
"""
List all package extra download URLs stored in repository.
@keyword do_sort: sort by name
@type do_sort: bool
@keyword full_path: return full URL (not just package file name)
@type full_path: bool
@return: tuple (or set if do_sort is True) of package download URLs
@rtype: tuple or frozenset
"""
raise NotImplementedError()
def listAllFiles(self, clean = False, count = False):
"""
List all file paths owned by packaged stored in repository.