aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Buchholz <rbu@gentoo.org>2008-09-25 18:50:54 +0000
committerRobert Buchholz <rbu@gentoo.org>2008-09-25 18:50:54 +0000
commiteb671bf396fa164c0bb4ef9c7f907d263edcd05f (patch)
tree66669479a62a6de533a7879d3f7661c6a6e1990e /lib/python/nvd.py
parentImprove bug update syntax (diff)
downloadsecurity-eb671bf396fa164c0bb4ef9c7f907d263edcd05f.tar.gz
security-eb671bf396fa164c0bb4ef9c7f907d263edcd05f.tar.bz2
security-eb671bf396fa164c0bb4ef9c7f907d263edcd05f.zip
Pull out general parts of check-todo-issues into cvetools.py
svn path=/; revision=740
Diffstat (limited to 'lib/python/nvd.py')
-rw-r--r--lib/python/nvd.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/python/nvd.py b/lib/python/nvd.py
index e7f421a..d457e04 100644
--- a/lib/python/nvd.py
+++ b/lib/python/nvd.py
@@ -32,7 +32,7 @@ class _Parser(xml.sax.handler.ContentHandler):
self.result = {}
self.start_dispatcher = {}
for x in ('entry', 'local', 'range', 'network', 'local_network', 'user_init',
- 'avail', 'conf', 'int', 'sec_prot', 'prod'):
+ 'avail', 'conf', 'int', 'sec_prot', 'prod', 'ref'):
self.start_dispatcher[x] = getattr(self, 'TAG_' + x)
self.path = []
@@ -88,6 +88,8 @@ class _Parser(xml.sax.handler.ContentHandler):
= self.loss_sec_prot_other = 0
self.product_name = self.product_vendor = None
+
+ self.refs = []
def TAG_range(self, name, attrs):
self.range_local = self.range_local_network = self.range_network = self.range_user_init = 0
@@ -129,6 +131,9 @@ class _Parser(xml.sax.handler.ContentHandler):
self.product_vendor = self.product_vendor.encode('utf-8')
except KeyError:
pass
+ def TAG_ref(self, name, attrs):
+ if attrs.has_key('url'):
+ self.refs.append(attrs['url'])
def endElement(self, name):
if name == 'entry':
@@ -149,7 +154,8 @@ class _Parser(xml.sax.handler.ContentHandler):
'loss_sec_prot_admin': self.loss_sec_prot_admin,
'loss_sec_prot_other': self.loss_sec_prot_other,
'product_name': self.product_name,
- 'product_vendor': self.product_vendor}
+ 'product_vendor': self.product_vendor,
+ 'refs' : self.refs}
del self.path[-1]
def characters(self, content):