From acf98f1387e9ac8e72bfc66caf98e8c8e8c7d57f Mon Sep 17 00:00:00 2001 From: dechert Date: Thu, 17 Jun 2021 20:37:29 +0200 Subject: [PATCH] path to pdf --- converter.py | 4 ++-- rest_server.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/converter.py b/converter.py index 5fcb509..71381eb 100644 --- a/converter.py +++ b/converter.py @@ -119,11 +119,11 @@ def handle_q_and_a_row(line, list_of_q_and_as, category): def to_pdf(filename): import docker client = docker.from_env() + current_dir = os.getcwd() - print(current_dir) - # OUTPUT_FODLER = "output" output_folder_path = os.path.join(current_dir, OUTPUT_FODLER) + print(output_folder_path) # https://docker-py.readthedocs.io/en/stable/containers.html client.containers.run('marpteam/marp-cli', '{} --pdf'.format(filename), volumes=[output_folder_path + ':/home/marp/app/'], diff --git a/rest_server.py b/rest_server.py index 088a123..ff6cf1e 100644 --- a/rest_server.py +++ b/rest_server.py @@ -133,7 +133,7 @@ def download_pdf_file(): """Download the .pdf file.""" # print("sending file with name: " + filename) current_dir = os.getcwd() - full_dir = os.path.join(current_dir, "output") + full_dir = os.path.join(current_dir, OUTPUT_FODLER) print("full_dir: " + full_dir) return send_from_directory(full_dir, "slide-deck.pdf", as_attachment=True)