Skip to content

Commit

Permalink
cleaned up output, and fixed bug with temp dir not being deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
thequbit committed Sep 12, 2015
1 parent 94001ba commit 76df5c8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = yapot
version = 0.4.0
version = 0.4.1
author = Timothy Duffy
author-email = [email protected]
summary = Yet Another PDF OCR Tool
Expand Down
9 changes: 1 addition & 8 deletions yapot/yapot.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ def pdf_to_image(pdf_filename, image_filename, resolution):
'-separate',
'{0}'.format(image_filename),
]
print(' '.join(cli))
subprocess.call(cli)
return None

Expand All @@ -143,7 +142,6 @@ def make_thumb(image_filename, thumb_filename, thumb_size):
image_filename,
thumb_filename,
]
print(' '.join(cli))
subprocess.call(cli)
return None

Expand All @@ -162,7 +160,6 @@ def image_ocr(filename):
'-psm',
'6',
]
print(' '.join(cli))
subprocess.call(cli)
with open(text_filename, 'r') as f:
text = f.read()
Expand Down Expand Up @@ -191,9 +188,5 @@ def cleanup_yapot(output_dir):
'''
Clean up all the temp files that yapot makes.
'''
try:
shutil.rmtree(output_dir)
except Exception as e:
# TODO: Do something with this error
pass
shutil.rmtree(output_dir)

0 comments on commit 76df5c8

Please sign in to comment.