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