ajack 2004/06/25 09:40:37
Modified: python/gump/model Tag: CleanUp project.py object.py
python/gump/document/text Tag: CleanUp resolver.py
python/gump/utils Tag: CleanUp domutils.py
python/gump/test Tag: CleanUp resolving.py
python/gump/document/xdocs Tag: CleanUp resolver.py
. Tag: CleanUp gumpytest.sh
Log:
Splice XML into XML (at DOM node level) to attempt to restore the
ability to override projects as packages (in the workspace).
Revision Changes Path
No revision
No revision
1.85.2.11 +1 -9 gump/python/gump/model/project.py
Index: project.py
===================================================================
RCS file: /home/cvs/gump/python/gump/model/project.py,v
retrieving revision 1.85.2.10
retrieving revision 1.85.2.11
diff -u -r1.85.2.10 -r1.85.2.11
--- project.py 24 Jun 2004 20:15:55 -0000 1.85.2.10
+++ project.py 25 Jun 2004 16:40:37 -0000 1.85.2.11
@@ -294,7 +294,6 @@
# Packaged Projects don't need the full treatment..
#
packaged=self.isPackaged()
- if packaged: print 'PACKAGE ?????' + `self`
# Import any <ant part [if not packaged]
if self.hasDomChild('ant') and not packaged:
@@ -373,10 +372,6 @@
else:
self.addError('Missing \'name\' on <license')
- if packaged:
- print 'PACKAGE w/ JARS?????'+ `self`
- print self.getXml()
-
#
# Resolve jars (outputs)
#
@@ -384,10 +379,7 @@
name=self.expandVariables(
getDomAttributeValue(jdom,'name'))
- if packaged: print 'NAME: ' + name
-
- if self.home and name:
- if packaged: print 'NAME2: ' + self.home + ':' + name
+ if self.home and name:
jar=Jar(name,jdom,self)
jar.complete()
jar.setPath(os.path.abspath(os.path.join(self.home,name)))
1.24.2.7 +1 -8 gump/python/gump/model/object.py
Index: object.py
===================================================================
RCS file: /home/cvs/gump/python/gump/model/object.py,v
retrieving revision 1.24.2.6
retrieving revision 1.24.2.7
diff -u -r1.24.2.6 -r1.24.2.7
--- object.py 24 Jun 2004 20:15:55 -0000 1.24.2.6
+++ object.py 25 Jun 2004 16:40:37 -0000 1.24.2.7
@@ -226,15 +226,8 @@
self.spliced=spliced
def splice(self,dom):
- # Import overrides from DOM
- print 'PRE=SPLICE'
- self.dump()
- print self.getXml()
- transferDomInfo(dom, self, {})
+ spliceDom(self.element,dom)
self.setSpliced(True)
- print 'POST=SPLICE'
- self.dump()
- print self.getXml()
def complete(self):
if self.isComplete(): return
No revision
No revision
1.6.2.2 +0 -3 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.6.2.1
retrieving revision 1.6.2.2
diff -u -r1.6.2.1 -r1.6.2.2
--- resolver.py 16 Jun 2004 17:50:41 -0000 1.6.2.1
+++ resolver.py 25 Jun 2004 16:40:37 -0000 1.6.2.2
@@ -57,9 +57,6 @@
def getFile(self,object,documentName=None,extn=None,rawContent=False):
raise RuntimeError, 'Not Implemented on ' + self.__class__.__name__ + ':
getFile.'
- def getDirectory(self,object):
- raise RuntimeError, 'Not Implemented on ' + self.__class__.__name__ + ':
getDirectory.'
-
def getDirectoryUrl(self,object):
raise RuntimeError, 'Not Implemented on ' + self.__class__.__name__ + ':
getDirectoryUrl.'
No revision
No revision
1.1.2.4 +23 -0 gump/python/gump/utils/Attic/domutils.py
Index: domutils.py
===================================================================
RCS file: /home/cvs/gump/python/gump/utils/Attic/domutils.py,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- domutils.py 16 Jun 2004 18:40:38 -0000 1.1.2.3
+++ domutils.py 25 Jun 2004 16:40:37 -0000 1.1.2.4
@@ -184,6 +184,29 @@
return value
+def spliceDom(targetElement,source):
+ # The DOM model
+ if source.nodeType==xml.dom.Node.DOCUMENT_NODE:
+ sourceElement=source.documentElement
+ else:
+ sourceElement=source
+
+ # Splice Attributes
+ # (i.e. copy over any we don't already have)
+ if sourceElement.hasAttributes():
+ attrs=sourceElement.attributes
+ for attrIndex in range(attrs.length):
+ attr=attrs.item(attrIndex)
+ if not targetElement.hasAttribute(attr.name):
+ targetElement.setAttribute(attr.name,attr.value)
+
+ # Splice Children
+ # (i.e. deep clone and copy into target)
+ if sourceElement.hasChildNodes():
+ for childNode in sourceElement.childNodes:
+ clonedNode=childNode.cloneNode(True)
+ targetElement.appendChild(clonedNode)
+
#
#def getAttrValue(node,attrName):
No revision
No revision
1.7.2.3 +1 -1 gump/python/gump/test/resolving.py
Index: resolving.py
===================================================================
RCS file: /home/cvs/gump/python/gump/test/resolving.py,v
retrieving revision 1.7.2.2
retrieving revision 1.7.2.3
diff -u -r1.7.2.2 -r1.7.2.3
--- resolving.py 18 Jun 2004 22:02:21 -0000 1.7.2.2
+++ resolving.py 25 Jun 2004 16:40:37 -0000 1.7.2.3
@@ -67,7 +67,7 @@
self.assertNotNone('From : ', object2)
location1=getLocationForObject(object1,'.test')
location2=getLocationForObject(object2,'.test')
- location=getRelativeLocation(object1,object2)
+ location=getRelativeLocation(object1,object2,'.test')
#printSeparator()
self.assertNotNone('To Location: ', location1)
self.assertNotNone('From Location: ', location2)
No revision
No revision
1.3.2.3 +1 -1 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.3.2.2
retrieving revision 1.3.2.3
diff -u -r1.3.2.2 -r1.3.2.3
--- resolver.py 16 Jun 2004 17:50:40 -0000 1.3.2.2
+++ resolver.py 25 Jun 2004 16:40:37 -0000 1.3.2.3
@@ -160,7 +160,7 @@
"""
Link from one to another
"""
- return getRelativeLocation(toObject,fromObject).serialize()
+ return getRelativeLocation(toObject,fromObject,'.html').serialize()
def getIndexForObject(object):
"""
No revision
No revision
1.7.4.2 +9 -7 gump/gumpytest.sh
Index: gumpytest.sh
===================================================================
RCS file: /home/cvs/gump/gumpytest.sh,v
retrieving revision 1.7.4.1
retrieving revision 1.7.4.2
diff -u -r1.7.4.1 -r1.7.4.2
--- gumpytest.sh 21 Jun 2004 15:53:30 -0000 1.7.4.1
+++ gumpytest.sh 25 Jun 2004 16:40:37 -0000 1.7.4.2
@@ -22,15 +22,17 @@
export
#
-# Determine the Python to use...
+# Determine the Python to use... (if not told)
#
-export GUMP_PYTHON="`which python2.3`"
if [ "" == "$GUMP_PYTHON" ] ; then
- export GUMP_PYTHON="`which python`"
- if [ "" == "$GUMP_PYTHON" ] ; then
- echo "No Python (python2.3 nor python) found in path."
- exit 1
- fi
+ export GUMP_PYTHON="`which python2.3`"
+ if [ "" == "$GUMP_PYTHON" ] ; then
+ export GUMP_PYTHON="`which python`"
+ if [ "" == "$GUMP_PYTHON" ] ; then
+ echo "No Python (python2.3 nor python) found in path."
+ exit 1
+ fi
+ fi
fi
#
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]