# HG changeset patch # User paulb # Date 1163895024 0 # Node ID fe4ac9803e8a587101c9dd2ad1b375ca005db5f4 # Parent 96c2b5ec134c80824ea52bd98b13d79b6cc01b11 [project @ 2006-11-19 00:10:24 by paulb] Fixed process accounting. diff -r 96c2b5ec134c -r fe4ac9803e8a examples/PyGmy/ppygmy.py --- a/examples/PyGmy/ppygmy.py Sun Nov 19 00:10:06 2006 +0000 +++ b/examples/PyGmy/ppygmy.py Sun Nov 19 00:10:24 2006 +0000 @@ -372,15 +372,15 @@ exchange = pprocess.Exchange() y = 0 + nproc = len(exchange.active()) + while y < self.height or nproc > 0: - if nproc < limit: + if y < self.height and nproc < limit: channel = pprocess.start(self.render_row, y) exchange.add(channel) y += 1 - nproc += 1 for channel in exchange.ready(): - nproc -= 1 sy, row = channel.receive() sx = 0 for col in row: @@ -393,6 +393,8 @@ percentstr = str(int((count/float(total))*100))+"%" print "\b\b\b"+percentstr + nproc = len(exchange.active()) + image.save(filename) # vim: tabstop=4 expandtab shiftwidth=4