gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From leosim...@apache.org
Subject svn commit: r215990 - in /gump/branches/Gump3/pygump/python/gump: model/util.py plugins/logreporter.py
Date Tue, 12 Jul 2005 18:48:10 GMT
Author: leosimons
Date: Tue Jul 12 11:48:08 2005
New Revision: 215990

URL: http://svn.apache.org/viewcvs?rev=215990&view=rev
Log:
Implement support for a 'packaged' state, eg implement GUMP-84.

Modified:
    gump/branches/Gump3/pygump/python/gump/model/util.py
    gump/branches/Gump3/pygump/python/gump/plugins/logreporter.py

Modified: gump/branches/Gump3/pygump/python/gump/model/util.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/model/util.py?rev=215990&r1=215989&r2=215990&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/model/util.py (original)
+++ gump/branches/Gump3/pygump/python/gump/model/util.py Tue Jul 12 11:48:08 2005
@@ -24,7 +24,7 @@
 import os
 
 from gump.model import ModelObject, Error, Dependency, CvsModule, SvnModule, Project, ExceptionInfo,
BinariesPath, \
-     Classdir, Jar, \
+     Classdir, Jar, LocalModule, LocalRepository, \
      DEPENDENCY_INHERIT_ALL, DEPENDENCY_INHERIT_HARD, DEPENDENCY_INHERIT_JARS, DEPENDENCY_INHERIT_RUNTIME
 
 UPDATE_TYPE_CHECKOUT="checkout"
@@ -275,4 +275,12 @@
                         bootclasspath.extend(inheritedbootclasspath)
                         
     
-    return (classpath, bootclasspath)
\ No newline at end of file
+    return (classpath, bootclasspath)
+
+def check_installed_package(project):
+    assert isinstance(project, Project)
+    
+    return isinstance(project.module, LocalModule) or \
+       isinstance(project.module.repository, LocalRepository) or \
+       len(project.commands) == 0
+        
\ No newline at end of file

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=215990&r1=215989&r2=215990&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/plugins/logreporter.py (original)
+++ gump/branches/Gump3/pygump/python/gump/plugins/logreporter.py Tue Jul 12 11:48:08 2005
@@ -19,13 +19,13 @@
 
 from gump.plugins import AbstractPlugin
 from gump.model import Module, Project, Dependency, Command
-from gump.model.util import check_skip, check_failure, get_failure_causes, get_root_cause
+from gump.model.util import check_skip, check_failure, check_installed_package, get_failure_causes,
get_root_cause
 from gump.engine.algorithm import ExceptionInfo
 from gump.util import ansicolor
 
 from StringIO import StringIO
 
-hr = '  --------------------------------------------------------------------------'
+hr = '  --------------------------------------------------------------------------------------'
 
 class DebugLogReporterPlugin(AbstractPlugin):
     """Outputs debug messages as it visits model elements."""
@@ -107,7 +107,7 @@
     
     def initialize(self):
         self.wr(hr)
-        self.wr('                              %sBUILD RESULTS%s' % (ansicolor.Bright_Blue,
ansicolor.Black))
+        self.wr('                                  %sBUILD RESULTS%s' % (ansicolor.Bright_Blue,
ansicolor.Black))
         self.wr(hr)
     
     def visit_workspace(self, workspace):
@@ -119,6 +119,7 @@
         failed        = 0
         prereq_failed = 0
         skipped       = 0
+        packaged      = 0
         success       = 0
         cycled        = 0
         total = len(workspace.projects)
@@ -137,6 +138,9 @@
             if check_skip(project):
                 skipped += 1
                 continue
+            if check_installed_package(project):
+                packaged += 1
+                continue
             if hasattr(workspace, "unvisited"):
                 if project in workspace.unvisited:
                     cycled += 1
@@ -150,37 +154,41 @@
             failed_percent = (1.0 * failed / total) * total_percent
             prereq_failed_percent = (1.0 * prereq_failed / total) * total_percent
             skipped_percent = (1.0 * skipped / total) * total_percent
