3
from pprint import pprint, pformat
10
print sys.gettotalrefcount()
11
progress= apt.progress.OpTextProgress()
12
c = apt.Cache(progress)
13
print "refcount after first cache instance: ", sys.gettotalrefcount()
17
print "refcount after cache open: ", sys.gettotalrefcount()
18
#pprint(sys.getobjects(10))
20
c.open(apt.progress.OpProgress())
21
print "refcount after seconf cache open: ", sys.gettotalrefcount()
22
#pprint(sys.getobjects(10))
24
# FIXME: find a way to get a efficient diff
25
#before = gc.get_objects()
26
#c.open(apt.progress.OpProgress())
27
#after = gc.get_objects()
31
print "refcount before cache.update(): ", sys.gettotalrefcount()
34
print "refcount after cache.update(): ", sys.gettotalrefcount()
37
print "refcount after second cache.update(): ", sys.gettotalrefcount()
38
#pprint(sys.getobjects(20))
42
c.open(apt.progress.OpProgress())
44
print "refcount before cache['hello'].markInstall(): ", sys.gettotalrefcount()
45
c["hello"].markInstall()
46
c.commit(apt.progress.FetchProgress(), apt.progress.InstallProgress())
48
print "refcount after: ", sys.gettotalrefcount()
49
c.open(apt.progress.OpProgress())
50
c["hello"].markDelete()
51
c.commit(apt.progress.FetchProgress(), apt.progress.InstallProgress())
53
print "refcount after: ", sys.gettotalrefcount()
54
pprint(sys.getobjects(10))