1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-11-21 08:45:04 -05:00

Remove trailing whitespaces in every non-XEP file.

This commit is contained in:
Emmanuel Gil Peyrot 2017-02-14 22:15:25 +00:00 committed by Sam Whited
parent 3c5f20a4ca
commit fe9d3969fd
11 changed files with 120 additions and 121 deletions

View File

@ -54,7 +54,7 @@ def getText(nodelist):
# get the seconds in the Unix era # get the seconds in the Unix era
now = int(time.time()) now = int(time.time())
# READ IN ARGS: # READ IN ARGS:
# #
# 1. XEP number # 1. XEP number
@ -167,7 +167,7 @@ else:
thesubject = 'UPDATED: XEP-' thesubject = 'UPDATED: XEP-'
thesubject = thesubject + xepnum + ' (' + title + ')' thesubject = thesubject + xepnum + ' (' + title + ')'
versionline = 'Version ' + version + ' of XEP-' + xepnum + ' (' + title + ') has been released.' versionline = 'Version ' + version + ' of XEP-' + xepnum + ' (' + title + ') has been released.'
abstractline = 'Abstract: ' + abstract abstractline = 'Abstract: ' + abstract
changelogline = 'Changelog: ' + remark + ' (' + initials + ')' changelogline = 'Changelog: ' + remark + ' (' + initials + ')'
diffsline = 'Diff: ' + diffs diffsline = 'Diff: ' + diffs

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# archive an old version of a XEP (before publishing new version) # archive an old version of a XEP (before publishing new version)
# usage: ./archive.sh xepnum version # usage: ./archive.sh xepnum version
## LICENSE ## ## LICENSE ##
# #

View File

@ -6,7 +6,7 @@
# Last Modified: 2006-12-07 # Last Modified: 2006-12-07
# Author: Peter Saint-Andre (stpeter@jabber.org) # Author: Peter Saint-Andre (stpeter@jabber.org)
# License: public domain # License: public domain
# HowTo: ./dbupdate.py dbuser dbpw xepnum # HowTo: ./dbupdate.py dbuser dbpw xepnum
## LICENSE ## ## LICENSE ##
# #
@ -54,7 +54,7 @@ def getText(nodelist):
# get the seconds in the Unix era # get the seconds in the Unix era
now = int(time.time()) now = int(time.time())
# READ IN ARGS: # READ IN ARGS:
# #
# 1. XEP number # 1. XEP number
# 2. database user # 2. database user
@ -139,7 +139,7 @@ if xepflag == "new":
cursor.execute(theStatement) cursor.execute(theStatement)
else: else:
theStatement = "UPDATE jeps SET name='" + title + "', type='" + xeptype + "', status='" + xepstatus + "', notes='" + theNotes + "', version='" + str(version) + "', last_modified='" + str(now) + "', abstract='" + abstract + "', changelog='" + theLog + "' WHERE number='" + str(xepnum) + "';" theStatement = "UPDATE jeps SET name='" + title + "', type='" + xeptype + "', status='" + xepstatus + "', notes='" + theNotes + "', version='" + str(version) + "', last_modified='" + str(now) + "', abstract='" + abstract + "', changelog='" + theLog + "' WHERE number='" + str(xepnum) + "';"
cursor.execute(theStatement) cursor.execute(theStatement)
result = cursor.fetchall() result = cursor.fetchall()
# END # END

View File

@ -54,7 +54,7 @@ def getText(nodelist):
# get the seconds in the Unix era # get the seconds in the Unix era
now = int(time.time()) now = int(time.time())
# READ IN ARGS: # READ IN ARGS:
# #
# 1. XEP number # 1. XEP number

116
gen.py
View File

