Yaron Koresh commited on
Commit
7758507
·
verified ·
1 Parent(s): 3ca0ea9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -251,8 +251,7 @@ def parallel(timeout,*pairs):
251
  for pair in pairs:
252
  f = pair.pop(0)
253
  queue.put(Command(f, pair))
254
- response = queue.get(timeout=timeout)
255
- return response
256
 
257
  # functionality
258
 
@@ -355,14 +354,13 @@ def handle(*inp):
355
 
356
  parargs = [[calc,*inp] for i in range(ln)]
357
  out_pipe = parallel(5,parargs)
358
- if ln == 1:
359
- out_pipe = [out_pipe]
360
- for i in range(ln):
361
  name = generate_random_string(12)+".png"
362
- export_to_gif(out_pipe[i].frames[0],name,fps=fps)
363
- out_pipe[i] = name
364
 
365
- return out_pipe
366
 
367
  def ui():
368
  global result
 
251
  for pair in pairs:
252
  f = pair.pop(0)
253
  queue.put(Command(f, pair))
254
+ return iter(queue.get(timeout=timeout))
 
255
 
256
  # functionality
257
 
 
354
 
355
  parargs = [[calc,*inp] for i in range(ln)]
356
  out_pipe = parallel(5,parargs)
357
+ let names = []
358
+ for i in out_pipe:
 
359
  name = generate_random_string(12)+".png"
360
+ export_to_gif(i.frames[0],name,fps=fps)
361
+ names.append( name )
362
 
363
+ return names
364
 
365
  def ui():
366
  global result