1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-08-13 16:53:48 -04:00

New xep table generation method.

git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@3517 4b5297f7-1745-476d-ba37-a9c6900126ab
This commit is contained in:
Tobias Markmann 2009-10-09 15:33:02 +00:00
parent 1e195d30bf
commit 4b7ac73c96
2 changed files with 21 additions and 14 deletions

22
gen.py
View File

@ -45,7 +45,7 @@ from xml.dom.minidom import parse,parseString,Document,getDOMImplementation
XEPPATH = "/var/www/vhosts/xmpp.org/extensions" XEPPATH = "/var/www/vhosts/xmpp.org/extensions"
BUILDDICT = "/var/xsf/xepbuild.dict" BUILDDICT = "/var/xsf/xepbuild.dict"
VERBOSE = False verbose = False
last_build = {} last_build = {}
def getText(nodelist): def getText(nodelist):
@ -95,6 +95,21 @@ class XEPTable:
except: except:
impl = getDOMImplementation() impl = getDOMImplementation()
self.tableFile = impl.createDocument(None, "table", None) self.tableFile = impl.createDocument(None, "table", None)
self.tableFile.getElementsByTagName("table")[0].setAttribute("class", "sortable")
self.tableFile.getElementsByTagName("table")[0].setAttribute("id", "xeplist")
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>
<th align='left'>Name</th>
<th align='left'>Type</th>
<th align='left'>Status</th>
<th align='left'>Date</th>
</tr>''')
self.tableFile.getElementsByTagName("table")[0].appendChild(col.getElementsByTagName("td")[0])
def save(self): def save(self):
f = open(self.filename, "wb") f = open(self.filename, "wb")
@ -121,7 +136,7 @@ class XEPTable:
while(xeprow.hasChildNodes()): while(xeprow.hasChildNodes()):
xeprow.removeChild(xeprow.firstChild) xeprow.removeChild(xeprow.firstChild)
col = parseString('''<td valign='top'><a href='http://xmpp.org/extensions/xep-''' + info.getNr() + ".html'>XEP-" + info.getNr() + '''</a> <a href='http://xmpp.org/extensions/xep-''' + info.getNr() + '''.pdf'>(PDF)</a></td>''') col = parseString('''<td valign='top'><a href='http://newsite.xmpp.org/extensions/xep-''' + info.getNr() + ".html'>XEP-" + info.getNr() + '''</a> <a href='http://newsite.xmpp.org/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>")
@ -304,6 +319,9 @@ def main(argv):
else: else:
buildXEP( xep ) buildXEP( xep )
commands.getstatusoutput("cp extensions.xhtml " + XEPPATH + "/../includes/xeplist.txt")
commands.getstatusoutput("sed -i '1d' " + XEPPATH + "/../includes/xeplist.txt")
saveDict(BUILDDICT, last_build) saveDict(BUILDDICT, last_build)
if __name__ == "__main__": if __name__ == "__main__":

View File

@ -12,17 +12,6 @@
<p>This page lists approved XMPP extensions as well as proposals that are under active consideration. A <a href="all.shtml">list of all XEPs</a> (including retracted, rejected, deprecated, and obsolete XEPs) is also available. Good places for developers to start are the <a href='xep-0242.html'>client compliance</a> and <a href='xep-0243.html'>server compliance</a> definitions, as well as the <a href='/tech/'>technology overview pages</a>.</p> <p>This page lists approved XMPP extensions as well as proposals that are under active consideration. A <a href="all.shtml">list of all XEPs</a> (including retracted, rejected, deprecated, and obsolete XEPs) is also available. Good places for developers to start are the <a href='xep-0242.html'>client compliance</a> and <a href='xep-0243.html'>server compliance</a> definitions, as well as the <a href='/tech/'>technology overview pages</a>.</p>
<p><em>Note: The following table is sortable, just click on the headers (click twice to reverse the sort order).</em></p> <p><em>Note: The following table is sortable, just click on the headers (click twice to reverse the sort order).</em></p>
<table border='1' cellpadding='3' cellspacing='0' class='sortable' id='xeplist'> <!--#include virtual="/includes/xeplist.txt" -->
<tr class='xepheader'>
<th align='left'>Number</th>
<th align='left'>Name</th>
<th align='left'>Type</th>
<th align='left'>Status</th>
<th align='left'>Date</th>
</tr>
<!--#include virtual="/includes/xeps-default.txt" -->
</table>
<!--#include virtual="/includes/foot.txt" --> <!--#include virtual="/includes/foot.txt" -->