mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
use notify for GarbageReport printing, don't print SUSPEND/RESUME msgs
This commit is contained in:
parent
a50ae3fcbf
commit
c02ed6356a
@ -136,7 +136,7 @@ class GarbageReport(Job):
|
||||
abbrev = '(abbreviated) '
|
||||
else:
|
||||
abbrev = ''
|
||||
s.append('\n===== Garbage Items %s=====' % abbrev)
|
||||
s.append('===== Garbage Items %s=====' % abbrev)
|
||||
digits = 0
|
||||
n = numGarbage
|
||||
while n > 0:
|
||||
@ -157,26 +157,26 @@ class GarbageReport(Job):
|
||||
s.append(format % (id, itype(self.garbage[id]), objStr))
|
||||
|
||||
if self._args.findCycles:
|
||||
s.append('\n===== Garbage Cycles =====')
|
||||
s.append('===== Garbage Cycles =====')
|
||||
for i in xrange(len(self.cycles)):
|
||||
yield None
|
||||
s.append('%s' % self.cycles[i])
|
||||
|
||||
if self._args.fullReport:
|
||||
format = '%0' + '%s' % digits + 'i:%s'
|
||||
s.append('\n===== Referrers By Number (what is referring to garbage item?) =====')
|
||||
s.append('===== Referrers By Number (what is referring to garbage item?) =====')
|
||||
for i in xrange(numGarbage):
|
||||
yield None
|
||||
s.append(format % (i, self.referrersByNumber[i]))
|
||||
s.append('\n===== Referents By Number (what is garbage item referring to?) =====')
|
||||
s.append('===== Referents By Number (what is garbage item referring to?) =====')
|
||||
for i in xrange(numGarbage):
|
||||
yield None
|
||||
s.append(format % (i, self.referentsByNumber[i]))
|
||||
s.append('\n===== Referrers (what is referring to garbage item?) =====')
|
||||
s.append('===== Referrers (what is referring to garbage item?) =====')
|
||||
for i in xrange(numGarbage):
|
||||
yield None
|
||||
s.append(format % (i, self.referrersByReference[i]))
|
||||
s.append('\n===== Referents (what is garbage item referring to?) =====')
|
||||
s.append('===== Referents (what is garbage item referring to?) =====')
|
||||
for i in xrange(numGarbage):
|
||||
yield None
|
||||
s.append(format % (i, self.referentsByReference[i]))
|
||||
@ -187,10 +187,7 @@ class GarbageReport(Job):
|
||||
self.printingBegin()
|
||||
for i in xrange(len(self._report)):
|
||||
yield None
|
||||
print self._report[i]
|
||||
# add an extra line at the end for readability
|
||||
if self.numGarbage > 0:
|
||||
print ''
|
||||
self.notify.info(self._report[i])
|
||||
self.printingEnd()
|
||||
|
||||
yield Job.Done
|
||||
|
@ -57,12 +57,22 @@ class Job(DirectObject):
|
||||
|
||||
def resume(self):
|
||||
# called every time JobManager is going to start running this job
|
||||
"""
|
||||
if self._printing:
|
||||
# we may be suspended/resumed multiple times per frame, that gets spammy
|
||||
# if we need to pick out the output of a job, put a prefix onto each line
|
||||
# of the output
|
||||
print 'JOB:%s:RESUME' % self._name
|
||||
"""
|
||||
pass
|
||||
def suspend(self):
|
||||
# called when JobManager is going to stop running this job for a while
|
||||
"""
|
||||
if self._printing:
|
||||
print 'JOB:%s:SUSPEND' % self._name
|
||||
#print 'JOB:%s:SUSPEND' % self._name
|
||||
pass
|
||||
"""
|
||||
pass
|
||||
|
||||
def finished(self):
|
||||
# called when the job finishes and has been removed from the JobManager
|
||||
|
Loading…
x
Reference in New Issue
Block a user