xepification

git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@99 4b5297f7-1745-476d-ba37-a9c6900126ab
This commit is contained in:
Peter Saint-Andre 2006-10-11 19:13:25 +00:00
parent da27e3574a
commit ddca806f3f
1 changed files with 22 additions and 22 deletions

View File

@ -1,12 +1,12 @@
#!/usr/bin/env python #!/usr/bin/env python
# File: lastcall.py # File: lastcall.py
# Version: 0.2 # Version: 0.3
# Description: a script for announcing Last Calls # Description: a script for announcing Last Calls
# Last Modified: 2004-09-29 # Last Modified: 2006-10-11
# Author: Peter Saint-Andre (stpeter@jabber.org) # Author: Peter Saint-Andre (stpeter@jabber.org)
# License: public domain # License: public domain
# HowTo: ./lastcall.py jepnum enddate dbuser dbpw # HowTo: ./lastcall.py xepnum enddate dbuser dbpw
# IMPORTS: # IMPORTS:
# #
@ -38,12 +38,12 @@ now = int(time.time())
# 3. database user # 3. database user
# 4. database password # 4. database password
jepnum = sys.argv[1]; xepnum = sys.argv[1];
enddate = sys.argv[2]; enddate = sys.argv[2];
dbuser = sys.argv[3]; dbuser = sys.argv[3];
dbpw = sys.argv[4]; dbpw = sys.argv[4];
jepfile = jepnum + '/jep-' + jepnum + '.xml' xepfile = 'xep-' + xepnum + '.xml'
# PARSE XEP HEADERS: # PARSE XEP HEADERS:
# #
@ -54,17 +54,17 @@ jepfile = jepnum + '/jep-' + jepnum + '.xml'
# - initials # - initials
# - remark # - remark
thejep = parse(jepfile) thexep = parse(xepfile)
jepNode = (thejep.getElementsByTagName("jep")[0]) xepNode = (thexep.getElementsByTagName("xep")[0])
headerNode = (jepNode.getElementsByTagName("header")[0]) headerNode = (xepNode.getElementsByTagName("header")[0])
titleNode = (headerNode.getElementsByTagName("title")[0]) titleNode = (headerNode.getElementsByTagName("title")[0])
title = getText(titleNode.childNodes) title = getText(titleNode.childNodes)
abstractNode = (headerNode.getElementsByTagName("abstract")[0]) abstractNode = (headerNode.getElementsByTagName("abstract")[0])
abstract = getText(abstractNode.childNodes) abstract = getText(abstractNode.childNodes)
statusNode = (headerNode.getElementsByTagName("status")[0]) statusNode = (headerNode.getElementsByTagName("status")[0])
jepstatus = getText(statusNode.childNodes) xepstatus = getText(statusNode.childNodes)
typeNode = (headerNode.getElementsByTagName("type")[0]) typeNode = (headerNode.getElementsByTagName("type")[0])
jeptype = getText(typeNode.childNodes) xeptype = getText(typeNode.childNodes)
revNode = (headerNode.getElementsByTagName("revision")[0]) revNode = (headerNode.getElementsByTagName("revision")[0])
versionNode = (revNode.getElementsByTagName("version")[0]) versionNode = (revNode.getElementsByTagName("version")[0])
version = getText(versionNode.childNodes) version = getText(versionNode.childNodes)
@ -77,11 +77,11 @@ remark = getText(remarkNode.childNodes)
# UPDATE DATABASE: # UPDATE DATABASE:
# #
# number is $jepnum # number is $xepnum
# name is $title # name is $title
# type is $jeptype # type is $xeptype
# status is $jepstatus # status is $xepstatus
# notes is "Version $version of XEP-$jepnum released $date." # notes is "Version $version of XEP-$xepnum released $date."
# version is $version # version is $version
# last_modified is $now # last_modified is $now
# abstract is $abstract # abstract is $abstract
@ -89,9 +89,9 @@ remark = getText(remarkNode.childNodes)
db = MySQLdb.connect("localhost", dbuser, dbpw, "foundation") db = MySQLdb.connect("localhost", dbuser, dbpw, "foundation")
cursor = db.cursor() cursor = db.cursor()
theNotes = "Version " + version + " of XEP-" + jepnum + " released " + date + "; Last Call ends " + enddate + "." theNotes = "Version " + version + " of XEP-" + xepnum + " released " + date + "; Last Call ends " + enddate + "."
theLog = remark + " (" + initials + ")" theLog = remark + " (" + initials + ")"
theStatement = "UPDATE jeps SET name='" + title + "', type='" + jeptype + "', status='Proposed', notes='" + theNotes + "', version='" + str(version) + "', last_modified='" + str(now) + "', abstract='" + abstract + "', changelog='" + theLog + "' WHERE number='" + str(jepnum) + "';" theStatement = "UPDATE jeps SET name='" + title + "', type='" + xeptype + "', status='Proposed', 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()
@ -99,14 +99,14 @@ result = cursor.fetchall()
# #
# From: editor@jabber.org # From: editor@jabber.org
# To: standards-jig@jabber.org # To: standards-jig@jabber.org
# Subject: LAST CALL: XEP-$jepnum ($title) # Subject: LAST CALL: XEP-$xepnum ($title)
# Body: # Body:
# This message constitutes notice of a Last Call # This message constitutes notice of a Last Call
# for XEP-$jepnum ($title). # for XEP-$xepnum ($title).
# #
# Abstract: $abstract # Abstract: $abstract
# #
# URL: http://www.jabber.org/jeps/jep-$jepnum.html # URL: http://www.xmpp.org/extensions/xep-$xepnum.html
# #
# This Last Call begins now and shall end at the close # This Last Call begins now and shall end at the close
# of business on $enddate. # of business on $enddate.
@ -118,10 +118,10 @@ fromaddr = "editor@jabber.org"
# for real... # for real...
toaddrs = "standards-jig@jabber.org" toaddrs = "standards-jig@jabber.org"
thesubject = 'LAST CALL: XEP-' + jepnum + " (" + title + ")" thesubject = 'LAST CALL: XEP-' + xepnum + " (" + title + ")"
introline = 'This message constitutes notice of a Last Call for XEP-' + jepnum + ' (' + title + ').' introline = 'This message constitutes notice of a Last Call for XEP-' + xepnum + ' (' + title + ').'
abstractline = 'Abstract: ' + abstract abstractline = 'Abstract: ' + abstract
urlline = 'URL: http://www.jabber.org/jeps/jep-' + jepnum + '.html' urlline = 'URL: http://www.xmpp.org/extensions/xep-' + xepnum + '.html'
schedline = 'This Last Call begins today and shall end at the close of business on ' + enddate + '.' schedline = 'This Last Call begins today and shall end at the close of business on ' + enddate + '.'
#msg = "From: %s\r\n" % fromaddr #msg = "From: %s\r\n" % fromaddr