Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove long versions of system commands
  • Loading branch information
kthoden committed Sep 4, 2020
1 parent 8a4b5d4 commit cb00959
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/eoatex2imxml.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8; mode: python -*-
# Time-stamp: <2020-09-04 13:48:53 (kthoden)>
# Time-stamp: <2020-09-04 13:54:24 (kthoden)>

"""
Converts Latex files into a customized DocBook XML file.
Expand Down Expand Up @@ -285,15 +285,13 @@ def TeX2PNG(LaTeXCode, Type, Chapter, Number):
arg1=(formula_tmp_dir / (Type + "_" + str(Chapter) + "_" + str(Number) + ".pdf")).absolute(),
arg2=(formula_tmp_dir / (Type + "_" + str(Chapter) + "_" + str(Number) + "a.pdf")).absolute()
)
# Kommando = PDFCROP_EXEC + " " + formula_tmp_dir + Type + "_" + str(Chapter) + "_" + str(Number) + ".pdf " + formula_tmp_dir + Type + "_" + str(Chapter) + "_" + str(Number) + "a.pdf"
Argumente = shlex.split(Kommando)
subprocess.check_call(Argumente,cwd=formula_tmp_dir,stdout=Datei)
Kommando = "{cmd} convert -density 144 {arg1} {arg2}".format(
cmd=GM_PATH,
arg1 = (formula_tmp_dir / (Type + "_" + str(Chapter) + "_" + str(Number) + "a.pdf")).absolute(),
arg2 = (items_dir / (Type + "_" + str(Chapter) + "_" + str(Number) + ".png")).absolute()
)
# Kommando = GM_PATH + " convert -density 144 " + formula_tmp_dir + Type + "_" + str(Chapter) + "_" + str(Number) + "a.pdf " + os.getenv("PWD") + "/items/" + Type + "_" + str(Chapter) + "_" + str(Number) + ".png"
Argumente = shlex.split(Kommando)
subprocess.check_call(Argumente,cwd=formula_tmp_dir,stdout=Datei)

Expand Down Expand Up @@ -802,7 +800,6 @@ def process_inline_equations( xmlChapters ):
arg1 = (formula_tmp_dir / ("EOAformulas_" + str(intRunningOrder) + ".pdf")).absolute(),
arg2 = (formula_tmp_dir / (dictEOAineqs[intRunningOrder] + ".pdf")).absolute()
)
# Kommando = PDFCROP_EXEC + " " + formula_tmp_dir + "EOAformulas_" + str(intRunningOrder) + ".pdf " + formula_tmp_dir + dictEOAineqs[intRunningOrder] + ".pdf"
Argumente = shlex.split(Kommando)
subprocess.check_call(Argumente,cwd=formula_tmp_dir,stdout=Datei)

Expand All @@ -811,7 +808,6 @@ def process_inline_equations( xmlChapters ):
arg1 = (formula_tmp_dir / (dictEOAineqs[intRunningOrder] + ".pdf")).absolute(),
arg2 = (items_dir / (dictEOAineqs[intRunningOrder] + ".png")).absolute()
)
#Kommando = GM_PATH + " convert -density 144 " + formula_tmp_dir + dictEOAineqs[intRunningOrder] + ".pdf " + os.getenv("PWD") + "/items/" + dictEOAineqs[intRunningOrder] + ".png"
Argumente = shlex.split(Kommando)
subprocess.check_call(Argumente,cwd=formula_tmp_dir,stdout=Datei)
counter_dictEOAineqs += 1
Expand Down Expand Up @@ -888,7 +884,6 @@ def process_eoachem( xmlChapters ):
arg1=(formula_tmp_dir / ("EOAformulas_" + str(intRunningOrder) + ".pdf")).absolute(),
arg2=(formula_tmp_dir / (dictEOAchems[intRunningOrder] + ".pdf")).absolute()
)
# Kommando = PDFCROP_EXEC + " " + formula_tmp_dir + "EOAformulas_" + str(intRunningOrder) + ".pdf " + formula_tmp_dir + dictEOAchems[intRunningOrder] + ".pdf"
Argumente = shlex.split(Kommando)
subprocess.check_call(Argumente,cwd=formula_tmp_dir,stdout=Datei)

Expand All @@ -897,7 +892,6 @@ def process_eoachem( xmlChapters ):
arg1 = (formula_tmp_dir / (dictEOAchems[intRunningOrder] + ".pdf")).absolute(),
arg2 = (items_dir / (dictEOAchems[intRunningOrder] + ".png")).absolute()
)
# Kommando = GM_PATH + " convert -density 144 " + formula_tmp_dir + dictEOAchems[intRunningOrder] + ".pdf " + os.getenv("PWD") + "/items/" + dictEOAchems[intRunningOrder] + ".png"
Argumente = shlex.split(Kommando)
subprocess.check_call(Argumente,cwd=formula_tmp_dir,stdout=Datei)
counter_dictEOAchems += 1
Expand Down

0 comments on commit cb00959

Please sign in to comment.