ajack 2004/05/05 16:15:33
Modified: python/gump/syndication rss.py atom.py
python/gump/document/forrest documenter.py
Log:
Don't HTML-ize huge output files, just reference them.
Revision Changes Path
1.23 +7 -3 gump/python/gump/syndication/rss.py
Index: rss.py
===================================================================
RCS file: /home/cvs/gump/python/gump/syndication/rss.py,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- rss.py 5 May 2004 13:58:24 -0000 1.22
+++ rss.py 5 May 2004 23:15:32 -0000 1.23
@@ -285,6 +285,8 @@
# build information
for module in self.workspace.getModules():
+ if not self.run.getGumpSet().inModuleSequence(module): continue
+
self.syndicateModule(module,self.rss)
self.rss.serialize()
@@ -329,6 +331,8 @@
mainRSS.addItem(item)
for project in module.getProjects():
+ if not self.run.getGumpSet().inProjectSequence(project): continue
+
self.syndicateProject(project,moduleRSS,mainRSS)
moduleRSS.serialize()
1.16 +7 -3 gump/python/gump/syndication/atom.py
Index: atom.py
===================================================================
RCS file: /home/cvs/gump/python/gump/syndication/atom.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- atom.py 5 May 2004 15:08:53 -0000 1.15
+++ atom.py 5 May 2004 23:15:32 -0000 1.16
@@ -185,6 +185,8 @@
# build information
for module in self.workspace.getModules():
+ if not self.run.getGumpSet().inModuleSequence(module): continue
+
self.syndicateModule(module,self.feed)
self.feed.serialize()
@@ -228,6 +230,8 @@
# Syndicate each project
for project in module.getProjects():
+ if not self.run.getGumpSet().inProjectSequence(project): continue
+
self.syndicateProject(project,moduleFeed,mainFeed)
moduleFeed.serialize()
1.28 +73 -42 gump/python/gump/document/forrest/documenter.py
Index: documenter.py
===================================================================
RCS file: /home/cvs/gump/python/gump/document/forrest/documenter.py,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- documenter.py 5 May 2004 17:41:33 -0000 1.27
+++ documenter.py 5 May 2004 23:15:32 -0000 1.28
@@ -1760,7 +1760,7 @@
pathStr=path
contributor=referencingObject.getWorkspace()
instigator=None
- id=None
+ id=''
note=''
pathRow=pathTable.createRow()
@@ -2159,27 +2159,46 @@
outputSection=wdocument.createSection('Output')
outputSource=outputSection.createSource()
output=work.result.output
- if output:
+ if output:
try:
- o=None
- try:
- # Keep a length count to not exceed 32K
- size=0
- o=open(output, 'r')
- line=o.readline()
- while line:
- length = len(line)
- size += length
- # Crude to 'ensure' that escaped
- # it doesn't exceed 32K.
- if size > 20000:
- outputSection.createParagraph('Continuation...')
- outputSource=outputSection.createSource()
- size = length
- outputSource.createText(line)
+ if os.path.getsize(output) > 100000:
+ #
+ # This is *big* just copy/point to it
+ #
+ from shutil import copyfile
+ # Extract name, to make relative to group
+ outputBaseName=os.path.basename(output)
+ (outputName,outputExtn)=os.path.splitext(outputBaseName)
+ displayedOutput=self.resolver.getFile(work, outputName,
oututExtn, 0)
+
+ # Do the transfer..
+ copyfile(output,displayedOutput)
+ outputSource.createLink(outputBaseName)
+
+ else:
+ #
+ # Display it 'prettily' in HTML
+ #
+ o=None
+ try:
+ # Keep a length count to not exceed 32K
+ size=0
+ o=open(output, 'r')
line=o.readline()
- finally:
- if o: o.close()
+ while line:
+ length = len(line)
+ size += length
+ # Crude to 'ensure' that escaped
+ # it doesn't exceed 32K.
+ if size > 20000:
+ outputSection.createParagraph('Continuation...')
+ outputSource=outputSection.createSource()
+ size = length
+ outputSource.createText(line)
+ line=o.readline()
+ finally:
+ if o: o.close()
+
except Exception, details:
outputSource.createText('Failed to copy contents from :' +
output + ' : ' + str(details))
else:
@@ -2250,6 +2269,7 @@
listingRow.createData('File')
listingRow.createData(str(os.path.getsize(filePath)))
else:
+
#
# Show the content...
#
@@ -2257,29 +2277,40 @@
outputSource=outputSection.createSource()
output=fileReference.getPath()
if output:
- try:
- o=None
- try:
- # Keep a length count to not exceed 32K
- size=0
- o=open(output, 'r')
- line=o.readline()
- while line:
-
- line=wrapLine(line,100,'...\n',' ')
-
- length = len(line)
- size += length
- # Crude to 'ensure' that escaped
- # it doesn't exceed 32K.
- if size > 20000:
- outputSection.createParagraph('Continuation...')
- outputSource=outputSection.createSource()
- size = length
- outputSource.createText(line)
+ try:
+ if os.path.getsize(output) > 100000:
+ #
+ # This is *big* just copy/point to it
+ #
+ from shutil import copyfile
+ # Extract name, to make relative to group
+ outputBaseName=os.path.basename(output)
+ (outputName,outputExtn)=os.path.splitext(outputBaseName)
+ displayedOutput=self.resolver.getFile(fileReference,
outputName, oututExtn, 0)
+
+ # Do the transfer..
+ copyfile(output,displayedOutput)
+ outputSource.createLink(outputBaseName)
+ else:
+ o=None
+ try:
+ # Keep a length count to not exceed 32K
+ size=0
+ o=open(output, 'r')
line=o.readline()
- finally:
- if o: o.close()
+ while line:
+ length = len(line)
+ size += length
+ # Crude to 'ensure' that escaped
+ # it doesn't exceed 32K.
+ if size > 20000:
+
outputSection.createParagraph('Continuation...')
+ outputSource=outputSection.createSource()
+ size = length
+ outputSource.createText(line)
+ line=o.readline()
+ finally:
+ if o: o.close()
except Exception, details:
outputSource.createText('Failed to copy contents from :' +
output + ' : ' + str(details))
else:
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]