summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt/cache.py19
-rw-r--r--tests/apt-test.py7
2 files changed, 12 insertions, 14 deletions
diff --git a/apt/cache.py b/apt/cache.py
index 33574c6d..39af9327 100644
--- a/apt/cache.py
+++ b/apt/cache.py
@@ -41,7 +41,7 @@ class Cache(object):
self._depcache.Commit(fprogress, iprogress)
-
+# ----------------------------- experimental interface
class Filter(object):
def apply(self, pkg):
return True
@@ -78,14 +78,15 @@ class FilteredCache(Cache):
if __name__ == "__main__":
print "Cache self test"
apt_pkg.init()
- #c = Cache()
- #print c.has_key("aptitudex")
- #p = c["aptitude"]
- #print p.Name()
- #print len(c)
-
- #for pkg in c.keys():
- # x= c[pkg].Name()
+ c = Cache()
+ print c.has_key("aptitude")
+ p = c["aptitude"]
+ print p.Name()
+ print len(c)
+
+ for pkg in c.keys():
+ x= c[pkg].Name()
+
c = FilteredCache()
c.Upgrade()
diff --git a/tests/apt-test.py b/tests/apt-test.py
index 714101d9..4e41ae00 100644
--- a/tests/apt-test.py
+++ b/tests/apt-test.py
@@ -3,8 +3,5 @@ import apt
if __name__ == "__main__":
progress = apt.progress.OpTextProgress()
cache = apt.Cache(progress)
- print "Packages count: %s" % len(cache.keys())
- for key in cache.keys():
- p = cache[key]
- if p == None or p.Name() == None or p.Name == "" or p._pkg == None:
- print "Something strange is going on"
+ print cache
+