1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-11-25 10:42:19 -05:00

moved db updating code

git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@260 4b5297f7-1745-476d-ba37-a9c6900126ab
This commit is contained in:
Peter Saint-Andre 2006-12-08 03:15:23 +00:00
parent cfef872837
commit 8e2a175c01
3 changed files with 7 additions and 85 deletions

View File

@ -6,13 +6,12 @@
# Last Modified: 2006-10-03 # Last Modified: 2006-10-03
# Author: Peter Saint-Andre (stpeter@jabber.org) # Author: Peter Saint-Andre (stpeter@jabber.org)
# License: public domain # License: public domain
# HowTo: ./announce.py xepnum dbuser dbpw 'cvsmodsurl' # HowTo: ./announce.py xepnum 'cvsmodsurl'
# NOTE: the cvsmodsurl MUST be in quotes! # NOTE: the cvsmodsurl MUST be in quotes!
# IMPORTS: # IMPORTS:
# #
import glob import glob
import MySQLdb
import os import os
from select import select from select import select
import smtplib import smtplib
@ -35,13 +34,10 @@ now = int(time.time())
# READ IN ARGS: # READ IN ARGS:
# #
# 1. XEP number # 1. XEP number
# 2. database user # 2. URL for CVS mods
# 3. database password
xepnum = sys.argv[1]; xepnum = sys.argv[1];
dbuser = sys.argv[2]; mods = sys.argv[2];
dbpw = sys.argv[3];
mods = sys.argv[4];
xepfile = 'xep-' + xepnum + '.xml' xepfile = 'xep-' + xepnum + '.xml'
@ -97,30 +93,6 @@ elif (xepstatus == "Retracted"):
elif (xepstatus == "Deferred"): elif (xepstatus == "Deferred"):
xepflag = "defer" xepflag = "defer"
# UPDATE DATABASE:
#
# number is $xepnum
# name is $title
# type is $xeptype
# status is $xepstatus
# notes is "Version $version of XEP-$xepnum released $date."
# version is $version
# last_modified is $now
# abstract is $abstract
# changelog is "$remark ($initials)"
db = MySQLdb.connect("localhost", dbuser, dbpw, "foundation")
cursor = db.cursor()
theNotes = "Version " + version + " of XEP-" + xepnum + " released " + date + "."
theLog = remark + " (" + initials + ")"
if xepflag == "new":
theStatement = "INSERT INTO jeps VALUES ('" + str(xepnum) + "', '" + title + "', '" + xeptype + "', '" + xepstatus + "', '" + theNotes + "', '" + str(version) + "', '" + str(now) + "', '" + abstract + "', '" + theLog + "', '0', '5', 'Proposed', 'none');"
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)
result = cursor.fetchall()
## SEND MAIL: ## SEND MAIL:
# #
# From: editor@jabber.org # From: editor@jabber.org

View File

@ -6,12 +6,11 @@
# Last Modified: 2006-11-01 # 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 xepnum dbuser dbpw # HowTo: ./deferred.py xepnum
# IMPORTS: # IMPORTS:
# #
import glob import glob
import MySQLdb
import os import os
from select import select from select import select
import smtplib import smtplib
@ -34,12 +33,8 @@ now = int(time.time())
# READ IN ARGS: # READ IN ARGS:
# #
# 1. XEP number # 1. XEP number
# 2. database user
# 3. database password
xepnum = sys.argv[1]; xepnum = sys.argv[1];
dbuser = sys.argv[2];
dbpw = sys.argv[3];
xepfile = 'xep-' + xepnum + '.xml' xepfile = 'xep-' + xepnum + '.xml'
@ -73,26 +68,6 @@ initials = getText(initialsNode.childNodes)
remarkNode = (revNode.getElementsByTagName("remark")[0]) remarkNode = (revNode.getElementsByTagName("remark")[0])
remark = getText(remarkNode.childNodes) remark = getText(remarkNode.childNodes)
# UPDATE DATABASE:
#
# number is $xepnum
# name is $title
# type is $xeptype
# status is $xepstatus
# notes is "Version $version of XEP-$xepnum released $date."
# version is $version
# last_modified is $now
# abstract is $abstract
# changelog is "$remark ($initials)"
db = MySQLdb.connect("localhost", dbuser, dbpw, "foundation")
cursor = db.cursor()
theNotes = "Version " + version + " of XEP-" + xepnum + " released " + date + "; consideration deferred because of inactivity."
theLog = remark + " (" + initials + ")"
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)
result = cursor.fetchall()
# SEND MAIL: # SEND MAIL:
# #
# From: editor@jabber.org # From: editor@jabber.org

View File

@ -1,17 +1,16 @@
#!/usr/bin/env python #!/usr/bin/env python
# File: lastcall.py # File: lastcall.py
# Version: 0.3 # Version: 0.4
# Description: a script for announcing Last Calls # Description: a script for announcing Last Calls
# Last Modified: 2006-10-11 # 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: ./lastcall.py xepnum enddate dbuser dbpw # HowTo: ./lastcall.py xepnum enddate
# IMPORTS: # IMPORTS:
# #
import glob import glob
import MySQLdb
import os import os
from select import select from select import select
import smtplib import smtplib
@ -35,13 +34,9 @@ now = int(time.time())
# #
# 1. XEP number # 1. XEP number
# 2. end date # 2. end date
# 3. database user
# 4. database password
xepnum = sys.argv[1]; xepnum = sys.argv[1];
enddate = sys.argv[2]; enddate = sys.argv[2];
dbuser = sys.argv[3];
dbpw = sys.argv[4];
xepfile = 'xep-' + xepnum + '.xml' xepfile = 'xep-' + xepnum + '.xml'
@ -75,26 +70,6 @@ initials = getText(initialsNode.childNodes)
remarkNode = (revNode.getElementsByTagName("remark")[0]) remarkNode = (revNode.getElementsByTagName("remark")[0])
remark = getText(remarkNode.childNodes) remark = getText(remarkNode.childNodes)
# UPDATE DATABASE:
#
# number is $xepnum
# name is $title
# type is $xeptype
# status is $xepstatus
# notes is "Version $version of XEP-$xepnum released $date."
# version is $version
# last_modified is $now
# abstract is $abstract
# changelog is "$remark ($initials)"
db = MySQLdb.connect("localhost", dbuser, dbpw, "foundation")
cursor = db.cursor()
theNotes = "Version " + version + " of XEP-" + xepnum + " released " + date + "; Last Call ends " + enddate + "."
theLog = remark + " (" + initials + ")"
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)
result = cursor.fetchall()
# SEND MAIL: # SEND MAIL:
# #
# From: editor@jabber.org # From: editor@jabber.org