1- # Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
1+ # Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
22# All rights reserved. Contact: Pasi Eronen <pasi.eronen@nokia.com>
33#
44# Redistribution and use in source and binary forms, with or without
@@ -109,6 +109,15 @@ def getDocList(parentNode, tagName):
109109 updated_by = getDocList (node , "updated-by" )
110110 obsoletes = getDocList (node , "obsoletes" )
111111 obsoleted_by = getDocList (node , "obsoleted-by" )
112+ stream = getChildText (node , "stream" )
113+ wg = getChildText (node , "wg_acronym" )
114+ if wg and ((wg == "NON WORKING GROUP" ) or len (wg ) > 15 ):
115+ wg = None
116+
117+ l = []
118+ for format in node .getElementsByTagName ("format" ):
119+ l .append (getChildText (format , "file-format" ))
120+ file_formats = ("," .join (l )).lower ()
112121
113122 draft = getChildText (node , "draft" )
114123 if draft and re .search ("-\d\d$" , draft ):
@@ -119,7 +128,7 @@ def getDocList(parentNode, tagName):
119128 else :
120129 has_errata = 0
121130
122- data .append ([rfc_number ,title ,authors ,rfc_published_date ,current_status ,updates ,updated_by ,obsoletes ,obsoleted_by ,None ,draft ,has_errata ])
131+ data .append ([rfc_number ,title ,authors ,rfc_published_date ,current_status ,updates ,updated_by ,obsoletes ,obsoleted_by ,None ,draft ,has_errata , stream , wg , file_formats ])
123132
124133 for d in data :
125134 k = "RFC%04d" % d [0 ]
@@ -133,7 +142,7 @@ def insert_to_database(data):
133142 log ("removing old data..." )
134143 cursor .execute ("DELETE FROM " + TABLE )
135144 log ("inserting new data..." )
136- cursor .executemany ("INSERT INTO " + TABLE + " (rfc_number, title, authors, rfc_published_date, current_status,updates,updated_by,obsoletes,obsoleted_by,also,draft,has_errata) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)" , data )
145+ cursor .executemany ("INSERT INTO " + TABLE + " (rfc_number, title, authors, rfc_published_date, current_status,updates,updated_by,obsoletes,obsoleted_by,also,draft,has_errata,stream,wg,file_formats ) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)" , data )
137146 cursor .close ()
138147 db .connection ._commit ()
139148 db .connection .close ()
0 commit comments