From 8e2a175c019789a8b3a4a00f68404b57e2669a00 Mon Sep 17 00:00:00 2001 From: Peter Saint-Andre Date: Fri, 8 Dec 2006 03:15:23 +0000 Subject: [PATCH] moved db updating code git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@260 4b5297f7-1745-476d-ba37-a9c6900126ab --- announce.py | 34 +++------------------------------- deferred.py | 27 +-------------------------- lastcall.py | 31 +++---------------------------- 3 files changed, 7 insertions(+), 85 deletions(-) diff --git a/announce.py b/announce.py index 113aa6ad..4e15f200 100755 --- a/announce.py +++ b/announce.py @@ -6,13 +6,12 @@ # Last Modified: 2006-10-03 # Author: Peter Saint-Andre (stpeter@jabber.org) # License: public domain -# HowTo: ./announce.py xepnum dbuser dbpw 'cvsmodsurl' +# HowTo: ./announce.py xepnum 'cvsmodsurl' # NOTE: the cvsmodsurl MUST be in quotes! # IMPORTS: # import glob -import MySQLdb import os from select import select import smtplib @@ -35,13 +34,10 @@ now = int(time.time()) # READ IN ARGS: # # 1. XEP number -# 2. database user -# 3. database password +# 2. URL for CVS mods xepnum = sys.argv[1]; -dbuser = sys.argv[2]; -dbpw = sys.argv[3]; -mods = sys.argv[4]; +mods = sys.argv[2]; xepfile = 'xep-' + xepnum + '.xml' @@ -97,30 +93,6 @@ elif (xepstatus == "Retracted"): elif (xepstatus == "Deferred"): 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: # # From: editor@jabber.org diff --git a/deferred.py b/deferred.py index f68dccd0..b7b3ed5a 100755 --- a/deferred.py +++ b/deferred.py @@ -6,12 +6,11 @@ # Last Modified: 2006-11-01 # Author: Peter Saint-Andre (stpeter@jabber.org) # License: public domain -# HowTo: ./deferred.py xepnum dbuser dbpw +# HowTo: ./deferred.py xepnum # IMPORTS: # import glob -import MySQLdb import os from select import select import smtplib @@ -34,12 +33,8 @@ now = int(time.time()) # READ IN ARGS: # # 1. XEP number -# 2. database user -# 3. database password xepnum = sys.argv[1]; -dbuser = sys.argv[2]; -dbpw = sys.argv[3]; xepfile = 'xep-' + xepnum + '.xml' @@ -73,26 +68,6 @@ initials = getText(initialsNode.childNodes) remarkNode = (revNode.getElementsByTagName("remark")[0]) 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: # # From: editor@jabber.org diff --git a/lastcall.py b/lastcall.py index e62b789d..7d5b5da7 100755 --- a/lastcall.py +++ b/lastcall.py @@ -1,17 +1,16 @@ #!/usr/bin/env python # File: lastcall.py -# Version: 0.3 +# Version: 0.4 # Description: a script for announcing Last Calls -# Last Modified: 2006-10-11 +# Last Modified: 2006-12-07 # Author: Peter Saint-Andre (stpeter@jabber.org) # License: public domain -# HowTo: ./lastcall.py xepnum enddate dbuser dbpw +# HowTo: ./lastcall.py xepnum enddate # IMPORTS: # import glob -import MySQLdb import os from select import select import smtplib @@ -35,13 +34,9 @@ now = int(time.time()) # # 1. XEP number # 2. end date -# 3. database user -# 4. database password xepnum = sys.argv[1]; enddate = sys.argv[2]; -dbuser = sys.argv[3]; -dbpw = sys.argv[4]; xepfile = 'xep-' + xepnum + '.xml' @@ -75,26 +70,6 @@ initials = getText(initialsNode.childNodes) remarkNode = (revNode.getElementsByTagName("remark")[0]) 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: # # From: editor@jabber.org