+            packaged_precent = (1.0 * packaged / 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('  ==========================================================================')
-            self.wr('      Total | %sFailed%s | %sPrereq Failed%s | %sSkipped%s | %sSuccess%s
| %sCyclic Dependency%s' % \
+            self.wr('  ======================================================================================')
+            self.wr('      Total | %sFailed%s | %sPrereq Failed%s | %sSkipped%s | %sPackaged%s
| %sSuccess%s | %sCyclic Dependency%s' % \
                     (ansicolor.Red, ansicolor.Black,
                      ansicolor.Yellow, ansicolor.Black,
                      ansicolor.Blue, ansicolor.Black,
+                     ansicolor.Purple, ansicolor.Black,
                      ansicolor.Green, ansicolor.Black,
                      ansicolor.Bright_Red,
                      ansicolor.Black))
-            self.wr('      ------|--------|---------------|---------|---------|------------------')
-            self.wr('      %5u | %s%6u%s | %s%13u%s | %s%7u%s | %s%7u%s | %s%17u%s' % (total,
+            self.wr('      ------|--------|---------------|---------|----------|---------|------------------')
+            self.wr('      %5u | %s%6u%s | %s%13u%s | %s%7u%s | %s%8u%s | %s%7u%s | %s%17u%s'
% (total,
                      ansicolor.Red, failed, ansicolor.Black, 
                      ansicolor.Yellow, prereq_failed, ansicolor.Black,
-                     ansicolor.Blue, skipped, ansicolor.Black, 
+                     ansicolor.Blue, skipped, ansicolor.Black,
+                     ansicolor.Purple, packaged, ansicolor.Black,
                      ansicolor.Green, success, ansicolor.Black, 
                      ansicolor.Bright_Red, cycled,
                      ansicolor.Black))
-            self.wr('     %5.0f%% |%s%6.1f%%%s |%s%13.1f%%%s |%s%7.1f%%%s |%s%7.1f%%%s |%s%17.1f%%%s'
% (total_percent,
+            self.wr('     %5.0f%% |%s%6.1f%%%s |%s%13.1f%%%s |%s%7.1f%%%s |%s%8.1f%%%s |%s%7.1f%%%s
|%s%17.1f%%%s' % (total_percent,
                      ansicolor.Red, failed_percent, ansicolor.Black, 
                      ansicolor.Yellow, prereq_failed_percent, ansicolor.Black,
-                     ansicolor.Blue, skipped_percent, ansicolor.Black, 
+                     ansicolor.Blue, skipped_percent, ansicolor.Black,
+                     ansicolor.Purple, packaged_precent, ansicolor.Black,
                      ansicolor.Green, success_percent, ansicolor.Black, 
                      ansicolor.Bright_Red, cycled_percent,
                      ansicolor.Black))
-            self.wr('  ==========================================================================')
+            self.wr('  ======================================================================================')
             self.wr('')
             self.wr('  Project build log')
-            self.wr('  ==========================================================================')
+            self.wr('  ======================================================================================')
         
         if hasattr(workspace, "unvisited"):
             for project in workspace.unvisited:
@@ -191,6 +199,10 @@
             self.wr('  %s%s: SKIPPED%s' % (ansicolor.Blue, project, ansicolor.Black))
             return
         
+        if check_installed_package(project):
+            self.wr('  %s%s: PACKAGED%s' % (ansicolor.Purple, project, ansicolor.Black))
+            return
+        
         if not check_failure(project):
             self.wr('  %s%s: OK%s' % (ansicolor.Green, project, ansicolor.Black))
         else:
@@ -230,7 +242,7 @@
                     indent += "  "
                     
     def finalize(self, workspace):
-        self.wr('  ==========================================================================')
+        self.wr('  ======================================================================================')
         
         self.buffer.flush()
         self.log.info(self.buffer.getvalue())



Mime
View raw message