You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@gump.apache.org by aj...@apache.org on 2003/12/02 19:55:12 UTC
cvs commit: jakarta-gump/python/gump/document resolver.py forrest.py
ajack 2003/12/02 10:55:12
Modified: python/gump/document resolver.py forrest.py
Log:
Attempt to kep RSS generation from dorking up Forrest.
Revision Changes Path
1.5 +27 -7 jakarta-gump/python/gump/document/resolver.py
Index: resolver.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/document/resolver.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- resolver.py 1 Dec 2003 17:34:07 -0000 1.4
+++ resolver.py 2 Dec 2003 18:55:12 -0000 1.5
@@ -305,9 +305,17 @@
def __init__(self,rootDir,rootUrl):
- subPath=Path(['forrest','src','documentation','content','xdocs'])
- self.makePath(subPath,rootDir)
- self.rootDir=concatenate(rootDir,subPath.serialize())
+ self.rootDir=rootDir
+
+ # Content
+ contentSubPath=Path(['forrest','src','documentation','content'])
+ self.makePath(contentSubPath,rootDir)
+ self.contentDir=concatenate(rootDir,contentSubPath.serialize())
+
+ # XDocs
+ xdocsSubPath=Path(['forrest','src','documentation','content','xdocs'])
+ self.makePath(xdocsSubPath,rootDir)
+ self.xdocsDir=concatenate(rootDir,xdocsSubPath.serialize())
# The root URL
self.rootUrl=rootUrl
@@ -322,11 +330,12 @@
if not os.path.exists(root):
log.debug('Make directory : [' + root + ']')
os.mkdir(root)
-
+
+ # :TODO: Do we need to also have this for content not xdocs?
def getAbsoluteDirectory(self,object):
path=getPathForObject(object)
self.makePath(path)
- return concatenate(self.rootDir,path.serialize())
+ return concatenate(self.xdocsDir,path.serialize())
def getAbsoluteFile(self,object,documentName=None,extn='.xml'):
location=getLocationForObject(object)
@@ -334,8 +343,19 @@
if not documentName.endswith(extn):
documentName += extn
location.setDocument(documentName)
- self.makePath(location.getPath())
- return concatenate(self.rootDir,location.serialize())
+
+ # XDocs in one place, content in another
+ # This is a tad lame, not a great way to detect
+ # xdocs, but ok for now.
+ if not extn == '.xml':
+ self.makePath(location.getPath(),self.contentDir)
+ file=concatenate(self.contentDir,location.serialize())
+ else:
+ self.makePath(location.getPath(),self.xdocsDir)
+ file=concatenate(self.xdocsDir,location.serialize())
+
+ return file
+
def getAbsoluteDirectoryUrl(self,object):
return concatenate(self.rootUrl,getPathForObject(object).serialize())
1.23 +5 -4 jakarta-gump/python/gump/document/forrest.py
Index: forrest.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/document/forrest.py,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- forrest.py 2 Dec 2003 17:36:39 -0000 1.22
+++ forrest.py 2 Dec 2003 18:55:12 -0000 1.23
@@ -501,7 +501,7 @@
moduleRow.createData(seq)
self.insertStateIcon(module,workspace,moduleRow.createData())
- self.insertStateIcons(module,workspace,moduleRow.createData())
+ self.insertStateIcons(gumpSet,module,workspace,moduleRow.createData())
moduleRow.createData(elapsedTimeToString(module.elapsedTime()))
@@ -533,7 +533,7 @@
self.insertLink( module, workspace, moduleRow.createData())
self.insertStateIcon(module,workspace,moduleRow.createData())
- self.insertStateIcons(module,workspace,moduleRow.createData())
+ self.insertStateIcons(gumpSet,module,workspace,moduleRow.createData())
moduleRow.createData(elapsedTimeToString(module.elapsedTime()))
moduleRow.createData(round(module.getFOGFactor(),2))
@@ -572,7 +572,7 @@
moduleRow.createComment(module.getName())
self.insertLink( module, workspace, moduleRow.createData())
self.insertStateIcon(module,workspace,moduleRow.createData())
- self.insertStateIcons(module,workspace,moduleRow.createData())
+ self.insertStateIcons(gumpSet,module,workspace,moduleRow.createData())
moduleRow.createData(elapsedTimeToString(module.elapsedTime()))
if not mcount: mpkgTable.createLine('None')
@@ -1207,9 +1207,10 @@
return node
- def insertStateIcons(self,module,fromObject,xdocNode):
+ def insertStateIcons(self,gumpSet,module,fromObject,xdocNode):
icons=''
for project in module.getProjects():
+ if not gumpSet.inSequence(project): continue
self.insertStateIcon(project,fromObject,xdocNode)
# A separator, to allow line wrapping
xdocNode.createText(' ')