[csw-devel] SF.net SVN: gar:[9275] csw/mgar/gar/v2/lib/python/checkpkg.py

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Sat Mar 20 09:12:41 CET 2010


Revision: 9275
          http://gar.svn.sourceforge.net/gar/?rev=9275&view=rev
Author:   wahwah
Date:     2010-03-20 08:12:41 +0000 (Sat, 20 Mar 2010)

Log Message:
-----------
mGAR v2: checkpkg, scalability fixes, a stub of messaging API for check interfaces

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/python/checkpkg.py

Modified: csw/mgar/gar/v2/lib/python/checkpkg.py
===================================================================
--- csw/mgar/gar/v2/lib/python/checkpkg.py	2010-03-20 08:10:56 UTC (rev 9274)
+++ csw/mgar/gar/v2/lib/python/checkpkg.py	2010-03-20 08:12:41 UTC (rev 9275)
@@ -788,6 +788,7 @@
       #
       # Python strings are already implementing the flyweight pattern. What's
       # left is lists and dictionaries.
+      logging.debug("Loading stats for %s", stats_obj.md5sum)
       raw_pkg_data = stats_obj.GetAllStats()
       pkg_data = raw_pkg_data
       pkgs_data.append(pkg_data)
@@ -818,6 +819,7 @@
     self.system_pkgmap = system_pkgmap
     if not self.system_pkgmap:
       self.system_pkgmap = SystemPkgmap()
+    self.messages = []
 
   def GetPkgmapLineByBasename(self, basename):
     """Proxies calls to self.system_pkgmap."""
@@ -826,7 +828,10 @@
   def GetInstalledPackages(self):
     return self.system_pkgmap.GetInstalledPackages()
 
+  def Message(self, msg):
+    sef.messages.append(msg)
 
+
 class IndividualCheckInterface(CheckInterfaceBase):
   """To be passed to the checking functions.
 
@@ -905,11 +910,12 @@
     # 
     # In other words, the following line needs to be smart:
     # pkgs_data = [x.GetAllStats() for x in stats_obj_list]
+    logging.debug("Loading all package statistics.")
     pkgs_data = self.GetOptimizedAllStats(stats_obj_list)
+    logging.debug("All package statistics loaded.")
 
     # Individual checks
-    for package_stats_obj in stats_obj_list:
-      pkg_data = package_stats_obj.GetAllStats()
+    for pkg_data in pkgs_data:
       pkgname = pkg_data["basic_stats"]["pkgname"]
       check_interface = IndividualCheckInterface(pkgname, pkgmap)
       for function in self.individual_checks:
@@ -920,7 +926,6 @@
           errors[pkgname] = check_interface.errors
     # Set checks
     for function in self.set_checks:
-      pkgs_data = [x.GetAllStats() for x in stats_obj_list]
       logger = logging.getLogger("SetCheck-%s" % (function.__name__,))
       check_interface = SetCheckInterface(pkgmap)
       logger.debug("Calling %s", function.__name__)


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list