Update of /cvsroot/happydoc/HappyDoc/happydoclib
In directory usw-pr-cvs1:/tmp/cvs-serv18083/happydoclib
Modified Files:
happydom.py
Log Message:
Add getPath() method.
Use getFilename() in getFullyQualifiedName().
Index: happydom.py
===================================================================
RCS file: /cvsroot/happydoc/HappyDoc/happydoclib/happydom.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** happydom.py 11 Nov 2001 18:46:19 -0000 1.4
--- happydom.py 24 Aug 2002 19:47:48 -0000 1.5
***************
*** 115,118 ****
--- 115,136 ----
return self._parent
+ def getPath(self):
+ "Returns a sequence of node names leading to this node."
+ happydoclib.TRACE.into('HappyDom', 'getPath',
+ object=self)
+ parent = self.getParent()
+ if parent:
+ path = parent.getPath()
+ else:
+ path = []
+ name = self.getName()
+ happydoclib.TRACE.writeVar(name=name)
+ if name:
+ path.append( name )
+ else:
+ happydoclib.TRACE.write('name was empty, ADDED NOTHING')
+ happydoclib.TRACE.outof(path)
+ return path
+
def getFilename(self):
"Return the filename from which the object came."
***************
*** 134,138 ****
happydoclib.TRACE.writeVar(parent_base=parent_base)
happydoclib.TRACE.writeVar(parent_ext=parent_ext)
! name = '%s_%s%s' % ( parent_base, self.getName(), parent_ext )
happydoclib.TRACE.outof(name)
return name
--- 152,157 ----
happydoclib.TRACE.writeVar(parent_base=parent_base)
happydoclib.TRACE.writeVar(parent_ext=parent_ext)
! my_file = self.getFilename()
! name = happydoclib.path.join(parent_base, my_file)
happydoclib.TRACE.outof(name)
return name
|