ajack 2003/09/29 10:47:18
Modified: python/gump context.py logic.py check.py document.py
Log:
1) Made check less verbose (need to whittle down logging/verbosity as things mature)
2) Moved icons to gump_icons to avoid clases
3) Added "start time"
4) Tweaked the logic of "what is a packaged module" to include one with the "main"
project(s) packaged,
but non-output-producing ones not as ok.
Revision Changes Path
1.14 +1 -1 jakarta-gump/python/gump/context.py
Index: context.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/context.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- context.py 28 Sep 2003 15:05:43 -0000 1.13
+++ context.py 29 Sep 2003 17:47:18 -0000 1.14
@@ -247,7 +247,7 @@
REASON_MISSING_OUTPUTS=8
reasonCodeDescriptions = { REASON_UNSET : "Not Set",
- REASON_PACKAGE : "Package Install",
+ REASON_PACKAGE : "Complete Package Install",
REASON_PACKAGE_BAD : "Bad Package Installation",
REASON_CIRCULAR : "Circular Dependency",
REASON_CONFIG_FAILED : "Configuration Failed",
1.7 +31 -5 jakarta-gump/python/gump/logic.py
Index: logic.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/logic.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- logic.py 26 Sep 2003 19:09:52 -0000 1.6
+++ logic.py 29 Sep 2003 17:47:18 -0000 1.7
@@ -271,10 +271,24 @@
scriptfile=os.path.normpath(os.path.join(basedir, scriptfullname))
classpath=getClasspath(project,workspace)
- return
Cmd(scriptfile,'buildscript_'+module.name+'_'+project.name,basedir,{'CLASSPATH':classpath})
-
+ return Cmd(scriptfile,'buildscript_'+module.name+'_'+project.name,\
+ basedir,{'CLASSPATH':classpath})
#
+#
+#
+def getOutputsList(project):
+ outputs=[]
+ for i in range(0,len(project.jar)):
+ jar=os.path.normpath(project.jar[i].path)
+ outputs.append(jar)
+
+ return outputs
+
+def hasOutputs(project):
+ return (len(getOutputsList(project)) > 0)
+
+#
# Maybe this is dodgy (it is inefficient) but we need some
# way to get the sun tools for a javac compiler for ant and
# I don't know a more portable way.
@@ -308,12 +322,12 @@
else:
log.error("<work element without nested or parent attributes on " +
project.name )
+ # Append projects
for depend in project.depend:
for jar in depend.jars():
classpath.append(jar.path)
- # :TODO: Check Exist... hmm, or not same result perhaps
- # albeit cleaner to remove
+ # Append optional projects (that may not exist)
for option in project.option:
for jar in option.jars():
classpath.append(jar.path)
@@ -407,7 +421,19 @@
if not isPackaged(project):
allPackaged=0
if packageCount:
- mctxt.addWarning("Incomplete \'Packaged\' Module. Project: " +
project.name + " is not packaged")
+ if not hasOutputs(project):
+ #
+ # Honorary package (allow folks to only mark the main
+ # project in a module as a package, and those that do
+ # not product significant outputs (e.g. test projects)
+ # will be asssumed to be packages.
+ #
+ pctxt=context.getProjectContextForProject(project)
+ pctxt.state=STATUS_COMPLETE
+ pctxt.reason=REASON_PACKAGE
+ else:
+ mctxt.addWarning("Incomplete \'Packaged\' Module. Project:
" + \
+ project.name + " is not packaged")
else:
packageCount+=1
1.21 +27 -9 jakarta-gump/python/gump/check.py
Index: check.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/check.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- check.py 25 Sep 2003 20:31:43 -0000 1.20
+++ check.py 29 Sep 2003 17:47:18 -0000 1.21
@@ -219,14 +219,19 @@
# for each project
for project in projects:
+ printed_header=0;
projectmissing = 0
- print
- print " TESTING " + project.name + " ************* "
+ if not printed_header:
+ printHeader(project)
+ printed_header=1
# for each dependency in current project
for depend in project.depend:
# if the dependency is not present in the projects, it's missing
if depend.project not in Project.list:
+ if not printed_header:
+ printHeader(project)
+ printed_header=1
projectmissing+=1
print " missing: "+depend.project
if depend.project not in missing:
@@ -235,6 +240,9 @@
for depend in project.option:
# if the dependency is not present in the projects, it's missing
if depend.project not in Project.list:
+ if not printed_header:
+ printHeader(project)
+ printed_header=1
projectmissing+=1
print " optional missing: "+depend.project
if depend.project not in optionalMissing:
@@ -243,18 +251,25 @@
if projectmissing>0:
print " total errors: " , projectmissing
- if len(optionalMissing)>0:
+ if len(optionalMissing)>0:
+ if not printed_header:
+ printHeader(project)
+ printed_header=1
print
- print " ***** MISSING OPTIONAL *ONLY* PROJECTS THAT ARE REFRENCED ***** "
+ print " ***** MISSING OPTIONAL *ONLY* PROJECTS THAT ARE REFERENCED ***** "
print
for missed in optionalMissing:
if missed not in missing:
optionalOnlyMissing.append(missed)
print " " + missed
+
+ if not printed_header:
+ printHeader(project)
+ printed_header=1
if len(missing)>0:
print
- print " ***** MISSING PROJECTS THAT ARE REFRENCED ***** "
+ print " ***** MISSING PROJECTS THAT ARE REFERENCED ***** "
print
for missed in missing:
print " " + missed
@@ -288,10 +303,13 @@
else:
print " - OK - All OPTIONAL projects that are referenced are present in the
workspace."
print " ***** RESULT ***** "
-
return 0
+def printHeader(project):
+ print " *****************************************************"
+ print " Project: " + project.name
+
def peekInGlobalProfile(missing):
print
1.48 +38 -6 jakarta-gump/python/gump/document.py
Index: document.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/document.py,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- document.py 28 Sep 2003 17:36:42 -0000 1.47
+++ document.py 29 Sep 2003 17:47:18 -0000 1.48
@@ -236,9 +236,7 @@
# Update Context
work=CommandWorkItem(WORK_TYPE_DOCUMENT,forrest,forrestResult)
- context.performedWork(work)
-
-
+ context.performedWork(work)
#####################################################################
#
@@ -362,11 +360,12 @@
packages=getPackagedProjectContexts(context)
if packages:
startTableXDoc(x)
- x.write(' <tr><th>Name</th><th>State</th><th>Location</th></tr>')
+ x.write('
<tr><th>Name</th><th>State</th><th>State</th><th>Location</th></tr>')
for pctxt in packages:
x.write(' <tr><!-- %s -->' % (pctxt.name))
x.write(' <td>%s</td>' % getContextLink(pctxt,0))
x.write(' <td>%s</td>' % getContextStateDescription(pctxt))
+ x.write(' <td>%s</td>' % getStatePairIcon(pctxt.getStatePair()))
x.write(' <td>%s</td>' % pctxt.project.home)
x.write(' </tr>')
endTableXDoc(x)
@@ -436,7 +435,40 @@
documentAnnotations(x,modulecontext.annotations)
- startSectionXDoc(x,'Projects')
+
+ startSectionXDoc(x,'Projects with TODOs')
+ x.write(' <table>\n')
+ x.write(' <tr>')
+ x.write(' <th>Name</th><th>State</th><th>Elapsed Time</th>')
+ x.write(' </tr>')
+ pcount=0
+ for pctxt in modulecontext:
+ if projectFilterList and not pctxt.project in projectFilterList: continue
+ pname=pctxt.name
+
+ #
+ # Determine if there are todos, otherwise continue
+ #
+ todos=0
+ for pair in pctxt.aggregateStates():
+ if pair.state==STATUS_FAILED:
+ todos=1
+
+ if not todos: continue
+
+ pcount+=1
+
+ x.write(' <tr><!-- %s -->' % (pname))
+ x.write(' <td><link href=\'%s\'>%s</link></td><td>%s</td>' % \
+
(getProjectRelativeUrl(pname),pname,getStatePairIcon(pctxt.getStatePair(),1)))
+ x.write(' <td>%s</td>' % elapsedTimeToString(pctxt.elapsedTime()))
+ x.write(' </tr>')
+
+ if not pcount: x.write(' <tr><td>None</td></tr>')
+ x.write(' </table>\n')
+ endSectionXDoc(x)
+
+ startSectionXDoc(x,'All Projects')
x.write(' <table>\n')
x.write(' <tr>')
x.write(' <th>Name</th><th>State</th><th>Elapsed Time</th>')
@@ -1046,7 +1078,7 @@
# Build the URL
iconName=gumpSafeName(lower(replace(uniqueName,' ','_')))
- url = getUp(depth)+"icons/"+iconName+".png";
+ url = getUp(depth)+"gump_icons/"+iconName+".png";
# Build the <icon xdoc
return '<icon src=\'' + url + '\' alt=\'' + description +'\'/>'
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]