Commit 52c7678c authored by Aram Verstegen's avatar Aram Verstegen
Browse files

Create a temporary directory inside our working directory to make sure we don't leave a mess

parent 604addc3
......@@ -2,6 +2,7 @@
import sys
import argparse
import tempfile
from collections import OrderedDict
import hocr.parse
......@@ -572,7 +573,10 @@ if __name__ == '__main__':
# Allow external caller to override working directory from default /tmp/ or /var/tmp/fast/
if args.workingdir:
WORKING_DIR = args.workingdir
tempdir = tempfile.TemporaryDirectory(dir=args.workingdir, prefix='hocr_to_epub_')
else:
tempdir = tempfile.TemporaryDirectory(prefix='hocr_to_epub_')
WORKING_DIR = tempdir.name
EpubGenerator(args.infile, args.metafile, args.imagestack, args.scandata, args.outfile)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment