瀏覽代碼

Compile PDF quietly

Signed-off-by: Peter Hatina <peter@hatina.eu>
master
Peter Hatina 11 月之前
父節點
當前提交
146daef8ec
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. +3
    -2
      lib/invoice/cli.py

+ 3
- 2
lib/invoice/cli.py 查看文件

@@ -206,8 +206,9 @@ class Application:
assert(os.path.exists(tex_file))

log.debug("Creating PDF invoice...")
if subprocess.call((self.tex_program, "{0}.tex".format(invoice._name)), cwd=tmp_path) != 0:
raise GenerationError("PDF generation failed.")
with open(os.devnull, 'w') as FNULL:
if subprocess.call((self.tex_program, "{0}.tex".format(invoice._name)), cwd=tmp_path, stdout=FNULL) != 0:
raise GenerationError("PDF generation failed.")
assert(os.path.exists(tmp_pdf_file))

log.debug("Moving PDF file to the output directory...")


Loading…
取消
儲存