[Secure-testing-commits] r14768 - lib/python/sectracker

Florian Weimer fw at alioth.debian.org
Sun May 30 17:56:07 UTC 2010


Author: fw
Date: 2010-05-30 17:56:06 +0000 (Sun, 30 May 2010)
New Revision: 14768

Modified:
   lib/python/sectracker/repo.py
Log:
sectracker.repo.Config: add cache for map of parsed files


Modified: lib/python/sectracker/repo.py
===================================================================
--- lib/python/sectracker/repo.py	2010-05-28 21:59:43 UTC (rev 14767)
+++ lib/python/sectracker/repo.py	2010-05-30 17:56:06 UTC (rev 14768)
@@ -280,13 +280,21 @@
                         % (d, rel, self.releases[rel]))
                 self.releases[rel] = d
 
+        self._filemap_cache = None
+
     def update(self):
         self.collection.update()
+        self._filemap_cache = None
+        
+    def filemap(self):
+        if self._filemap_cache is None:
+            self._filemap_cache = self.collection.filemap(load=True)
+        return self._filemap_cache
 
     def releasepackageversions(self):
         """Returns dictionaries mapping release codenames to packages
         to a set of versions."""
-        fm = self.collection.filemap(load=True)
+        fm = self.filemap()
         r = {}
         for d, dobj in self.distributions.items():
             pkgver = {}




More information about the Secure-testing-commits mailing list