ajack 2004/06/03 12:06:13
Modified: python/gump/utils note.py __init__.py xmlutils.py
python/gump/core commandLine.py gumprun.py
python/gump/model module.py workspace.py project.py
depend.py property.py loader.py profile.py
python/gump/document/xdocs resolver.py
python/gump/update cvs.py svn.py
python/gump/build maven.py
python/gump/document/text resolver.py
project avalon-phoenix.xml
python/gump preview.py
python/gump/runner demand.py
python/gump/document resolver.py
python/gump/test utils.py
python/gump/results loader.py
Added: python/gump/model builder.py
template/forrest/content/images PythonPowered.gif
Removed: python/gump/model ant.py
Log:
1) renamed ant.py to builder.py (since it contains Ant/Maven/Script)
2) removed Annotabable from GumpXMLObject (speed-up)
3) Made preview.py show annotations on objects
Revision Changes Path
1.8 +0 -1 gump/python/gump/utils/note.py
Index: note.py
===================================================================
RCS file: /home/cvs/gump/python/gump/utils/note.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- note.py 15 Mar 2004 22:07:06 -0000 1.7
+++ note.py 3 Jun 2004 19:06:12 -0000 1.8
@@ -103,7 +103,6 @@
for note in self.annotations:
note.dump(indent+1,output)
-
def getAnnotationsAsString(self,eol="\n"):
notes=''
1.44 +35 -8 gump/python/gump/utils/__init__.py
Index: __init__.py
===================================================================
RCS file: /home/cvs/gump/python/gump/utils/__init__.py,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- __init__.py 2 Jun 2004 15:59:11 -0000 1.43
+++ __init__.py 3 Jun 2004 19:06:12 -0000 1.44
@@ -412,12 +412,15 @@
import gc
enabled = gc.isenabled()
threshold = gc.get_threshold()
- tracked = len(gc.get_objects())
+ tracked = len(gc.get_objects())
log.debug('GC: Enabled %s : Tracked %s : Threshold %s' \
% (`enabled`, `tracked`,`threshold`))
- #gc.set_debug(gc.DEBUG_LEAK)
+ gc.enable()
+ gc.set_threshold(10,10,10)
+
+ # gc.set_debug(gc.DEBUG_LEAK)
except:
pass
return tracked
@@ -427,10 +430,10 @@
try:
import gc
tracked = len(gc.get_objects())
- message=''
- if marker:
- message=' @ '
- message+=marker
+ #message=''
+ #if marker:
+ # message=' @ '
+ # message+=marker
#log.debug('Objects Tracked by GC %s : %s' \
# % (message, `tracked`))
except:
@@ -448,9 +451,33 @@
# Curiousity..
if unreachable:
- log.warn('Objects Unreachable by GC : ' + `unreachable`)
+ message='Objects Unreachable by GC : ' + `unreachable`
+ if marker:
+ message+=' @ '
+ message+=marker
+ log.warn(message)
# See what GC thinks afterwards...
# inspectGarbageCollection(marker)
except:
- pass
\ No newline at end of file
+ pass
+
+def getRefCounts():
+ d = {}
+ sys.modules
+ # collect all classes
+ for m in sys.modules.values():
+ for sym in dir(m):
+ o = getattr (m, sym)
+ if type(o) is types.ClassType:
+ d[o] = sys.getrefcount (o)
+ # sort by refcount
+ pairs = map (lambda x: (x[1],x[0]), d.items())
+ pairs.sort()
+ pairs.reverse()
+ return pairs
+
+def printTopRefs(count,message=None):
+ if message: print 'References @ ', message
+ for n, c in getRefCounts()[:count]:
+ print '%10d %s - %s' % (n, c.__name__, `c`)
1.16 +13 -7 gump/python/gump/utils/xmlutils.py
Index: xmlutils.py
===================================================================
RCS file: /home/cvs/gump/python/gump/utils/xmlutils.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- xmlutils.py 16 Apr 2004 17:28:37 -0000 1.15
+++ xmlutils.py 3 Jun 2004 19:06:12 -0000 1.16
@@ -65,7 +65,7 @@
def startElement (self, name, attrs):
"""See ContentHandler class."""
if self.topOfStack:
- # Hack to pass thss context about..
+ # Hack to pass this context about..
attributes=dict(attrs)
attributes['@basedir']=self.basedir
@@ -117,7 +117,8 @@
# allowing the actual model to be rather simple and compact. All
# elements of the GOM should extend GumpXMLObject or a subclass of GumpXMLObject.
###############################################################################
-class GumpXMLObject(Annotatable,object):
+# :TODO:#1: class GumpXMLObject(Annotatable,object):
+class GumpXMLObject(object):
"""Helper XML Object.
Attributes become properties. Characters become the string value
@@ -128,13 +129,14 @@
def __init__(self,attrs):
# Ensure we have an 'annotations' list
- if not hasattr(self,'annotations') or not isinstance(self.annotations,list):
- Annotatable.__init__(self)
+ #if not hasattr(self,'annotations') or not isinstance(self.annotations,list):
+ # Annotatable.__init__(self)
# Transfer attributes
for (name,value) in attrs.items():
if not name == '@basedir':
self.__dict__[name]=value
+
# Setup internal character field
if not '@text' in self.__dict__: self.init()
self.__dict__['@text']=''
@@ -149,11 +151,15 @@
return self.__class__.__name__.lower().replace('xml','')
def startElement(self, name, attrs):
- """ Handles XML events via a series of delegations based upon
+ """
+
+ Handles XML events via a series of delegations based upon
the tag, and the 'metadata' (typed member data) on this
object (i.e. the sub-class additions)
- See ContentHandler class."""
+ See ContentHandler class.
+
+ """
try:
# If we are dealing with a Single or Multiple,
# return an instance.
@@ -170,7 +176,7 @@
# It is OK if people extend the GOM...
message="No metadata related to tag '%s' on %s" % \
(name, self.__class__.__name__)
- self.addInfo(message)
+ # :TODO:#1: self.addInfo(message)
log.debug(message)
#
1.8 +13 -0 gump/python/gump/core/commandLine.py
Index: commandLine.py
===================================================================
RCS file: /home/cvs/gump/python/gump/core/commandLine.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- commandLine.py 21 May 2004 23:15:02 -0000 1.7
+++ commandLine.py 3 Jun 2004 19:06:12 -0000 1.8
@@ -67,6 +67,7 @@
print " Not relevent to all scripts:"
print " -O, --official Full run, publishing
notifications, etc."
print " -D, --dated Dated log files."
+ print " -c, --cache Use local cache (do not download
over HTTP)."
print " -t, --text Use text not Forrest."
print " -X, --xdocs Output xdocs, do not run Forrest."
@@ -84,6 +85,7 @@
if arg in ['-d','--debug']:
removers.append(arg)
log.info('Setting log level to DEBUG')
+ self.options.setVerbose(1) # Sub-set of debug
self.options.setDebug(1)
log.setLevel(logging.DEBUG)
elif arg in ['-v','--verbose']:
@@ -108,6 +110,10 @@
removers.append(arg)
self.options.setOfficial(1)
log.info('Official run (publish notifications, etc.)')
+ elif arg in ['-c','--cache']:
+ removers.append(arg)
+ self.options.setCache(1)
+ log.info('Use cache (do not download latest over HTTP).')
elif arg in ['-t','--text']:
removers.append(arg)
self.options.setText(1)
@@ -121,6 +127,7 @@
for arg in removers:
argv.remove(arg)
+ removers=[]
if len(argv)>2 and argv[1] in ['-w','--workspace']:
self.args.append(argv[2])
del argv[1:3]
@@ -140,6 +147,7 @@
self.args.append('*')
else:
self.args.append(arg)
+ removers.append(arg)
else:
banner()
print
@@ -147,6 +155,11 @@
print " Project wildcards are accepted, e.g. \"jakarta-*\"."
sys.exit(1)
+
+ # Remove
+ for arg in removers:
+ argv.remove(arg)
+
for arg in argv:
log.debug("Unused command line argument : " + arg)
1.9 +4 -1 gump/python/gump/core/gumprun.py
Index: gumprun.py
===================================================================
RCS file: /home/cvs/gump/python/gump/core/gumprun.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- gumprun.py 25 May 2004 22:46:00 -0000 1.8
+++ gumprun.py 3 Jun 2004 19:06:12 -0000 1.9
@@ -42,9 +42,11 @@
from gump.model.state import *
###############################################################################
-# Functions
+# Init
###############################################################################
+SEPARATOR='-------------------------------------------------------------'
+
###############################################################################
# Classes
###############################################################################
@@ -327,6 +329,7 @@
def dumpList(self,list,title,indent=0,output=sys.stdout):
""" Display a single list """
i=getIndent(indent)
+ output.write(SEPARATOR)
output.write('\n')
output.write(i + title + '[' + str(len(list)) + '] : \n')
idx=0
1.45 +1 -1 gump/python/gump/model/module.py
Index: module.py
===================================================================
RCS file: /home/cvs/gump/python/gump/model/module.py,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- module.py 21 May 2004 23:15:04 -0000 1.44
+++ module.py 3 Jun 2004 19:06:12 -0000 1.45
@@ -350,7 +350,7 @@
self.sortedProjects=createOrderedList(self.getProjects())
# Copy over any XML errors/warnings
- transferAnnotations(self.xml, self)
+ # :TODO:#1: transferAnnotations(self.xml, self)
self.setComplete(1)
1.51 +1 -2 gump/python/gump/model/workspace.py
Index: workspace.py
===================================================================
RCS file: /home/cvs/gump/python/gump/model/workspace.py,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- workspace.py 24 May 2004 16:39:09 -0000 1.50
+++ workspace.py 3 Jun 2004 19:06:12 -0000 1.51
@@ -449,7 +449,7 @@
self.sortedTrackers=createOrderedList(self.getTrackers())
# Copy over any XML errors/warnings
- transferAnnotations(self.xml, self)
+ # :TODO:#1: transferAnnotations(self.xml, self)
self.listener.handleEvent(ModelEvent())
@@ -631,7 +631,6 @@
def getKeyBase(self):
return 'workspace:'+ self.name
-
class ModelEvent(Event):
def __init__(self): pass
1.85 +7 -7 gump/python/gump/model/project.py
Index: project.py
===================================================================
RCS file: /home/cvs/gump/python/gump/model/project.py,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -r1.84 -r1.85
--- project.py 25 May 2004 22:46:00 -0000 1.84
+++ project.py 3 Jun 2004 19:06:12 -0000 1.85
@@ -26,7 +26,7 @@
Mkdir, Delete, JunitReport, Work
from gump.model.stats import Statable, Statistics
from gump.model.property import Property
-from gump.model.ant import Ant,Maven,Script
+from gump.model.builder import Ant,Maven,Script
from gump.model.rawmodel import Single
from gump.utils import getIndent
from gump.utils.file import *
@@ -370,21 +370,21 @@
self.ant = Ant(self.xml.ant,self)
# Copy over any XML errors/warnings
- transferAnnotations(self.xml.ant, self)
+ # :TODO:#1: transferAnnotations(self.xml.ant, self)
# Import any <maven part [if not packaged]
if self.xml.maven and not packaged:
self.maven = Maven(self.xml.maven,self)
# Copy over any XML errors/warnings
- transferAnnotations(self.xml.maven, self)
+ # :TODO:#1: transferAnnotations(self.xml.maven, self)
# Import any <script part [if not packaged]
if self.xml.script and not packaged:
self.script = Script(self.xml.script,self)
# Copy over any XML errors/warnings
- transferAnnotations(self.xml.script, self)
+ # :TODO:#1: transferAnnotations(self.xml.script, self)
# Set this up to be the base directory of this project,
# if one is set
@@ -448,7 +448,7 @@
if 1 == self.getJarCount():
jar=self.getJarAt(0)
if not jar.hasId():
- self.addInfo('Sole jar [' + os.path.basename(jar.getPath()) +
'] identifier set to project name')
+ self.addDebug('Sole jar [' + os.path.basename(jar.getPath()) +
'] identifier set to project name')
jar.setId(self.getName())
else:
#
@@ -468,7 +468,7 @@
reduction=-1 * len(datePostfix)
newId=newId[:reduction]
# Assign...
- self.addInfo('Jar [' + basename + '] identifier set to jar
basename: [' + newId + ']')
+ self.addDebug('Jar [' + basename + '] identifier set to jar
basename: [' + newId + ']')
jar.setId(newId)
# Grab all the work
@@ -539,7 +539,7 @@
self.addInfo("This is a packaged project, location: " + str(self.home))
# Copy over any XML errors/warnings
- transferAnnotations(self.xml, self)
+ # :TODO:#1: transferAnnotations(self.xml, self)
# Done, don't redo
self.setComplete(1)
1.27 +16 -2 gump/python/gump/model/depend.py
Index: depend.py
===================================================================
RCS file: /home/cvs/gump/python/gump/model/depend.py,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- depend.py 20 Apr 2004 17:44:32 -0000 1.26
+++ depend.py 3 Jun 2004 19:06:12 -0000 1.27
@@ -131,6 +131,9 @@
def getProject(self):
return self.project
+ def hasInheritence(self):
+ return self.inherit <> INHERIT_NONE
+
def getInheritence(self):
return self.inherit
@@ -152,7 +155,9 @@
def dump(self, indent=0, output=sys.stdout):
""" Display the contents of this object """
output.write(getIndent(indent)+'Depend: ' + self.project.getName() + '\n')
- output.write(getIndent(indent)+'Inherit: ' +
self.getInheritenceDescription() + '\n')
+
+ if self.hasInheritence():
+ output.write(getIndent(indent)+'Inherit: ' +
self.getInheritenceDescription() + '\n')
if self.isNoClasspath():
output.write(getIndent(indent)+'*NoClasspath*\n')
if self.ids:
@@ -233,6 +238,11 @@
def getUniqueProjectDependCount(self):
return len(self.projectMap)
+
+ def dump(self, indent=0, output=sys.stdout):
+ output.write(getIndent(indent)+'Depend Set\n')
+ for dep in self.depends:
+ dep.dump(indent+1,output)
class DependencyPath(list):
""" 'Path' of dependencies between two points """
@@ -437,4 +447,8 @@
def hasDependee(self,project):
""" Does this project exist as any dependee """
for dependee in self.getFullDependees():
- if dependee.getOwnerProject()==project: return 1
\ No newline at end of file
+ if dependee.getOwnerProject()==project: return 1
+
+ def dump(self, indent=0, output=sys.stdout):
+ self.directDependencies.dump(indent+1,output)
+ self.directDependees.dump(indent+1,output)
\ No newline at end of file
1.22 +2 -2 gump/python/gump/model/property.py
Index: property.py
===================================================================
RCS file: /home/cvs/gump/python/gump/model/property.py,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- property.py 21 May 2004 23:15:04 -0000 1.21
+++ property.py 3 Jun 2004 19:06:12 -0000 1.22
@@ -222,6 +222,6 @@
def dump(self, indent=0, output=sys.stdout):
""" Display the properties """
- self.properties.dump(self,indent,output)
- self.sysproperties.dump(self,indent,output)
+ self.properties.dump(indent,output)
+ self.sysproperties.dump(indent,output)
1.12 +11 -5 gump/python/gump/model/loader.py
Index: loader.py
===================================================================
RCS file: /home/cvs/gump/python/gump/model/loader.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- loader.py 16 Apr 2004 17:28:41 -0000 1.11
+++ loader.py 3 Jun 2004 19:06:12 -0000 1.12
@@ -18,6 +18,7 @@
This module contains information on
"""
import os.path
+import time
from gump import log
from gump.model.rawmodel import XMLWorkspace,XMLProfile, \
@@ -27,7 +28,7 @@
from gump.model.module import Module
from gump.utils.xmlutils import SAXDispatcher
from gump.utils.note import transferAnnotations, Annotatable
-from gump.utils import dump
+from gump.utils import dump,secsToElapsedTimeString
from gump.core.config import dir, switch, setting
@@ -38,7 +39,8 @@
def load(self,file,cache=0):
"""Builds a GOM in memory from the xml file. Return the generated GOM."""
- #log.info('Start loading metadata...')
+ start_time=time.time()
+ log.info('Loading metadata from ' + file)
if not os.path.exists(file):
log.error('Workspace metadata file ['+file+'] not found')
@@ -80,7 +82,9 @@
if not xmlworkspace:
raise IOError, 'Failed to load workspace: ' + file
- #log.info('Loaded metadata...')
+ loaded_time=time.time()
+ loadElapsed=(loaded_time-start_time)
+ log.info('Loaded metadata [' + secsToElapsedTimeString(loadElapsed) +
']')
# Construct object around XML.
workspace=Workspace(xmlworkspace)
@@ -94,8 +98,10 @@
workspace.complete(XMLProfile.map,XMLRepository.map, \
XMLModule.map,XMLProject.map, \
XMLServer.map, XMLTracker.map)
-
- #log.info('Processed metadata...')
+
+ processed_time=time.time()
+ processElapsed=(processed_time-loaded_time)
+ log.info('Processed metadata [' +
secsToElapsedTimeString(processElapsed) + ']')
finally:
#
1.5 +1 -1 gump/python/gump/model/profile.py
Index: profile.py
===================================================================
RCS file: /home/cvs/gump/python/gump/model/profile.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- profile.py 16 Mar 2004 19:50:15 -0000 1.4
+++ profile.py 3 Jun 2004 19:06:12 -0000 1.5
@@ -39,7 +39,7 @@
if self.isComplete(): return
# Copy over any XML errors/warnings
- transferAnnotations(self.xml, workspace)
+ # :TODO:#1: transferAnnotations(self.xml, workspace)
# :TODO: Until we document the profile
# add these to workspace transferAnnotations(self.xml, self)
1.1 gump/python/gump/model/builder.py
Index: builder.py
===================================================================
#!/usr/bin/env python
# Copyright 2003-2004 The Apache Software Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
This module contains information on
"""
from time import localtime, strftime, tzname
from gump.utils.work import *
from gump.utils.note import *
from gump.model.state import *
from gump.model.object import *
from gump.model.depend import *
from gump.model.property import *
from gump.model.rawmodel import XMLProperty
# represents an <ant/> element
class Builder(ModelObject, PropertyContainer):
""" An Ant command (within a project)"""
def __init__(self,xml,project):
ModelObject.__init__(self,xml,project)
PropertyContainer.__init__(self)
self.basedir=None
# Store owning project
self.project=project
#
# expand properties - in other words, do everything to complete the
# entry that does NOT require referencing another project
#
def expand(self,project,workspace):
self.expandDependencies(project,workspace)
self.expandProperties(project,workspace)
def expandProperties(self,project,workspace):
#
# convert Ant property elements which reference a project
# into dependencies
#
for property in self.xml.property:
self.expandProperty(property,project,workspace)
self.importProperty(property)
#
# convert Ant sysproperty elements which reference a project
# into dependencies
#
for sysproperty in self.xml.sysproperty:
self.expandProperty(sysproperty,project,workspace)
self.importSysProperty(sysproperty)
#
# Expands
#
def expandProperty(self,property,project,workspace):
# :TODO: Cleanup this Workaround
if not property.name and property.project:
property.name=property.project
# Check if the property comes from another project
if not property.project: return
# If that project is the one we have in hand
if property.project==project.getName(): return
# If the property is not as simple as srcdir
if property.reference=="srcdir": return
# If it isn't already a classpath dependency
if project.hasFullDependencyOnNamedProject(property.project):
self.addInfo('Dependency on ' + property.project + \
' exists, no need to add for property ' + \
property.name + '.')
return
# If there are IDs specified
ids=''
if property.id: ids= property.id
# Runtime?
runtime=0
if property.runtime: property.runtime=1
projectName=property.project
if workspace.hasProject(projectName):
# A Property
noclasspath=1
if property.classpath:
noclasspath=0
# Add a dependency (to bring property)
dependency=ProjectDependency(project, \
workspace.getProject(property.project), \
INHERIT_NONE, \
runtime,
0, \
ids,
noclasspath,
'Property Dependency for ' + property.name)
# Add depend to project...
# :TODO: Convert to ModelObject
project.addDependency(dependency)
else:
project.addError('No such project [' + projectName + '] for property')
def expandDependencies(self,project,workspace):
#
# convert all depend elements into property elements, and
# move the dependency onto the project
#
for depend in self.xml.depend:
# Generate the property
xmlproperty=XMLProperty(depend.__dict__)
xmlproperty['reference']='jarpath'
# Name the xmlproperty...
if depend.property:
xmlproperty['name']=depend.property
elif not hasattr(xmlproperty,'name') or not xmlproperty['name']:
# :TODO: Reconsider later, but default to project name for now...
xmlproperty['name']=depend.project
project.addWarning('Unnamed property for [' + project.name + '] in
depend on: ' + depend.project )
# :TODO: AJ added this, no idea if it is right/needed.
if depend.id: xmlproperty['ids']= depend.id
# <depend wants the classpath
if not xmlproperty.noclasspath:
xmlproperty['classpath']='add'
# Store it
self.expandProperty(xmlproperty,project,workspace)
self.importProperty(xmlproperty)
#
# complete the definition - it is safe to reference other projects
# at this point
#
def complete(self,project,workspace):
if self.isComplete(): return
# Import the properties..
PropertyContainer.importProperties(self,self.xml)
# Complete them all
self.completeProperties(workspace)
# Set this up...
self.basedir = os.path.abspath(os.path.join( \
self.project.getModule().getWorkingDirectory() or
dir.base, \
self.xml.basedir or self.project.getBaseDirectory()
or ''))
self.setComplete(1)
def dump(self, indent=0, output=sys.stdout):
""" Display the contents of this object """
i=getIndent(indent)
output.write(i+self.__class__.__name__+'\n')
#
# Dump all properties...
#
PropertyContainer.dump(self,indent+1,output)
def getBaseDirectory(self):
return self.basedir
# represents an <ant/> element
class Ant(Builder):
""" An Ant command (within a project)"""
def __init__(self,xml,project):
Builder.__init__(self,xml,project)
# Import the target
self.target='gump'
if xml.target:
self.target=xml.target
# Import the buildfile
self.buildfile='build.xml'
if xml.buildfile:
self.buildfile=xml.buildfile
def getTarget(self):
return self.target
def getBuildFile(self):
return self.buildfile
def dump(self, indent=0, output=sys.stdout):
""" Display the contents of this object """
Builder.dump(self)
i=getIndent(indent)
output.write(i+'Ant: ' + self.getTarget() + '\n')
output.write(i+'BuildFile: ' + self.getBuildFile() + '\n')
# represents an <maven/> element
class Maven(Builder):
""" A Maven command (within a project)"""
def __init__(self,xml,project):
Builder.__init__(self,xml,project)
# Import the goal
self.goal='jar'
if xml.goal:
self.goal=xml.goal
def getGoal(self):
return self.goal
def dump(self, indent=0, output=sys.stdout):
""" Display the contents of this object """
Builder.dump(self)
i=getIndent(indent)
output.write(i+'Maven: ' + self.getGoal() + '\n')
# represents an <script/> element
class Script(Builder):
""" A script command (within a project)"""
def __init__(self,xml,project):
Builder.__init__(self,xml,project)
1.3 +4 -2 gump/python/gump/document/xdocs/resolver.py
Index: resolver.py
===================================================================
RCS file: /home/cvs/gump/python/gump/document/xdocs/resolver.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- resolver.py 21 May 2004 23:15:07 -0000 1.2
+++ resolver.py 3 Jun 2004 19:06:12 -0000 1.3
@@ -40,7 +40,7 @@
from gump.model.workspace import Workspace
from gump.model.module import Module
from gump.model.project import Project
-from gump.model.ant import Ant
+from gump.model.builder import Ant,Maven,Script
from gump.model.object import *
from gump.model.state import *
@@ -157,7 +157,9 @@
isinstance(object, WorkItem) or \
isinstance(object, FileReference):
index=None
- elif isinstance(object, Ant):
+ elif isinstance(object, Ant) or \
+ isinstance(object, Maven) or \
+ isinstance(object, Script) :
index='Build'
else:
index=None
1.4 +2 -4 gump/python/gump/update/cvs.py
Index: cvs.py
===================================================================
RCS file: /home/cvs/gump/python/gump/update/cvs.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- cvs.py 2 Jun 2004 15:59:11 -0000 1.3
+++ cvs.py 3 Jun 2004 19:06:12 -0000 1.4
@@ -158,10 +158,8 @@
def getUpdateCommand(self,module,exists=0,nowork=0):
- """
-
- Format a commandline for doing the CVS update
-
+ """
+ Format a commandline for doing the CVS update
"""
if nowork and not exists:
1.4 +1 -1 gump/python/gump/update/svn.py
Index: svn.py
===================================================================
RCS file: /home/cvs/gump/python/gump/update/svn.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- svn.py 2 Jun 2004 15:59:11 -0000 1.3
+++ svn.py 3 Jun 2004 19:06:12 -0000 1.4
@@ -184,7 +184,7 @@
(repository, url, command ) = self.getUpdateCommand(module,0)
command.dump()
- (repository, url, command ) = self.getStatusCommand(module)
+ command = self.getStatusCommand(module)
command.dump()
(repository, url, command ) = self.getUpdateCommand(module,1)
1.6 +2 -2 gump/python/gump/build/maven.py
Index: maven.py
===================================================================
RCS file: /home/cvs/gump/python/gump/build/maven.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- maven.py 2 Jun 2004 15:59:11 -0000 1.5
+++ maven.py 3 Jun 2004 19:06:12 -0000 1.6
@@ -95,7 +95,7 @@
projpFile=self.locateMavenProjectPropertiesFile(project)
if os.path.exists(projpFile):
project.addDebug('Maven project properties in: ' + projpFile)
- catFileToFileHolder(project, pomFile, FILE_TYPE_CONFIG)
+ catFileToFileHolder(project, projpFile, FILE_TYPE_CONFIG)
#
# Build an ANT command for this project
@@ -178,7 +178,7 @@
if project.okToPerformWork():
try:
propertiesFile=self.generateMavenProperties(project)
- project.addDebug('Maven Properties in: ' + propertiesFile)
+ project.addDebug('(Gump generated) Maven Properties in: ' +
propertiesFile)
try:
catFileToFileHolder(project,propertiesFile, \
1.6 +0 -1 gump/python/gump/document/text/resolver.py
Index: resolver.py
===================================================================
RCS file: /home/cvs/gump/python/gump/document/text/resolver.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- resolver.py 21 May 2004 23:15:07 -0000 1.5
+++ resolver.py 3 Jun 2004 19:06:13 -0000 1.6
@@ -41,7 +41,6 @@
from gump.model.workspace import Workspace
from gump.model.module import Module
from gump.model.project import Project
-from gump.model.ant import Ant
from gump.model.object import *
from gump.model.state import *
1.1 gump/template/forrest/content/images/PythonPowered.gif
<<Binary file>>
1.69 +1 -1 gump/project/avalon-phoenix.xml
Index: avalon-phoenix.xml
===================================================================
RCS file: /home/cvs/gump/project/avalon-phoenix.xml,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -r1.68 -r1.69
--- avalon-phoenix.xml 28 May 2004 14:48:09 -0000 1.68
+++ avalon-phoenix.xml 3 Jun 2004 19:06:13 -0000 1.69
@@ -46,7 +46,7 @@
<ant target="gump">
<property name="checkstyle.failOnError" value="true"/>
<depend property="mx4j.jar" project="mx4j" id="mx4j"/>
- <depend property="mx4j-tools.jar" project="mx4j-tools" id="tools"/>
+ <depend property="mx4j-tools.jar" project="mx4j-tools" id="mx4j-tools"/>
</ant>
<depend project="avalon-phoenix-dependencies"/>
1.5 +53 -23 gump/python/gump/preview.py
Index: preview.py
===================================================================
RCS file: /home/cvs/gump/python/gump/preview.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- preview.py 2 Jun 2004 15:59:11 -0000 1.4
+++ preview.py 3 Jun 2004 19:06:13 -0000 1.5
@@ -36,20 +36,21 @@
from gump.core.commandLine import handleArgv
from gump.model.loader import WorkspaceLoader
+from gump.utils.note import Annotatable
+
from gump.runner.runner import getRunner
###############################################################################
# Initialize
###############################################################################
+SEPARATOR='-------------------------------------------------------------'
###############################################################################
# Functions
###############################################################################
-
-# static void main()
-if __name__=='__main__':
-
+
+def prun():
gumpinit()
# Process command line
@@ -66,27 +67,56 @@
run=GumpRun(workspace,ps,options)
run.dump()
- runner=getRunner(run)
-
- updater=runner.getUpdater()
- builder=runner.getBuilder()
+ debug=run.getOptions().isDebug()
+ verbose=run.getOptions().isVerbose()
+
+ # :TODO: Show the environment
+
+ if verbose:
+ # Show the workings
+ runner=getRunner(run)
+ updater=runner.getUpdater()
+ builder=runner.getBuilder()
+
- # Display some interesting things...
- # E.g. command lines, env
- # :TODO:
-
- for module in run.getGumpSet().getModules():
- print "-------------------------------------------------------------"
- print `module`
- if module.isUpdatable():
- updater.preview(module)
+ for module in run.getGumpSet().getModules():
+ print SEPARATOR
+ print `module`
+ if module.isUpdatable():
+ updater.preview(module)
+ for project in run.getGumpSet().getProjects():
+ print SEPARATOR
+ print `project`
+ if project.hasBuildCommand():
+ builder.preview(project)
+
+ # Show nasties...
+ if workspace.containsNasties():
+ print SEPARATOR
+ print `workspace`
+ Annotatable.dump(workspace)
+ for module in run.getGumpSet().getModules():
+ if module.containsNasties():
+ print SEPARATOR
+ print `module`
+ Annotatable.dump(module)
for project in run.getGumpSet().getProjects():
- print "-------------------------------------------------------------"
- print `project`
- if project.hasBuildCommand():
- builder.preview(project)
+ if project.containsNasties():
+ print SEPARATOR
+ print `project`
+ Annotatable.dump(project)
# bye!
- sys.exit(result)
\ No newline at end of file
+ sys.exit(result)
+
+
+# static void main()
+if __name__=='__main__':
+
+ #print 'Profiling....'
+ #import profile
+ #profile.run('prun()', 'iprof')
+ prun()
+
\ No newline at end of file
1.3 +13 -2 gump/python/gump/runner/demand.py
Index: demand.py
===================================================================
RCS file: /home/cvs/gump/python/gump/runner/demand.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- demand.py 21 May 2004 23:15:09 -0000 1.2
+++ demand.py 3 Jun 2004 19:06:13 -0000 1.3
@@ -28,7 +28,7 @@
from gump.core.config import dir, default, basicConfig
from gump.utils import dump, display, getIndent, logResourceUtilization, \
- invokeGarbageCollection
+ invokeGarbageCollection, printTopRefs
from gump.utils.note import Annotatable
from gump.utils.work import *
@@ -57,6 +57,8 @@
self.initialize(1)
+ printTopRefs(100,'Before Loop')
+
# In order...
for project in self.run.getGumpSet().getProjectSequence():
@@ -70,8 +72,17 @@
# Process
self.builder.buildProject(project)
self.run.generateEvent(project)
-
+
+ # Seems a nice place to peek/clean-up...
+ printTopRefs(100,'Before Loop GC')
+ invokeGarbageCollection(self.__class__.__name__)
+ invokeGarbageCollection(self.__class__.__name__)
+ invokeGarbageCollection(self.__class__.__name__)
+ printTopRefs(100,'After GC')
+
self.finalize()
+
+ printTopRefs(100,'Done')
# Return an exit code based off success
# :TODO: Move onto run
1.29 +0 -1 gump/python/gump/document/resolver.py
Index: resolver.py
===================================================================
RCS file: /home/cvs/gump/python/gump/document/resolver.py,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- resolver.py 21 May 2004 23:15:04 -0000 1.28
+++ resolver.py 3 Jun 2004 19:06:13 -0000 1.29
@@ -41,7 +41,6 @@
from gump.model.workspace import Workspace
from gump.model.module import Module
from gump.model.project import Project
-from gump.model.ant import Ant
from gump.model.object import *
from gump.model.state import *
1.13 +13 -2 gump/python/gump/test/utils.py
Index: utils.py
===================================================================
RCS file: /home/cvs/gump/python/gump/test/utils.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- utils.py 25 May 2004 22:46:01 -0000 1.12
+++ utils.py 3 Jun 2004 19:06:13 -0000 1.13
@@ -22,7 +22,6 @@
from gump.test.pyunit import UnitTestSuite
class TestBean:
- #def __init__(self): pass
def getX(self): return 1
def isY(self): return 0
def getYadaYada(self): return 'Yowzer'
@@ -141,8 +140,20 @@
def testInspectGarbageCollection(self):
invokeGarbageCollection('testInspect')
- def testGarbageCollection(self):
+ def testGarbageCollection1(self):
invokeGarbageCollection('testCollect')
+
+ def testGarbageCollection2(self):
+ invokeGarbageCollection('before add circular')
+ a=TestBean()
+ b=TestBean()
+ a.other=b
+ b.other=a
+ invokeGarbageCollection('after circular')
+
+ def testRefCounts(self):
+ getRefCounts()
+ printTopRefs(100)
def testGoodLaunch(self):
env=Cmd('env')
1.7 +2 -0 gump/python/gump/results/loader.py
Index: loader.py
===================================================================
RCS file: /home/cvs/gump/python/gump/results/loader.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- loader.py 16 Apr 2004 17:28:43 -0000 1.6
+++ loader.py 3 Jun 2004 19:06:13 -0000 1.7
@@ -64,4 +64,6 @@
#
workspaceResult.complete()
+ dom.unlink()
+
return workspaceResult
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]