Skip to content

Commit

Permalink
allow to specify output path for pdf
Browse files Browse the repository at this point in the history
  • Loading branch information
relleums committed Aug 19, 2024
1 parent 93009a8 commit 4eaf7a1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 5 additions & 1 deletion pyslidescape/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def status_of_what_needs_to_be_done(work_dir):
return sts


def make(work_dir, pool=None, verbose=True):
def make(work_dir, out_path=None, pool=None, verbose=True):
"""
pdf
resources
Expand Down Expand Up @@ -235,6 +235,10 @@ def make(work_dir, pool=None, verbose=True):
list_of_image_paths=list_of_image_paths, out_path=pdf_path
)

if out_path is not None:
shutil.copy(src=pdf_path, dst=out_path + ".part")
os.rename(out_path + ".part", out_path)

return True


Expand Down
7 changes: 3 additions & 4 deletions pyslidescape/apps/main.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import pyslidescape
import argparse
import os
import shutil
from importlib import resources as importlib_resources
import sys
import multiprocessing


def main():
Expand Down Expand Up @@ -55,10 +54,10 @@ def main():
args = parser.parse_args()

if args.command == "compile":
pyslidescape.compile(
pyslidescape.make(
work_dir=args.work_dir,
out_path=args.out_path,
num_threads=args.num_threads,
pool=multiprocessing.Pool(args.num_threads),
)
elif args.command == "slide":
pyslidescape.write_template_slide(
Expand Down
2 changes: 1 addition & 1 deletion pyslidescape/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.0.3"
__version__ = "1.0.4"

0 comments on commit 4eaf7a1

Please sign in to comment.