gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From leosim...@apache.org
Subject svn commit: r168566 - in /gump/branches/Gump3/pygump/python/gump: config.py engine/loader.py plugins/logreporter.py
Date Fri, 06 May 2005 08:07:21 GMT
Author: leosimons
Date: Fri May  6 01:07:20 2005
New Revision: 168566

URL: http://svn.apache.org/viewcvs?rev=168566&view=rev
Log:
Implement pretty printing of build statistics.

* pygump/python/gump/plugins/logreporter.py: implement basic statistics printing.

* pygump/python/gump/engine/loader.py: use 'Uknown' for unknown project names when dropping
projects.

* pygump/python/gump/config.py: order plugins by stage.

Modified:
    gump/branches/Gump3/pygump/python/gump/config.py
    gump/branches/Gump3/pygump/python/gump/engine/loader.py
    gump/branches/Gump3/pygump/python/gump/plugins/logreporter.py

Modified: gump/branches/Gump3/pygump/python/gump/config.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/config.py?rev=168566&r1=168565&r2=168566&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/config.py (original)
+++ gump/branches/Gump3/pygump/python/gump/config.py Fri May  6 01:07:20 2005
@@ -137,6 +137,8 @@
     from gump.plugins.java.builder import AntPlugin
     plugins.append(AntPlugin(config.paths_work,buildlog))
     
+    plugins.append(TimerPlugin("build_end"))
+
     post_process_plugins = []
     # TODO: append more plugins here...
     post_process_plugins.append(TimerPlugin("run_end"))
@@ -147,8 +149,6 @@
     dynagumplog = get_logger(config, "plugin.dynagumper")
     post_process_plugins.append(Dynagumper(db, dynagumplog))
     
-    plugins.append(TimerPlugin("build_end"))
-
     if config.debug:
         from gump.plugins.logreporter import OutputLogReporterPlugin
         post_process_plugins.append(OutputLogReporterPlugin(reportlog))

Modified: gump/branches/Gump3/pygump/python/gump/engine/loader.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/engine/loader.py?rev=168566&r1=168565&r2=168566&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/engine/loader.py (original)
+++ gump/branches/Gump3/pygump/python/gump/engine/loader.py Fri May  6 01:07:20 2005
@@ -208,6 +208,8 @@
                 comment = doc.createComment(" Part of module: %s " % modulename)
                 project.appendChild(comment)
             name = project.getAttribute("name")
+            if not name:
+                name = "Uknown"
             self.log.warning("Dropping project '%s' from module '%s' because of href (%s)
resolution error!" % (name , modulename, href))
     
             _do_drop(project, dropped_nodes)

Modified: gump/branches/Gump3/pygump/python/gump/plugins/logreporter.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/plugins/logreporter.py?rev=168566&r1=168565&r2=168566&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/plugins/logreporter.py (original)
+++ gump/branches/Gump3/pygump/python/gump/plugins/logreporter.py Fri May  6 01:07:20 2005
@@ -111,6 +111,53 @@
         self.wr(hr)
     
     def visit_workspace(self, workspace):
+        if hasattr(workspace, "run_start") and hasattr(workspace, "run_end"):
+            self.wr('  Run started:  %s' % workspace.run_start)
+            self.wr('  Run finished: %s' % workspace.run_end)
+            self.wr('')
+        
+        failed  = 0
+        skipped = 0
+        success = 0
+        cycled  = 0
+        total = len(workspace.projects)
+        for project in workspace.projects.values():
+            if check_failure(project):
+                failed += 1
+                continue
+            if check_skip(project):
+                skipped += 1
+                continue
+            if hasattr(workspace, "unvisited"):
+                if project in workspace.unvisited:
+                    cycled += 1
+                    continue
+            
+            success += 1
+        
+        total_percent = 100.0
+        failed_percent = (1.0 * failed / total) * total_percent
+        skipped_percent = (1.0 * skipped / total) * total_percent
+        success_percent = (1.0 * success / total) * total_percent
+        cycled_percent = (1.0 * cycled / total) * total_percent
+        
+        self.wr('  Project build statistics:')
+        self.wr('    Total   %sFailed   %sSkipped   %sSuccess   %sCyclic Dependency%s' %
\
+                (ansicolor.Red, ansicolor.Yellow, ansicolor.Green, ansicolor.Bright_Red,
ansicolor.Black))
+        self.wr('    %5u   %s%6u   %s%7u   %s%7u   %s%17u%s' % (total,
+                 ansicolor.Red, failed,
+                 ansicolor.Yellow, skipped,
+                 ansicolor.Green, success,
+                 ansicolor.Bright_Red, cycled,
+                 ansicolor.Black))
+        self.wr('    %5.1f%%  %s%6.1f%%  %s%7.1f%%  %s%7.1f%%  %s%17.1f%%%s' % (total_percent,
+                 ansicolor.Red, failed_percent,
+                 ansicolor.Yellow, skipped_percent,
+                 ansicolor.Green, success_percent,
+                 ansicolor.Bright_Red, cycled_percent,
+                 ansicolor.Black))
+        self.wr(hr)
+        
         if hasattr(workspace, "unvisited"):
             for project in workspace.unvisited:
                 self.wr('%s%s: CYCLIC DEPENDENCY%s' % (ansicolor.Bright_Red, project, ansicolor.Black))



Mime
View raw message