[Secure-testing-commits] r6061 - lib/python
fw at alioth.debian.org
fw at alioth.debian.org
Tue Jun 26 12:15:46 UTC 2007
Author: fw
Date: 2007-06-26 12:15:46 +0000 (Tue, 26 Jun 2007)
New Revision: 6061
Modified:
lib/python/nvd.py
Log:
* lib/python/nvd.py:
Make runnable as a script, for testing purposes.
(Parser.characters): Keep whole node string, not just the last part.
Modified: lib/python/nvd.py
===================================================================
--- lib/python/nvd.py 2007-06-25 21:15:28 UTC (rev 6060)
+++ lib/python/nvd.py 2007-06-26 12:15:46 UTC (rev 6061)
@@ -103,7 +103,7 @@
def characters(self, content):
(name, attrs) = self.path[-1]
if name == 'descript' and attrs['source'] == 'cve':
- self.cve_desc = content
+ self.cve_desc += content
def parse(file):
"""Parses the indicated file object. Returns a list of tuples,
@@ -128,3 +128,8 @@
parser.setContentHandler(p)
parser.parse(file)
return p.result
+
+if __name__ == "__main__":
+ import sys
+ for name in sys.argv[1:]:
+ parse(file(name))
More information about the Secure-testing-commits
mailing list