From 28daa4eedbc07e88746cf0206ff9eb702669831d Mon Sep 17 00:00:00 2001 From: Benjamin Bertrand Date: Tue, 4 Apr 2017 13:34:49 +0300 Subject: [PATCH] Change path Path --- opytex/opytex.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/opytex/opytex.py b/opytex/opytex.py index 6e608d1..074af98 100755 --- a/opytex/opytex.py +++ b/opytex/opytex.py @@ -5,7 +5,7 @@ import os import sys import optparse import csv -from path import path +from path import Path from .texenv import texenv @@ -42,11 +42,11 @@ def produce_and_compile(options): template = texenv.get_template(options.template) # Saving place - cwd = path("./").abspath() + cwd = Path("./").abspath() - template_file = path(options.template) + template_file = Path(options.template) - output = path(template_file.dirname()) / path(template_file.name[3:]) + output = Path(template_file.dirname()) / Path(template_file.name[3:]) if not options.csv_file: # {:02:0f} means that we want a 2 digits number @@ -68,7 +68,7 @@ def produce_and_compile(options): tmp_pdf = [] for infos in list_infos: #print("_______" + str(infos)) - dest = path(str(infos['num']) + output) + dest = Path(str(infos['num']) + output) tmp_pdf.append(dest.namebase + ".pdf") with open( dest, 'w') as f: f.write(template.render( infos = infos, **export_dict )) @@ -80,10 +80,10 @@ def produce_and_compile(options): os.system("rm *.aux *.log") if not options.no_join: - print(path("./").abspath()) - print("pdfjam "+ " ".join(tmp_pdf) + " -o all" + path(output).namebase + ".pdf") - os.system("pdfjam "+ " ".join(tmp_pdf) + " -o all" + path(output).namebase + ".pdf") - #os.system("pdfjam *.pdf -o all" + path(output).namebase + ".pdf") + print(Path("./").abspath()) + print("pdfjam "+ " ".join(tmp_pdf) + " -o all" + Path(output).namebase + ".pdf") + os.system("pdfjam "+ " ".join(tmp_pdf) + " -o all" + Path(output).namebase + ".pdf") + #os.system("pdfjam *.pdf -o all" + Path(output).namebase + ".pdf") print("rm " + " ".join(tmp_pdf)) os.system("rm " + " ".join(tmp_pdf)) @@ -99,10 +99,10 @@ def produce_and_compile(options): os.system("rm *.aux *.log") if not options.no_join: - print(path("./").abspath()) - print("pdfjam `find ./ -iname '[0-9]*.pdf'` -o corr" + path(output).namebase + ".pdf") - os.system("pdfjam `find ./ -iname '[0-9]*.pdf'` -o corr" + path(output).namebase + ".pdf") - #os.system("pdfjam *.pdf -o all" + path(output).namebase + ".pdf") + print(Path("./").abspath()) + print("pdfjam `find ./ -iname '[0-9]*.pdf'` -o corr" + Path(output).namebase + ".pdf") + os.system("pdfjam `find ./ -iname '[0-9]*.pdf'` -o corr" + Path(output).namebase + ".pdf") + #os.system("pdfjam *.pdf -o all" + Path(output).namebase + ".pdf") print("find ./ -iname '[0-9]*.pdf' -exec rm -f {} \;") os.system("find ./ -iname '[0-9]*.pdf' -exec rm -f {} \;")