mirror of
https://github.com/moparisthebest/xeps
synced 2024-11-22 01:02:17 -05:00
Only generate last non-interim version of a XEP.
git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@4090 4b5297f7-1745-476d-ba37-a9c6900126ab
This commit is contained in:
parent
91310b1c90
commit
d9deb6517f
29
gen.py
29
gen.py
@ -52,6 +52,8 @@ verbose = False
|
|||||||
fast = False
|
fast = False
|
||||||
last_build = {}
|
last_build = {}
|
||||||
|
|
||||||
|
files_to_delete = [];
|
||||||
|
|
||||||
def getText(nodelist):
|
def getText(nodelist):
|
||||||
thisText = ""
|
thisText = ""
|
||||||
for node in nodelist:
|
for node in nodelist:
|
||||||
@ -166,9 +168,8 @@ def saveDict( filename, di ):
|
|||||||
pickle.dump(di, f)
|
pickle.dump(di, f)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
def buildXHTML( file ):
|
def buildXHTML( file, nr ):
|
||||||
nr = re.match("xep-(\d\d\d\d).xml", file).group(1)
|
error, desc = executeCommand("xsltproc xep.xsl " + file + " > " + XEPPATH + "/xep-" + nr + ".html")
|
||||||
error, desc = executeCommand("xsltproc xep.xsl xep-" + nr + ".xml > " + XEPPATH + "/xep-" + nr + ".html")
|
|
||||||
if not checkError(error, desc):
|
if not checkError(error, desc):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@ -185,10 +186,9 @@ def buildXHTML( file ):
|
|||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def buildPDF( file ):
|
def buildPDF( file, nr ):
|
||||||
nr = re.match("xep-(\d\d\d\d).xml", file).group(1)
|
|
||||||
|
|
||||||
error, desc = executeCommand("xsltproc -o /tmp/xepbuilder/xep-" + nr + ".tex.xml xep2texml.xsl xep-" + nr + ".xml")
|
error, desc = executeCommand("xsltproc -o /tmp/xepbuilder/xep-" + nr + ".tex.xml xep2texml.xsl " + file)
|
||||||
if not checkError(error, desc):
|
if not checkError(error, desc):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@ -234,22 +234,27 @@ def buildPDF( file ):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def buildXEP( filename ):
|
def buildXEP( filename ):
|
||||||
# get file with content of last non-interim version
|
nr = re.match("xep-(\d\d\d\d).xml", file).group(1)
|
||||||
|
xepfilepath = getLatestXEPContent("", nr);
|
||||||
|
if not xepfilepath:
|
||||||
|
print "getLatestXEPContent (ERROR)"
|
||||||
|
return
|
||||||
|
|
||||||
|
files_to_delete.append(xepfilepath)
|
||||||
if not fast:
|
if not fast:
|
||||||
print "Building " + filename + ": ",
|
print "Building " + filename + ": ",
|
||||||
if buildXHTML( filename ):
|
if buildXHTML( xepfilepath, nr ):
|
||||||
print "XHTML(OK) / ",
|
print "XHTML(OK) / ",
|
||||||
else:
|
else:
|
||||||
print "XHTML(ERROR) / ",
|
print "XHTML(ERROR) / ",
|
||||||
|
|
||||||
if buildPDF( filename ):
|
if buildPDF( xepfilepath, nr ):
|
||||||
print "PDF(OK)"
|
print "PDF(OK)"
|
||||||
else:
|
else:
|
||||||
print "PDF(ERROR)"
|
print "PDF(ERROR)"
|
||||||
|
|
||||||
x = XEPTable(CONFIGPATH + "/extensions.xml")
|
x = XEPTable(CONFIGPATH + "/extensions.xml")
|
||||||
xinfo = XEPInfo(filename, False)
|
xinfo = XEPInfo(xepfilepath, False)
|
||||||
x.setXEP( xinfo )
|
x.setXEP( xinfo )
|
||||||
x.save()
|
x.save()
|
||||||
|
|
||||||
@ -316,6 +321,10 @@ def main(argv):
|
|||||||
else:
|
else:
|
||||||
buildXEP( xep )
|
buildXEP( xep )
|
||||||
|
|
||||||
|
# remove xep temporary files
|
||||||
|
for filename in files_to_delete:
|
||||||
|
executeCommand("rm " + filename)
|
||||||
|
|
||||||
executeCommand("sed -e '1s/<?[^?]*?>//' " + CONFIGPATH + "/extensions.xml > " + XEPPATH + "/../includes/xeplist.txt")
|
executeCommand("sed -e '1s/<?[^?]*?>//' " + CONFIGPATH + "/extensions.xml > " + XEPPATH + "/../includes/xeplist.txt")
|
||||||
|
|
||||||
executeCommand("rm -rfd /tmp/xepbuilder")
|
executeCommand("rm -rfd /tmp/xepbuilder")
|
||||||
|
Loading…
Reference in New Issue
Block a user