Updated h2inc_gtk.py

This commit is contained in:
2018-02-27 20:25:00 +01:00
parent 4280264fa6
commit 73a33cc87e

View File

@@ -58,6 +58,7 @@ class Worker():
for i in range(self.filecnt):
proportion = (float(i+1))/self.filecnt
self.queue.put((proportion, "working...", i))
time.sleep(0.01)
process_file(filelist[i])
self.queue.put((1.0, "finished"))
print("The worker has finished.")
@@ -106,12 +107,6 @@ def sourcedir_foldercnt(sourcedir):
# print(len(folderlist))
return cnt
def process_files():
print(srcdir)
print(destdir)
pool = mp.Pool(processes=num_cores)
pool.map(process_file, filelist)
def process_file(data):
outfile = ''
inputfile = data
@@ -301,13 +296,15 @@ class ExampleApp:
listener.connect("updated",self.callbackDisplay)
listener.connect("finished",self.callbackFinished)
print("Starting Worker")
self.process = Process(target=worker.go, args=())
self.process.start()
print("Starting Listener")
thread = threading.Thread(target=listener.go, args=())
thread.start()
print("Starting Worker")
self.process = Process(target=worker.go, args=())
self.process.start()
app = ExampleApp()
app.run(sys.argv)