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/10/07 21:19:31 UTC
cvs commit: jakarta-gump/python/gump repository.py model.py context.py build.py document.py
ajack 2003/10/07 12:19:31
Modified: python/gump repository.py model.py context.py build.py
document.py
Log:
Publish output jars to a repository
Revision Changes Path
1.3 +20 -2 jakarta-gump/python/gump/repository.py
Index: repository.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/repository.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- repository.py 29 Sep 2003 23:54:50 -0000 1.2
+++ repository.py 7 Oct 2003 19:19:31 -0000 1.3
@@ -62,6 +62,14 @@
A Repository
"""
+import os
+
+from gump.conf import *
+from gump import logging, log
+from gump.context import *
+
+from shutil import copyfile
+
class Repository:
"""Contains Repository Contents"""
@@ -92,12 +100,20 @@
# ../{group}/jars/{output files}
#
def getGroupDir(self,group,rdir=None):
- if not rdir: rdir=getRepositoryRootDir(self)
+ if not rdir: rdir=self.getRepositoryDir()
gdir=os.path.abspath(os.path.join(rdir,group))
if not os.path.exists(gdir): os.mkdir(gdir)
jdir=os.path.abspath(os.path.join(gdir,'jars'))
if not os.path.exists(jdir): os.mkdir(jdir)
return jdir
+
+ def publish(self,group,jar):
+ cdir=self.getGroupDir(group)
+ jarname=os.path.basename(jar)
+ newjar=os.path.join(cdir,jarname)
+ copyfile(jar,newjar)
+
+
# static void main()
if __name__=='__main__':
@@ -119,6 +135,8 @@
from gump import load
workspace=load(ws, context)
- repo=Repository(workspace.jars)
+ repo=Repository(workspace.jardir)
+
+ repo.publish('testgroup','test.jar')
1.21 +6 -3 jakarta-gump/python/gump/model.py
Index: model.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/model.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- model.py 29 Sep 2003 23:20:00 -0000 1.20
+++ model.py 7 Oct 2003 19:19:31 -0000 1.21
@@ -131,6 +131,9 @@
if not self.logdir: self.logdir=os.path.join(self.basedir,"log")
if not os.path.exists(self.logdir): os.mkdir(self.logdir)
+ if not self.jardir: self.jardir=os.path.join(self.basedir,"repo")
+ if not os.path.exists(self.jardir): os.mkdir(self.jardir)
+
if not self.cvsdir: self.cvsdir=os.path.join(self.basedir,"cvs")
if not os.path.exists(self.cvsdir): os.mkdir(self.cvsdir)
1.16 +7 -3 jakarta-gump/python/gump/context.py
Index: context.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/context.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- context.py 29 Sep 2003 23:54:50 -0000 1.15
+++ context.py 7 Oct 2003 19:19:31 -0000 1.16
@@ -344,10 +344,14 @@
def aggregateStates(self, states=None):
if not states: states=[]
- pair=self.getStatePair()
+
+ # Just do subordinates...
+ #
+ # pair=self.getStatePair()
# Add state, if not already there
- if not stateUnset(pair.status) and not pair in states: \
- states.append(pair)
+ #if not stateUnset(pair.status) and not pair in states: \
+ # states.append(pair)
+
# Subbordinates
for ctxt in self:
ctxt.aggregateStates(states)
1.19 +10 -4 jakarta-gump/python/gump/build.py
Index: build.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/build.py,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- build.py 29 Sep 2003 23:10:12 -0000 1.18
+++ build.py 7 Oct 2003 19:19:31 -0000 1.19
@@ -169,6 +169,9 @@
log.info('--- Building work directories with sources')
+ # Place repository in jardir (to be renamed to repodir)
+ repository=Repository(workspace.jardir)
+
# build all projects this project depends upon, then the project itself
for project in sequence:
@@ -206,7 +209,10 @@
pctxt.propagateErrorState(STATUS_FAILED,REASON_MISSING_OUTPUTS)
outputsOk=0
pctxt.addError("Missing Output: " + str(jar))
-
+ else:
+ # Copy to repository
+ repository.publish( module.name, jar )
+
if outputsOk:
pctxt.status=STATUS_SUCCESS
elif project.home:
1.66 +28 -8 jakarta-gump/python/gump/document.py
Index: document.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/document.py,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -r1.65 -r1.66
--- document.py 6 Oct 2003 20:05:38 -0000 1.65
+++ document.py 7 Oct 2003 19:19:31 -0000 1.66
@@ -140,7 +140,7 @@
if full or 1: # Testing
documentStatistics(workspace,context,db,moduleFilterList,projectFilterList)
- #documentXRef(workspace,context)
+ documentXRef(workspace,context)
executeForrest(workspace,context)
@@ -295,6 +295,7 @@
titledDataInTableXDoc(x,"Scratch Directory : ", str(workspace.scratchdir))
# :TODO: We have duplicate dirs? tmp = scratch?
titledDataInTableXDoc(x,"Log Directory : ", str(workspace.logdir))
+ titledDataInTableXDoc(x,"Jars Repository : ", str(workspace.jardir))
titledDataInTableXDoc(x,"CVS Directory : ", str(workspace.cvsdir))
titledDataInTableXDoc(x,"Package Directory : ", str(workspace.pkgdir))
titledDataInTableXDoc(x,"Email Address: ", str(workspace.email))
@@ -324,7 +325,7 @@
startSectionXDoc(x,'Modules with TODOs')
startTableXDoc(x)
x.write(' <tr>')
- x.write(' <th>Name</th><th>Project State(s)</th><th>Elapsed Time</th>')
+ x.write(' <th>Name</th><th>Module State</th><th>Project State(s)</th><th>Elapsed Time</th>')
x.write(' </tr>')
mcount=0
for mctxt in context:
@@ -345,8 +346,10 @@
mcount+=1
x.write(' <tr><!-- %s -->\n' % (mname))
- x.write(' <td><link href=\'%s\'>%s</link></td><td>%s</td>\n' % \
- (getModuleRelativeUrl(mname),mname,getStateIcons(mctxt.aggregateStates())))
+ x.write(' <td><link href=\'%s\'>%s</link></td><td>%s</td><td>%s</td>\n' % \
+ (getModuleRelativeUrl(mname),mname, \
+ getStatePairIcon(mctxt.getStatePair()), \
+ getStateIcons(mctxt.aggregateStates())))
x.write(' <td>%s</td>\n' % elapsedTimeToString(mctxt.elapsedTime()))
x.write(' </tr>\n\n')
if not mcount: x.write(' <tr><td>None</td></tr>')
@@ -367,7 +370,7 @@
startSectionXDoc(x,'All Modules')
startTableXDoc(x)
x.write(' <tr>')
- x.write(' <th>Name</th><th>Project State(s)</th><th>Elapsed Time</th>')
+ x.write(' <th>Name</th><th>Module State</th><th>Project State(s)</th><th>Elapsed Time</th>')
x.write(' </tr>')
mcount=0
for mctxt in context:
@@ -381,8 +384,10 @@
mcount+=1
x.write(' <tr><!-- %s -->\n' % (mname))
- x.write(' <td><link href=\'%s\'>%s</link></td><td>%s</td>\n' % \
- (getModuleRelativeUrl(mname),mname,getStateIcons(mctxt.aggregateStates())))
+ x.write(' <td><link href=\'%s\'>%s</link></td><td>%s</td><td>%s</td>\n' % \
+ (getModuleRelativeUrl(mname),mname,\
+ getStatePairIcon(mctxt.getStatePair()), \
+ getStateIcons(mctxt.aggregateStates())))
x.write(' <td>%s</td>\n' % elapsedTimeToString(mctxt.elapsedTime()))
x.write(' </tr>\n\n')
if not mcount: x.write(' <tr><td>None</td></tr>')
@@ -961,7 +966,7 @@
insertTableDataXDoc(x, str(round(mctxt.getFOGFactor(),2)))
projectsString=''
- for pctxt in mctxt.getDependees():
+ for pctxt in mctxt:
projectsString+=getContextLink(pctxt)
projectsString+='='
projectsString+=str(round(pctxt.getFOGFactor(),2))
@@ -972,6 +977,21 @@
endTableXDoc(x)
footerXDoc(x)
+ endXDoc(x)
+
+#####################################################################
+#
+# XRef Pages
+#
+def documentXRef(workspace,context,moduleFilterList=None,projectFilterList=None):
+
+ xdir=getXRefDir(workspace)
+ x=startXDoc(getXRefDocument(workspace,xdir))
+ headerXDoc(x,'Cross Reference')
+
+ # :TODO: Packages and such...
+
+ footerXDoc(x)
endXDoc(x)