Skip to content
This repository has been archived by the owner on May 4, 2021. It is now read-only.

Commit

Permalink
[exif2timestream] make progess meter work serially
Browse files Browse the repository at this point in the history
Now, the Processed X images progress meter works when -1 is given on the
command line
  • Loading branch information
kdm9 committed Jun 2, 2014
1 parent 3c179ee commit f29a749
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions exif2timestream.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,10 +562,18 @@ def main(opts):
last_date = None
subsec = 0
count = 0
if n_cam_images < 100:
each = 10
else:
each = 50
# TODO: sort out the whole subsecond clusterfuck
if "-1" in opts and opts["-1"]:
LOG.info("Using 1 process (What is this? Fucking 1990?)")
for image in images:
count += 1
if count % each == 0:
print("Processed {: 5d} Images".format(count),
end='\r')
process_image((image, camera, ext))
else:
from multiprocessing import Pool, cpu_count
Expand All @@ -580,10 +588,6 @@ def main(opts):
# set the function's camera-wide arguments
args = zip(images, cycle([camera]), cycle([ext]))
pool = Pool(threads)
if n_cam_images < 100:
each = 10
else:
each = 50
for _ in pool.imap(process_image, args):
count += 1
if count % each == 0:
Expand Down

0 comments on commit f29a749

Please sign in to comment.