mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
added StackTrace().compact()
This commit is contained in:
parent
e438f27d76
commit
5797b16416
@ -124,6 +124,15 @@ class StackTrace:
|
||||
else:
|
||||
self.trace = traceback.extract_stack(sys._getframe(1+start))
|
||||
|
||||
def compact(self):
|
||||
r = ''
|
||||
comma = ','
|
||||
for filename, lineNum, funcName, text in self.trace:
|
||||
r += '%s.%s:%s%s' % (filename[filename.rfind('\\')+1:], funcName, lineNum, comma)
|
||||
if len(r):
|
||||
r = r[:-len(comma)]
|
||||
return r
|
||||
|
||||
def __str__(self):
|
||||
r = "Debug stack trace of %s (back %s frames):\n"%(
|
||||
self.label, len(self.trace),)
|
||||
|
Loading…
x
Reference in New Issue
Block a user