1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-12-22 07:38:52 -05:00

xepification

git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@157 4b5297f7-1745-476d-ba37-a9c6900126ab
This commit is contained in:
Peter Saint-Andre 2006-11-01 20:36:44 +00:00
parent 997e2dfbdb
commit 446f186cf9

View File

@ -1,12 +1,12 @@
#!/usr/bin/env python #!/usr/bin/env python
# File: deferred.py # File: deferred.py
# Version: 0.2 # Version: 0.3
# Description: a script for setting a XEP to Deferred # Description: a script for setting a XEP to Deferred
# Last Modified: 2006-04-24 # Last Modified: 2006-11-01
# Author: Peter Saint-Andre (stpeter@jabber.org) # Author: Peter Saint-Andre (stpeter@jabber.org)
# License: public domain # License: public domain
# HowTo: ./deferred.py jepnum dbuser dbpw # HowTo: ./deferred.py xepnum dbuser dbpw
# IMPORTS: # IMPORTS:
# #
@ -37,11 +37,11 @@ now = int(time.time())
# 2. database user # 2. database user
# 3. database password # 3. database password
jepnum = sys.argv[1]; xepnum = sys.argv[1];
dbuser = sys.argv[2]; dbuser = sys.argv[2];
dbpw = sys.argv[3]; dbpw = sys.argv[3];
jepfile = jepnum + '/jep-' + jepnum + '.xml' xepfile = 'xep-' + xepnum + '.xml'
# PARSE XEP HEADERS: # PARSE XEP HEADERS:
# #
@ -52,17 +52,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)
@ -75,11 +75,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
@ -87,9 +87,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 + "; consideration deferred because of inactivity." theNotes = "Version " + version + " of XEP-" + xepnum + " released " + date + "; consideration deferred because of inactivity."
theLog = remark + " (" + initials + ")" theLog = remark + " (" + initials + ")"
theStatement = "UPDATE jeps SET name='" + title + "', type='" + jeptype + "', status='Deferred', 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='Deferred', 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()
@ -97,13 +97,13 @@ result = cursor.fetchall()
# #
# From: editor@jabber.org # From: editor@jabber.org
# To: standards-jig@jabber.org # To: standards-jig@jabber.org
# Subject: DEFERRED: XEP-$jepnum ($title) # Subject: DEFERRED: XEP-$xepnum ($title)
# Body: # Body:
# XEP-$jepnum ($title) has been Deferred because of inactivity. # XEP-$xepnum ($title) has been Deferred because of inactivity.
# #
# Abstract: $abstract # Abstract: $abstract
# #
# URL: http://www.jabber.org/jeps/jep-$jepnum.html # URL: http://www.xmpp.org/extensions/xep-$xepnum.html
# #
# If and when a new revision of this XEP is published, # If and when a new revision of this XEP is published,
# its status will be changed back to Experimental. # its status will be changed back to Experimental.
@ -115,10 +115,10 @@ fromaddr = "editor@jabber.org"
# for real... # for real...
toaddrs = "standards-jig@jabber.org" toaddrs = "standards-jig@jabber.org"
thesubject = 'DEFERRED: XEP-' + jepnum + " (" + title + ")" thesubject = 'DEFERRED: XEP-' + xepnum + " (" + title + ")"
introline = 'XEP-' + jepnum + ' (' + title + ') has been Deferred because of inactivity.' introline = 'XEP-' + xepnum + ' (' + title + ') has been Deferred because of inactivity.'
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'
endline = 'If and when a new revision of this XEP is published, its status will be changed back to Experimental.' endline = 'If and when a new revision of this XEP is published, its status will be changed back to Experimental.'
#msg = "From: %s\r\n" % fromaddr #msg = "From: %s\r\n" % fromaddr