[entropy.db] make listAllDependencies() public

This commit is contained in:
Fabio Erculiani
2013-11-19 14:48:20 +01:00
parent 1834dbe55d
commit 7eb0687ba9
3 changed files with 15 additions and 9 deletions

View File

@@ -4002,6 +4002,16 @@ class EntropyRepositoryBase(TextInterface, EntropyRepositoryPluginStore):
"""
raise NotImplementedError()
def listAllDependencies(self):
"""
List all dependencies available in repository.
@return: list of tuples of length 2 containing
(dependency id, dependency,)
@rtype: list
"""
raise NotImplementedError()
def listAllSpmUids(self):
"""
List all Source Package Manager unique package identifiers bindings

View File

@@ -4639,13 +4639,9 @@ class EntropySQLRepository(EntropyRepositoryBase):
cur = self._cursor().execute("SELECT idpackage FROM systempackages")
return self._cur2frozenset(cur)
def _listAllDependencies(self):
def listAllDependencies(self):
"""
List all dependencies available in repository.
@return: list of tuples of length 2 containing
(iddependency, dependency, name,)
@rtype: list
Reimplemented from EntropyRepositoryBase.
"""
cur = self._cursor().execute("""
SELECT iddependency, dependency FROM dependenciesreference
@@ -5512,7 +5508,7 @@ class EntropySQLRepository(EntropyRepositoryBase):
return rev_deps_data
dep_data = {}
for iddep, atom in self._listAllDependencies():
for iddep, atom in self.listAllDependencies():
if iddep == -1:
continue

View File

@@ -9,7 +9,7 @@ if __name__ == "__main__":
# test with zillions of atoms
repo = cl.open_repository("sabayonlinux.org")
atoms = [x[1] for x in repo._listAllDependencies()]
atoms = [x[1] for x in repo.listAllDependencies()]
atoms = [x for x in atoms if not x.startswith("!")]
graph = Graph()
@@ -63,4 +63,4 @@ if __name__ == "__main__":
print "=" * 20
cl.destroy()
raise SystemExit(0)
raise SystemExit(0)