1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-12-03 06:22:16 -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
now = int(time.time())
# READ IN ARGS:
# READ IN ARGS:
#
# 1. XEP number
@ -167,7 +167,7 @@ else:
thesubject = 'UPDATED: XEP-'
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
changelogline = 'Changelog: ' + remark + ' (' + initials + ')'
diffsline = 'Diff: ' + diffs

View File

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

View File

@ -6,7 +6,7 @@
# Last Modified: 2006-12-07
# Author: Peter Saint-Andre (stpeter@jabber.org)
# License: public domain
# HowTo: ./dbupdate.py dbuser dbpw xepnum
# HowTo: ./dbupdate.py dbuser dbpw xepnum
## LICENSE ##
#
@ -54,7 +54,7 @@ def getText(nodelist):
# get the seconds in the Unix era
now = int(time.time())
# READ IN ARGS:
# READ IN ARGS:
#
# 1. XEP number
# 2. database user
@ -139,7 +139,7 @@ if xepflag == "new":
cursor.execute(theStatement)
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) + "';"
cursor.execute(theStatement)
cursor.execute(theStatement)
result = cursor.fetchall()
# END

View File

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

116
gen.py
View File

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

View File

@ -54,7 +54,7 @@ def getText(nodelist):
# get the seconds in the Unix era
now = int(time.time())
# READ IN ARGS:
# READ IN ARGS:
#
# 1. XEP number
# 2. end date
@ -115,9 +115,9 @@ remark = getText(remarkNode.childNodes)
#
# 1. Is this specification needed to fill gaps in the XMPP
# 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?
# 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?
# 4. Do you have any security concerns related to this specification?
# 5. Is the specification accurate and clearly written?

View File

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

View File

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

View File

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

View File

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