@ -71,10 +71,10 @@ def serializeInlineImage(output_dir, xep_nr, no, attrValue):
charset = bit[8:] charset = bit[8:]
elif bit == 'base64': elif bit == 'base64':
b64 = True b64 = True
# Do something smart with charset and b64 instead of assuming # Do something smart with charset and b64 instead of assuming
plaindata = base64.b64decode(data) plaindata = base64.b64decode(data)
# Do something smart with mime_type # Do something smart with mime_type
if mime_type in ('image/png', 'image/jpeg'): if mime_type in ('image/png', 'image/jpeg'):
file_ext = mime_type.split('/')[1] file_ext = mime_type.split('/')[1]
@ -100,13 +100,13 @@ def getText(nodelist):
def executeCommand( cmd ): def executeCommand( cmd ):
error, desc = commands.getstatusoutput( cmd ) error, desc = commands.getstatusoutput( cmd )
return error, desc + "\n" + "executed cmd: " + cmd return error, desc + "\n" + "executed cmd: " + cmd
## creates a HTML table (for the human reader) and XML table (for bots) ## creates a HTML table (for the human reader) and XML table (for bots)
class XEPTable: class XEPTable:
def __init__(self, filename, shortXMLfilename): def __init__(self, filename, shortXMLfilename):
self.filename = filename self.filename = filename
self.shortXMLfilename = shortXMLfilename self.shortXMLfilename = shortXMLfilename
try: try:
self.tableFile = parse(filename) self.tableFile = parse(filename)
except: except:
@ -117,7 +117,7 @@ class XEPTable:
self.tableFile.getElementsByTagName("table")[0].setAttribute("cellspacing", "0") self.tableFile.getElementsByTagName("table")[0].setAttribute("cellspacing", "0")
self.tableFile.getElementsByTagName("table")[0].setAttribute("cellpadding", "3") self.tableFile.getElementsByTagName("table")[0].setAttribute("cellpadding", "3")
self.tableFile.getElementsByTagName("table")[0].setAttribute("border", "1") self.tableFile.getElementsByTagName("table")[0].setAttribute("border", "1")
header = parseString( header = parseString(
'''<tr class='xepheader'> '''<tr class='xepheader'>
<th align='left'>Number</th> <th align='left'>Number</th>
@ -127,7 +127,7 @@ class XEPTable:
<th align='left'>Date</th> <th align='left'>Date</th>
</tr>''') </tr>''')
self.tableFile.getElementsByTagName("table")[0].appendChild(header.getElementsByTagName("tr")[0]) self.tableFile.getElementsByTagName("table")[0].appendChild(header.getElementsByTagName("tr")[0])
try: try:
self.botsFile = parse(shortXMLfilename) self.botsFile = parse(shortXMLfilename)
except: except:
@ -139,7 +139,7 @@ class XEPTable:
self.tableFile.getElementsByTagName("table")[0].normalize() self.tableFile.getElementsByTagName("table")[0].normalize()
f.write(self.tableFile.toxml()) f.write(self.tableFile.toxml())
f.close() f.close()
f = open(self.shortXMLfilename, "wb") f = open(self.shortXMLfilename, "wb")
self.botsFile.getElementsByTagName("xeps")[0].normalize() self.botsFile.getElementsByTagName("xeps")[0].normalize()
f.write(self.botsFile.toxml()) f.write(self.botsFile.toxml())
@ -153,7 +153,7 @@ class XEPTable:
if row.getAttribute("id") == "xep" + info.getNr(): if row.getAttribute("id") == "xep" + info.getNr():
xeprow = row xeprow = row
break break
if xeprow == 0: if xeprow == 0:
xeprow = self.tableFile.createElement("tr") xeprow = self.tableFile.createElement("tr")
self.tableFile.getElementsByTagName("table")[0].appendChild(xeprow) self.tableFile.getElementsByTagName("table")[0].appendChild(xeprow)
@ -165,22 +165,22 @@ class XEPTable:
xeprow.setAttribute("class", "tablebody XEP-" + info.getStatus()) xeprow.setAttribute("class", "tablebody XEP-" + info.getStatus())
while(xeprow.hasChildNodes()): while(xeprow.hasChildNodes()):
xeprow.removeChild(xeprow.firstChild) xeprow.removeChild(xeprow.firstChild)
col = parseString('''<td valign='top'><a href='/extensions/xep-''' + info.getNr() + ".html'>XEP-" + info.getNr() + '''</a> <a href='/extensions/xep-''' + info.getNr() + '''.pdf'>(PDF)</a></td>''') col = parseString('''<td valign='top'><a href='/extensions/xep-''' + info.getNr() + ".html'>XEP-" + info.getNr() + '''</a> <a href='/extensions/xep-''' + info.getNr() + '''.pdf'>(PDF)</a></td>''')
xeprow.appendChild(col.getElementsByTagName("td")[0]) xeprow.appendChild(col.getElementsByTagName("td")[0])
col = parseString("<td valign='top'>" + info.getTitle() + "</td>") col = parseString("<td valign='top'>" + info.getTitle() + "</td>")
xeprow.appendChild(col.getElementsByTagName("td")[0]) xeprow.appendChild(col.getElementsByTagName("td")[0])
col = parseString("<td valign='top'>" + info.getType() + "</td>") col = parseString("<td valign='top'>" + info.getType() + "</td>")
xeprow.appendChild(col.getElementsByTagName("td")[0]) xeprow.appendChild(col.getElementsByTagName("td")[0])
col = parseString("<td valign='top'>" + info.getStatus() + "</td>") col = parseString("<td valign='top'>" + info.getStatus() + "</td>")
xeprow.appendChild(col.getElementsByTagName("td")[0]) xeprow.appendChild(col.getElementsByTagName("td")[0])
col = parseString("<td valign='top'>" + info.getDate() + "</td>") col = parseString("<td valign='top'>" + info.getDate() + "</td>")
xeprow.appendChild(col.getElementsByTagName("td")[0]) xeprow.appendChild(col.getElementsByTagName("td")[0])
## set for bots file ## set for bots file
xeps = self.botsFile.getElementsByTagName("xep") xeps = self.botsFile.getElementsByTagName("xep")
xep = 0 xep = 0
@ -188,7 +188,7 @@ class XEPTable:
if xeps_xep.getElementsByTagName("number")[0].firstChild.data == info.getNr(): if xeps_xep.getElementsByTagName("number")[0].firstChild.data == info.getNr():
xep = xeps_xep xep = xeps_xep
break break
if xep == 0: if xep == 0:
xep = self.botsFile.createElement("xep") xep = self.botsFile.createElement("xep")
self.botsFile.getElementsByTagName("xeps")[0].appendChild(xep) self.botsFile.getElementsByTagName("xeps")[0].appendChild(xep)
@ -197,25 +197,25 @@ class XEPTable:
else: else:
while(xep.hasChildNodes()): while(xep.hasChildNodes()):
xep.removeChild(xep.firstChild) xep.removeChild(xep.firstChild)
child = parseString("<number>" + info.getNr() + "</number>") child = parseString("<number>" + info.getNr() + "</number>")
xep.appendChild(child.getElementsByTagName("number")[0]) xep.appendChild(child.getElementsByTagName("number")[0])
child = parseString("<name>" + info.getTitle() + "</name>") child = parseString("<name>" + info.getTitle() + "</name>")
xep.appendChild(child.getElementsByTagName("name")[0]) xep.appendChild(child.getElementsByTagName("name")[0])
child = parseString("<type>" + info.getType() + "</type>") child = parseString("<type>" + info.getType() + "</type>")
xep.appendChild(child.getElementsByTagName("type")[0]) xep.appendChild(child.getElementsByTagName("type")[0])
child = parseString("<status>" + info.getStatus() + "</status>") child = parseString("<status>" + info.getStatus() + "</status>")
xep.appendChild(child.getElementsByTagName("status")[0]) xep.appendChild(child.getElementsByTagName("status")[0])
child = parseString("<updated>" + info.getDate() + "</updated>") child = parseString("<updated>" + info.getDate() + "</updated>")
xep.appendChild(child.getElementsByTagName("updated")[0]) xep.appendChild(child.getElementsByTagName("updated")[0])
child = parseString("<shortname>" + info.getShortname() + "</shortname>") child = parseString("<shortname>" + info.getShortname() + "</shortname>")
xep.appendChild(child.getElementsByTagName("shortname")[0]) xep.appendChild(child.getElementsByTagName("shortname")[0])
child = parseString("<abstract>" + info.getAbstract() + "</abstract>") child = parseString("<abstract>" + info.getAbstract() + "</abstract>")
xep.appendChild(child.getElementsByTagName("abstract")[0]) xep.appendChild(child.getElementsByTagName("abstract")[0])
@ -225,7 +225,7 @@ def filebase( filename ):
def checkError( error, desc): def checkError( error, desc):
global verbose global verbose
if error != 0: if error != 0:
if verbose: if verbose:
print "Error: ", desc print "Error: ", desc
@ -233,11 +233,11 @@ def checkError( error, desc):
return True return True
def fileHash( filename ): def fileHash( filename ):
f = open(filename, "rb") f = open(filename, "rb")
import hashlib import hashlib
h = hashlib.sha1() h = hashlib.sha1()
h.update(f.read()) h.update(f.read())
hash = h.hexdigest() hash = h.hexdigest()
f.close() f.close()
return hash return hash
@ -250,7 +250,7 @@ def loadDict( filename ):
except: except:
print "failed loading dict." print "failed loading dict."
return {} return {}
def saveDict( filename, di ): def saveDict( filename, di ):
f = open(filename, "w") f = open(filename, "w")
pickle.dump(di, f) pickle.dump(di, f)
@ -260,15 +260,15 @@ def buildXHTML( file, nr ):
error, desc = executeCommand("xsltproc xep.xsl " + file + " > " + XEPPATH + "/xep-" + nr + ".html") error, desc = executeCommand("xsltproc xep.xsl " + file + " > " + XEPPATH + "/xep-" + nr + ".html")
if not checkError(error, desc): if not checkError(error, desc):
return False return False
error, desc = executeCommand("xsltproc ref.xsl xep-" + nr + ".xml > " + XEPPATH + "/refs/reference.XSF.XEP-" + nr + ".xml") error, desc = executeCommand("xsltproc ref.xsl xep-" + nr + ".xml > " + XEPPATH + "/refs/reference.XSF.XEP-" + nr + ".xml")
if not checkError(error, desc): if not checkError(error, desc):
return False return False
error, desc = executeCommand("xsltproc examples.xsl xep-" + nr + ".xml > " + XEPPATH + "/examples/" + nr + ".xml") error, desc = executeCommand("xsltproc examples.xsl xep-" + nr + ".xml > " + XEPPATH + "/examples/" + nr + ".xml")
if not checkError(error, desc): if not checkError(error, desc):
return False return False
error, desc = executeCommand(" cp xep-" + nr + ".xml " + XEPPATH + "/") error, desc = executeCommand(" cp xep-" + nr + ".xml " + XEPPATH + "/")
if not checkError(error, desc): if not checkError(error, desc):
return False return False
@ -280,47 +280,47 @@ def buildPDF( file, nr ):
error, desc = executeCommand("xsltproc -o /tmp/xepbuilder/xep-" + nr + ".tex.xml xep2texml.xsl " + file) 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
error, desc = executeCommand("texml -e utf8 /tmp/xepbuilder/xep-" + nr + ".tex.xml /tmp/xepbuilder/xep-" + nr + ".tex") error, desc = executeCommand("texml -e utf8 /tmp/xepbuilder/xep-" + nr + ".tex.xml /tmp/xepbuilder/xep-" + nr + ".tex")
if not checkError(error, desc): if not checkError(error, desc):
return False return False
#detect http urls and escape them to make them breakable #detect http urls and escape them to make them breakable
# this should match all urls in free text; not the urls in xml:ns or so..so no " or ' in front. # this should match all urls in free text; not the urls in xml:ns or so..so no " or ' in front.
error, desc = executeCommand('''sed -i 's|\([\s"]\)\([^"]http://[^ "]*\)|\1\\path{\2}|g' /tmp/xepbuilder/xep-''' + nr + ".tex") error, desc = executeCommand('''sed -i 's|\([\s"]\)\([^"]http://[^ "]*\)|\1\\path{\2}|g' /tmp/xepbuilder/xep-''' + nr + ".tex")
if not checkError(error, desc): if not checkError(error, desc):
return False return False
#adjust references #adjust references
error, desc = executeCommand('''sed -i 's|\\hyperref\[#\([^}]*\)\]|\\hyperref\[\1\]|g' /tmp/xepbuilder/xep-''' + nr + ".tex") error, desc = executeCommand('''sed -i 's|\\hyperref\[#\([^}]*\)\]|\\hyperref\[\1\]|g' /tmp/xepbuilder/xep-''' + nr + ".tex")
if error != 0: if error != 0:
if verbose == 1: if verbose == 1:
print "Error: ", desc print "Error: ", desc
return False return False
error, desc = executeCommand('''sed -i 's|\\pageref{#\([^}]*\)}|\\pageref{\1}|g' /tmp/xepbuilder/xep-''' + nr + ".tex") error, desc = executeCommand('''sed -i 's|\\pageref{#\([^}]*\)}|\\pageref{\1}|g' /tmp/xepbuilder/xep-''' + nr + ".tex")
if not checkError(error, desc): if not checkError(error, desc):
return False return False
olddir = os.getcwd() olddir = os.getcwd()
os.chdir("/tmp/xepbuilder") os.chdir("/tmp/xepbuilder")
error, desc = executeCommand("xelatex -interaction=batchmode xep-" + nr + ".tex") error, desc = executeCommand("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 = executeCommand("xelatex -interaction=batchmode xep-" + nr + ".tex") #error, desc = executeCommand("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)
error, desc = executeCommand("cp /tmp/xepbuilder/xep-" + nr + ".pdf " + XEPPATH + "/") error, desc = executeCommand("cp /tmp/xepbuilder/xep-" + nr + ".pdf " + XEPPATH + "/")
if not checkError(error, desc): if not checkError(error, desc):
return False return False
return True return True
def buildXEP( filename ): def buildXEP( filename ):
@ -329,7 +329,7 @@ def buildXEP( filename ):
if not xepfilepath: if not xepfilepath:
print "getLatestXEPContent (ERROR)" print "getLatestXEPContent (ERROR)"
return return
files_to_delete.append(xepfilepath) files_to_delete.append(xepfilepath)
if not fast: if not fast:
print "Building " + filename + ": ", print "Building " + filename + ": ",
@ -337,14 +337,14 @@ def buildXEP( filename ):
print "XHTML(OK) / ", print "XHTML(OK) / ",
else: else:
print "XHTML(ERROR) / ", print "XHTML(ERROR) / ",
if buildPDF( xepfilepath, nr ): if buildPDF( xepfilepath, nr ):
print "PDF(OK)" print "PDF(OK)"
else: else:
print "PDF(ERROR)" print "PDF(ERROR)"
else: else:
print "Building " + filename + " (FAST MODE)" print "Building " + filename + " (FAST MODE)"
x = XEPTable(CONFIGPATH + "/extensions.xml", XEPPATH + "/xeps.xml") x = XEPTable(CONFIGPATH + "/extensions.xml", XEPPATH + "/xeps.xml")
xinfo = XEPInfo(xepfilepath, False) xinfo = XEPInfo(xepfilepath, False)
x.setXEP( xinfo ) x.setXEP( xinfo )
@ -355,7 +355,7 @@ def buildAll():
files.sort(key=lambda x: x.lower()) files.sort(key=lambda x: x.lower())
for file in files: for file in files:
buildXEP( file ) buildXEP( file )
def makeBundle(): def makeBundle():
print "Creating the bundle...", print "Creating the bundle...",
executeCommand("mkdir /tmp/xepbundle") executeCommand("mkdir /tmp/xepbundle")
@ -382,13 +382,13 @@ def main(argv):
global CONFIGPATH global CONFIGPATH
global fast global fast
buildall = False buildall = False
try: try:
options, remainder = getopt.gnu_getopt(argv, "vaf") options, remainder = getopt.gnu_getopt(argv, "vaf")
except getopt.GetoptError: except getopt.GetoptError:
usage() usage()
sys.exit(2) sys.exit(2)
for opt, arg in options: for opt, arg in options:
if opt in ('-v'): if opt in ('-v'):
verbose = True verbose = True
@ -396,37 +396,37 @@ def main(argv):
buildall = True buildall = True
elif opt in ('-f'): elif opt in ('-f'):
fast = True fast = True
if len(remainder) > 0: if len(remainder) > 0:
try: try:
xep = int(remainder[0]) xep = int(remainder[0])
xep = "xep-%04d.xml" % xep xep = "xep-%04d.xml" % xep
except: except:
xep = remainder[0] xep = remainder[0]
executeCommand("mkdir /tmp/xepbuilder") executeCommand("mkdir /tmp/xepbuilder")
executeCommand("cp ../images/xmpp.pdf /tmp/xepbuilder/xmpp.pdf") executeCommand("cp ../images/xmpp.pdf /tmp/xepbuilder/xmpp.pdf")
executeCommand("cp ../images/xmpp-text.pdf /tmp/xepbuilder/xmpp-text.pdf") executeCommand("cp ../images/xmpp-text.pdf /tmp/xepbuilder/xmpp-text.pdf")
executeCommand("cp -r deps/* /tmp/xepbuilder/") executeCommand("cp -r deps/* /tmp/xepbuilder/")
executeCommand("cp xep.ent /tmp/xep.ent") executeCommand("cp xep.ent /tmp/xep.ent")
files_to_delete.append("/tmp/xep.ent") files_to_delete.append("/tmp/xep.ent")
if buildall: if buildall:
buildAll() buildAll()
else: else:
buildXEP( xep ) buildXEP( xep )
# remove xep temporary files # remove xep temporary files
for filename in files_to_delete: for filename in files_to_delete:
executeCommand("rm " + filename) 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")
makeBundle() makeBundle()
if __name__ == "__main__": if __name__ == "__main__":
main(sys.argv[1:]) main(sys.argv[1:])

View File

@ -54,7 +54,7 @@ def getText(nodelist):
# get the seconds in the Unix era # get the seconds in the Unix era
now = int(time.time()) now = int(time.time())
# READ IN ARGS: # READ IN ARGS:
# #
# 1. XEP number # 1. XEP number
# 2. end date # 2. end date
@ -115,9 +115,9 @@ remark = getText(remarkNode.childNodes)
# #
# 1. Is this specification needed to fill gaps in the XMPP # 1. Is this specification needed to fill gaps in the XMPP
# protocol stack or to clarify an existing protocol? # protocol stack or to clarify an existing protocol?
# 2. Does the specification solve the problem stated in the # 2. Does the specification solve the problem stated in the
# introduction and requirements? # introduction and requirements?
# 3. Do you plan to implement this specification in your code? # 3. Do you plan to implement this specification in your code?
# If not, why not? # If not, why not?
# 4. Do you have any security concerns related to this specification? # 4. Do you have any security concerns related to this specification?
# 5. Is the specification accurate and clearly written? # 5. Is the specification accurate and clearly written?

View File

@ -55,7 +55,7 @@ THE SOFTWARE.
</head> </head>
<body> <body>
<h1><xsl:value-of select='/xep/header/shortname'/></h1> <h1><xsl:value-of select='/xep/header/shortname'/></h1>
<p>This page provides information about the XML namespaces defined in <p>This page provides information about the XML namespaces defined in
<a> <a>
<xsl:attribute name='href'> <xsl:attribute name='href'>
<xsl:text>http://xmpp.org/extensions/xep-</xsl:text> <xsl:text>http://xmpp.org/extensions/xep-</xsl:text>

30
xep.xsd
View File

@ -62,20 +62,20 @@ THE SOFTWARE.
<xs:element name='number' type='xs:byte'/> <xs:element name='number' type='xs:byte'/>
<xs:element ref='status'/> <xs:element ref='status'/>
<xs:element name='lastcall' minOccurs='0' type='xs:string'/> <xs:element name='lastcall' minOccurs='0' type='xs:string'/>
<xs:element name='interim' minOccurs='0' type='empty'/> <xs:element name='interim' minOccurs='0' type='empty'/>
<xs:element ref='type'/> <xs:element ref='type'/>
<xs:element name='sig' type='xs:string'/> <xs:element name='sig' type='xs:string'/>
<xs:element name='approver' type='xs:string'/> <xs:element name='approver' type='xs:string'/>
<xs:element ref='dependencies'/> <xs:element ref='dependencies'/>
<xs:element ref='supersedes'/> <xs:element ref='supersedes'/>
<xs:element ref='supersededby'/> <xs:element ref='supersededby'/>
<xs:element name='shortname' type='xs:NCName'/> <xs:element name='shortname' type='xs:NCName'/>
<xs:element ref='schemaloc' minOccurs='0' maxOccurs='unbounded'/> <xs:element ref='schemaloc' minOccurs='0' maxOccurs='unbounded'/>
<xs:element name='registry' minOccurs='0' type='empty'/> <xs:element name='registry' minOccurs='0' type='empty'/>
<xs:element name='discuss' minOccurs='0' type='xs:string'/> <xs:element name='discuss' minOccurs='0' type='xs:string'/>
<xs:element name='expires' minOccurs='0' type='xs:string'/> <xs:element name='expires' minOccurs='0' type='xs:string'/>
<xs:element ref='author' minOccurs='1' maxOccurs='unbounded'/> <xs:element ref='author' minOccurs='1' maxOccurs='unbounded'/>
<xs:element ref='revision' minOccurs='1' maxOccurs='unbounded'/> <xs:element ref='revision' minOccurs='1' maxOccurs='unbounded'/>
<xs:element ref='councilnote' minOccurs='0'/> <xs:element ref='councilnote' minOccurs='0'/>
</xs:sequence> </xs:sequence>
</xs:complexType> </xs:complexType>
@ -180,7 +180,7 @@ THE SOFTWARE.
</xs:sequence> </xs:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name='councilnote'> <xs:element name='councilnote'>
<xs:complexType> <xs:complexType>
<xs:choice maxOccurs='unbounded'> <xs:choice maxOccurs='unbounded'>
@ -341,7 +341,7 @@ THE SOFTWARE.
<xs:complexType> <xs:complexType>
<xs:simpleContent> <xs:simpleContent>
<xs:extension base='empty'> <xs:extension base='empty'>
<xs:attribute name='source' use='required'/> <xs:attribute name='source' use='required'/>
</xs:extension> </xs:extension>
</xs:simpleContent> </xs:simpleContent>
</xs:complexType> </xs:complexType>
@ -351,7 +351,7 @@ THE SOFTWARE.
<xs:complexType> <xs:complexType>
<xs:simpleContent> <xs:simpleContent>
<xs:extension base='xs:string'> <xs:extension base='xs:string'>
<xs:attribute name='url' use='required'/> <xs:attribute name='url' use='required'/>
</xs:extension> </xs:extension>
</xs:simpleContent> </xs:simpleContent>
</xs:complexType> </xs:complexType>
@ -363,7 +363,7 @@ THE SOFTWARE.
<xs:complexType> <xs:complexType>
<xs:simpleContent> <xs:simpleContent>
<xs:extension base='xs:string'> <xs:extension base='xs:string'>
<xs:attribute name='caption' use='optional'/> <xs:attribute name='caption' use='optional'/>
</xs:extension> </xs:extension>
</xs:simpleContent> </xs:simpleContent>
</xs:complexType> </xs:complexType>
@ -373,7 +373,7 @@ THE SOFTWARE.
<xs:complexType> <xs:complexType>
<xs:simpleContent> <xs:simpleContent>
<xs:extension base='xs:string'> <xs:extension base='xs:string'>
<xs:attribute name='caption' use='optional'/> <xs:attribute name='caption' use='optional'/>
</xs:extension> </xs:extension>
</xs:simpleContent> </xs:simpleContent>
</xs:complexType> </xs:complexType>
@ -401,8 +401,8 @@ THE SOFTWARE.
<xs:complexType> <xs:complexType>
<xs:simpleContent> <xs:simpleContent>
<xs:extension base='xs:string'> <xs:extension base='xs:string'>
<xs:attribute name='colspan' use='optional'/> <xs:attribute name='colspan' use='optional'/>
<xs:attribute name='rowspan' use='optional'/> <xs:attribute name='rowspan' use='optional'/>
</xs:extension> </xs:extension>
</xs:simpleContent> </xs:simpleContent>
</xs:complexType> </xs:complexType>
@ -412,8 +412,8 @@ THE SOFTWARE.
<xs:complexType> <xs:complexType>
<xs:simpleContent> <xs:simpleContent>
<xs:extension base='xs:string'> <xs:extension base='xs:string'>
<xs:attribute name='colspan' use='optional'/> <xs:attribute name='colspan' use='optional'/>
<xs:attribute name='rowspan' use='optional'/> <xs:attribute name='rowspan' use='optional'/>
</xs:extension> </xs:extension>
</xs:simpleContent> </xs:simpleContent>
</xs:complexType> </xs:complexType>

View File

@ -62,48 +62,47 @@ class XEPInfo:
revNode = (headerNode.getElementsByTagName("revision")[0]) revNode = (headerNode.getElementsByTagName("revision")[0])
self.version = getText((revNode.getElementsByTagName("version")[0]).childNodes) self.version = getText((revNode.getElementsByTagName("version")[0]).childNodes)
self.date = getText((revNode.getElementsByTagName("date")[0]).childNodes) self.date = getText((revNode.getElementsByTagName("date")[0]).childNodes)
titleNode = (headerNode.getElementsByTagName("interim")) titleNode = (headerNode.getElementsByTagName("interim"))
if titleNode: if titleNode:
self.interim = True; self.interim = True;
else: else:
self.interim = False; self.interim = False;
depNode = headerNode.getElementsByTagName("dependencies") depNode = headerNode.getElementsByTagName("dependencies")
self.depends = [] self.depends = []
if depNode: if depNode:
depNode = depNode[0] depNode = depNode[0]
for dep in depNode.getElementsByTagName("spec"): for dep in depNode.getElementsByTagName("spec"):
self.depends.append(getText(dep.childNodes)) self.depends.append(getText(dep.childNodes))
def getInterim(self): def getInterim(self):
return self.interim return self.interim
def getNr(self): def getNr(self):
return self.nr return self.nr
def getTitle(self): def getTitle(self):
return self.title return self.title
def getShortname(self): def getShortname(self):
return self.shortname return self.shortname
def getAbstract(self): def getAbstract(self):
return self.abstract return self.abstract
def getStatus(self): def getStatus(self):
return self.status return self.status
def getVersion(self): def getVersion(self):
return self.version return self.version
def getType(self): def getType(self):
return self.type return self.type
def getDate(self): def getDate(self):
return self.date return self.date
def getDepends(self): def getDepends(self):
return self.depends return self.depends

View File

@ -1,6 +1,6 @@
# File: xeputil.py # File: xeputil.py
# Version: 0.2 # Version: 0.2
# Description: xep utility functions # Description: xep utility functions
# Last Modified: 2010 # Last Modified: 2010
# Author: Tobias Markmann (tm@ayena.de) # Author: Tobias Markmann (tm@ayena.de)
@ -54,13 +54,13 @@ class XEP:
revs = [] revs = []
for rev in fctx.filelog(): for rev in fctx.filelog():
revs.append(fctx.filectx(rev).rev()) revs.append(fctx.filectx(rev).rev())
return sorted(revs) return sorted(revs)
def contentOfRevision(self, revision): def contentOfRevision(self, revision):
repo = hg.repository(ui.ui(), self.BASEDIR) repo = hg.repository(ui.ui(), self.BASEDIR)
fctx = repo.filectx("xep-" + self.nr + ".xml", revision) fctx = repo.filectx("xep-" + self.nr + ".xml", revision)
# load content for that revision # load content for that revision
file_text = fctx.data() file_text = fctx.data()
return file_text return file_text

View File

@ -20,7 +20,7 @@ BODY {
#main { #main {
border: 0px; border: 0px;
color: #000000; color: #000000;
font-weight: normal; font-weight: normal;
margin: 0% 0% 5% 17%; margin: 0% 0% 5% 17%;
padding: 4px 2% 10px 2%; padding: 4px 2% 10px 2%;
text-decoration: none; text-decoration: none;
@ -30,7 +30,7 @@ BODY {
clear: both; clear: both;
color: #666666; color: #666666;
font-size: x-small; font-size: x-small;
font-weight: normal; font-weight: normal;
text-align: center; text-align: center;
text-decoration: none; text-decoration: none;
} }
@ -70,11 +70,11 @@ ul {
font-weight: bold; font-weight: bold;
} }
.box { .box {
border: thin dotted; border: thin dotted;
padding-bottom: 1em; padding-bottom: 1em;
padding-left: 2em; padding-left: 2em;
padding-right: 2em; padding-right: 2em;
padding-top: 1em; padding-top: 1em;
} }
.caption { .caption {
font-weight: bold; font-weight: bold;
@ -84,11 +84,11 @@ ul {
white-space: pre; white-space: pre;
} }
.def { .def {
text-indent: -6.3em; text-indent: -6.3em;
padding-bottom: 1em; padding-bottom: 1em;
padding-left: 6.5em; padding-left: 6.5em;
padding-right: 10em; padding-right: 10em;
padding-top: 1em; padding-top: 1em;
} }
.em { .em {
font-style: italic; font-style: italic;
@ -110,26 +110,26 @@ ul {
.highlight { .highlight {
color: #336699; color: #336699;
} }
.nav { .nav {
font-size: small; font-size: small;
line-height: 45%; line-height: 45%;
text-decoration: none; text-decoration: none;
white-space: nowrap; white-space: nowrap;
} }
.navhead { .navhead {
color: #336699; color: #336699;
font-size: medium; font-size: medium;
line-height: 90%; line-height: 90%;
padding-left: 0px; padding-left: 0px;
text-decoration: none; text-decoration: none;
} }
.pagehead { .pagehead {
color: #336699; color: #336699;
text-decoration: none; text-decoration: none;
} }
A:visited.pagehead { A:visited.pagehead {
color: #336699; color: #336699;
text-decoration: none; text-decoration: none;
} }
.ref { .ref {
font-weight: bold; font-weight: bold;