mirror of
https://github.com/moparisthebest/xeps
synced 2025-02-16 07:10:15 -05:00
Add support for some verbose output for debugging.
git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@3505 4b5297f7-1745-476d-ba37-a9c6900126ab
This commit is contained in:
parent
68d7c54231
commit
63f731e9ba
16
gen.py
16
gen.py
@ -97,24 +97,34 @@ def buildPDF( file ):
|
||||
|
||||
error, desc = commands.getstatusoutput("xsltproc -o /tmp/xepbuilder/xep-" + nr + ".tex.xml xep2texml.xsl xep-" + nr + ".xml")
|
||||
if error != 0:
|
||||
if verbose == 1:
|
||||
print "Error: ", desc
|
||||
return False
|
||||
|
||||
error, desc = commands.getstatusoutput("texml -e utf8 /tmp/xepbuilder/xep-" + nr + ".tex.xml /tmp/xepbuilder/xep-" + nr + ".tex")
|
||||
if error != 0:
|
||||
if verbose == 1:
|
||||
print "Error: ", desc
|
||||
return False
|
||||
|
||||
#detect http urls and escape them to make them breakable
|
||||
error, desc = commands.getstatusoutput('''sed -i 's|\([\s"]\)\(http://[^ "]*\)|\1\\path{\2}|g' /tmp/xepbuilder/xep-''' + nr + ".tex")
|
||||
if error != 0:
|
||||
if verbose == 1:
|
||||
print "Error: ", desc
|
||||
return False
|
||||
|
||||
#adjust references
|
||||
error, desc = commands.getstatusoutput('''sed -i 's|\\hyperref\[#\([^}]*\)\]|\\hyperref\[\1\]|g' /tmp/xepbuilder/xep-''' + nr + ".tex")
|
||||
if error != 0:
|
||||
if verbose == 1:
|
||||
print "Error: ", desc
|
||||
return False
|
||||
|
||||
error, desc = commands.getstatusoutput('''sed -i 's|\\pageref{#\([^}]*\)}|\\pageref{\1}|g' /tmp/xepbuilder/xep-''' + nr + ".tex")
|
||||
if error != 0:
|
||||
if verbose == 1:
|
||||
print "Error: ", desc
|
||||
return False
|
||||
|
||||
olddir = os.getcwd()
|
||||
@ -122,11 +132,15 @@ def buildPDF( file ):
|
||||
|
||||
error, desc = commands.getstatusoutput("xelatex -interaction=batchmode xep-" + nr + ".tex")
|
||||
if error != 0:
|
||||
if verbose == 1:
|
||||
print "Error: ", desc
|
||||
os.chdir(olddir)
|
||||
return False
|
||||
|
||||
error, desc = commands.getstatusoutput("xelatex -interaction=batchmode xep-" + nr + ".tex")
|
||||
if error != 0:
|
||||
if verbose == 1:
|
||||
print "Error: ", desc
|
||||
os.chdir(olddir)
|
||||
return False
|
||||
|
||||
@ -134,6 +148,8 @@ def buildPDF( file ):
|
||||
|
||||
error, desc = commands.getstatusoutput("cp /tmp/xepbuilder/xep-" + nr + ".pdf " + XEPPATH + "/")
|
||||
if error != 0:
|
||||
if verbose == 1:
|
||||
print "Error: ", desc
|
||||
return False
|
||||
|
||||
return True
|
||||
|
Loading…
Reference in New Issue
Block a user