ajack 2004/05/05 08:08:53
Modified: python/gump/document/forrest xdoc.py
python/gump/utils __init__.py
python/gump/document resolver.py
python/gump/syndication atom.py
python/gump/test pyunit.py
Log:
Still working on smoothing this thing out, GC, and such.
Revision Changes Path
1.9 +15 -8 gump/python/gump/document/forrest/xdoc.py
Index: xdoc.py
===================================================================
RCS file: /home/cvs/gump/python/gump/document/forrest/xdoc.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- xdoc.py 5 May 2004 12:59:38 -0000 1.8
+++ xdoc.py 5 May 2004 15:08:52 -0000 1.9
@@ -182,17 +182,12 @@
piece.setOwner(self)
return piece
-
-
+
def serialize(self):
self.callStart()
self.middle()
self.callEnd()
- # Probably ought do this higher up
- self.unlink()
- invokeGarbageCollection()
-
def callStart(self,piece=None):
if not piece: piece = self
if hasattr(piece,'start') and callable(piece.start):
@@ -238,8 +233,15 @@
def unlink(self):
# Unlink subpieces...
- for subpiece in self.subpieces:
- subpiece.unlink()
+ if self.subpieces:
+ for subpiece in self.subpieces:
+ subpiece.unlink()
+
+ # Then destroy the list
+ self.subpieces=None
+
+ self.context=None
+
# Unlink oneself
self.setOwner(None)
@@ -717,6 +719,11 @@
self.context.writeLine('</body>')
self.context.writeLine('</document>')
self.close()
+
+ # Probably ought do this higher up
+ self.unlink()
+ invokeGarbageCollection()
+
def createSection(self,title,transient=0):
return self.storePiece(XDocSection(self.createSubContext(transient),title))
1.38 +2 -0 gump/python/gump/utils/__init__.py
Index: __init__.py
===================================================================
RCS file: /home/cvs/gump/python/gump/utils/__init__.py,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- __init__.py 5 May 2004 13:58:24 -0000 1.37
+++ __init__.py 5 May 2004 15:08:52 -0000 1.38
@@ -400,6 +400,8 @@
def invokeGarbageCollection():
try:
import gc
+ tracked = len(gc.get_objects())
+ log.debug('Objects Tracked by GC : ' + `tracked`)
unreachable = gc.collect()
if unreachable:
log.debug('Objects Unreachable by GC : ' + `unreachable`)
1.26 +1 -1 gump/python/gump/document/resolver.py
Index: resolver.py
===================================================================
RCS file: /home/cvs/gump/python/gump/document/resolver.py,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- resolver.py 16 Apr 2004 17:28:43 -0000 1.25
+++ resolver.py 5 May 2004 15:08:52 -0000 1.26
@@ -210,7 +210,7 @@
def getAbsoluteFile(self,object,documentName=None,extn='.xml',notXDocs=None):
if not documentName: documentName='bogus'
- location=Location(Path(),documentName,extn)
+ location=Location(Path(),documentName+extn)
file=concatenate(self.rootDir,location.serialize())
return file
1.15 +4 -4 gump/python/gump/syndication/atom.py
Index: atom.py
===================================================================
RCS file: /home/cvs/gump/python/gump/syndication/atom.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- atom.py 5 May 2004 13:58:24 -0000 1.14
+++ atom.py 5 May 2004 15:08:53 -0000 1.15
@@ -154,7 +154,7 @@
""")
def serialize(self):
- log.inf("Atom Feed to : " + self.file);
+ log.info("Atom Feed to : " + self.file);
stream = open(self.file,'w')
modified=time.strftime('%Y-%m-%dT%H:%M:%SZ', gmtime())
1.29 +4 -1 gump/python/gump/test/pyunit.py
Index: pyunit.py
===================================================================
RCS file: /home/cvs/gump/python/gump/test/pyunit.py,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- pyunit.py 16 Apr 2004 17:28:35 -0000 1.28
+++ pyunit.py 5 May 2004 15:08:53 -0000 1.29
@@ -169,7 +169,7 @@
tests=[]
results=[]
- # log.setLevel(logging.DEBUG )
+ log.setLevel(logging.DEBUG )
# Give a place to work in..
if not os.path.exists('./test'): os.mkdir('./test')
@@ -230,6 +230,9 @@
# Record the problem
results.append(Problem(self,name,message))
+
+ # Seems a nice place to clean up...
+ invokeGarbageCollection()
if hasattr(self,'suiteTearDown'):
self.suiteTearDown()
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]