From 4dcfce5fd58b99b9aaf6acb2ab86d811b1f1a01d Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 11 Dec 2008 10:42:00 -0800 Subject: - new method "getRequiredDownload()" - new method "additionalRequiredSpace()" --- apt/cache.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'apt') diff --git a/apt/cache.py b/apt/cache.py index 3c032052..79e58282 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -129,6 +129,17 @@ class Cache(object): self.cachePostChange() @property + def requiredDownload(self): + """ get the size of the packages that are required to download """ + pm = apt_pkg.GetPackageManager(self._depcache) + fetcher = apt_pkg.GetAcquire() + pm.GetArchives(fetcher, self._list, self._records) + return fetcher.FetchNeeded + @property + def additionalRequiredSpace(self): + """ get the size of the additional required space on the fs """ + return self._depcache.UsrSize + @property def reqReinstallPkgs(self): " return the packages not downloadable packages in reqreinst state " reqreinst = set() -- cgit v1.2.3