Merge branch 'parallel' of git://github.com/kalmi/Trimage into parallel

This commit is contained in:
Kilian Valkhof 2010-04-01 13:13:44 +02:00
commit a5da8a9a58
2 changed files with 42 additions and 23 deletions

View file

@ -1,5 +1,5 @@
#!/usr/bin/python
import time
import sys
import errno
from os import listdir
@ -329,6 +329,7 @@ class Worker(QThread):
def compress_file(self, images, showapp, verbose, imagelist):
"""Start the worker thread."""
for image in images:
time.sleep(0.05) #FIXME: Workaround http://code.google.com/p/pythonthreadpool/issues/detail?id=5
self.threadpool.add_job(image.compress, None, return_callback=self.toDisplay.put)
self.showapp = showapp
self.verbose = verbose