3 # vim: sw=4 ts=4 expandtab ai
6 from heapq import nlargest
8 from misc import size_hum_read
11 for pkg in cache.Packages:
12 # pkg is from a list of packages, sorted by name.
13 if pkg.CurrentState == apt_pkg.CurStateInstalled:
14 yield [version.InstalledSize for version in pkg.VersionList][0], pkg.Name
17 """The main function."""
21 cache = apt_pkg.GetCache()
23 for size, packg in nlargest(count, pkggetter(cache)):
24 print packg, size_hum_read(size)
26 if __name__ == "__main__":