mirror of
https://github.com/moparisthebest/xeps
synced 2024-11-22 09:12:19 -05:00
Adding buildAll functionality.
git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@3508 4b5297f7-1745-476d-ba37-a9c6900126ab
This commit is contained in:
parent
149aa9f2f4
commit
e117c97afe
27
gen.py
27
gen.py
@ -38,6 +38,7 @@ import os
|
|||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
import getopt
|
import getopt
|
||||||
|
import glob
|
||||||
|
|
||||||
XEPPATH = "/var/www/vhosts/xmpp.org/extensions"
|
XEPPATH = "/var/www/vhosts/xmpp.org/extensions"
|
||||||
BUILDDICT = "/var/xsf/xepbuild.dict"
|
BUILDDICT = "/var/xsf/xepbuild.dict"
|
||||||
@ -132,14 +133,14 @@ def buildPDF( file ):
|
|||||||
os.chdir("/tmp/xepbuilder")
|
os.chdir("/tmp/xepbuilder")
|
||||||
|
|
||||||
error, desc = commands.getstatusoutput("xelatex -interaction=batchmode xep-" + nr + ".tex")
|
error, desc = commands.getstatusoutput("xelatex -interaction=batchmode xep-" + nr + ".tex")
|
||||||
if not checkError(error, desc):
|
#if not checkError(error, desc):
|
||||||
os.chdir(olddir)
|
# os.chdir(olddir)
|
||||||
return False
|
# return False
|
||||||
|
|
||||||
error, desc = commands.getstatusoutput("xelatex -interaction=batchmode xep-" + nr + ".tex")
|
error, desc = commands.getstatusoutput("xelatex -interaction=batchmode xep-" + nr + ".tex")
|
||||||
if not checkError(error, desc):
|
#if not checkError(error, desc):
|
||||||
os.chdir(olddir)
|
# os.chdir(olddir)
|
||||||
return False
|
# return False
|
||||||
|
|
||||||
os.chdir(olddir)
|
os.chdir(olddir)
|
||||||
|
|
||||||
@ -161,6 +162,11 @@ def buildXEP( filename ):
|
|||||||
else:
|
else:
|
||||||
print "PDF(ERROR)"
|
print "PDF(ERROR)"
|
||||||
|
|
||||||
|
def buildAll():
|
||||||
|
files = glob.glob('xep-????.xml')
|
||||||
|
for file in files:
|
||||||
|
buildXEP( file )
|
||||||
|
|
||||||
def usage():
|
def usage():
|
||||||
print "gen.py: generate nice XHTML and beatuy PDF out of the XEP XML"
|
print "gen.py: generate nice XHTML and beatuy PDF out of the XEP XML"
|
||||||
print ""
|
print ""
|
||||||
@ -172,9 +178,10 @@ def usage():
|
|||||||
|
|
||||||
def main(argv):
|
def main(argv):
|
||||||
global verbose
|
global verbose
|
||||||
|
buildall = False
|
||||||
|
|
||||||
try:
|
try:
|
||||||
options, remainder = getopt.gnu_getopt(argv, "v")
|
options, remainder = getopt.gnu_getopt(argv, "va")
|
||||||
except getopt.GetoptError:
|
except getopt.GetoptError:
|
||||||
usage()
|
usage()
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
@ -182,7 +189,10 @@ def main(argv):
|
|||||||
for opt, arg in options:
|
for opt, arg in options:
|
||||||
if opt in ('-v'):
|
if opt in ('-v'):
|
||||||
verbose = True
|
verbose = True
|
||||||
|
elif opt in ('-a'):
|
||||||
|
buildall = True
|
||||||
|
|
||||||
|
if len(remainder) > 0:
|
||||||
xep = remainder[0]
|
xep = remainder[0]
|
||||||
|
|
||||||
last_build = loadDict(BUILDDICT)
|
last_build = loadDict(BUILDDICT)
|
||||||
@ -192,6 +202,9 @@ def main(argv):
|
|||||||
commands.getstatusoutput("cp ../images/xmpp.pdf /tmp/xepbuilder/xmpp.pdf")
|
commands.getstatusoutput("cp ../images/xmpp.pdf /tmp/xepbuilder/xmpp.pdf")
|
||||||
commands.getstatusoutput("cp ../images/xmpp-text.pdf /tmp/xepbuilder/xmpp-text.pdf")
|
commands.getstatusoutput("cp ../images/xmpp-text.pdf /tmp/xepbuilder/xmpp-text.pdf")
|
||||||
|
|
||||||
|
if buildall:
|
||||||
|
buildAll()
|
||||||
|
else:
|
||||||
buildXEP( xep )
|
buildXEP( xep )
|
||||||
|
|
||||||
saveDict(BUILDDICT, last_build)
|
saveDict(BUILDDICT, last_build)
|
||||||
|
Loading…
Reference in New Issue
Block a user