diff options
author | Florian Weimer <fw@deneb.enyo.de> | 2007-06-26 12:15:46 +0000 |
---|---|---|
committer | Florian Weimer <fw@deneb.enyo.de> | 2007-06-26 12:15:46 +0000 |
commit | 16358178880e77d911fb9c3006c63f7fd4210b29 (patch) | |
tree | 1b52b88f10557d99582e9e0f941f642b430be7a3 /lib/python/nvd.py | |
parent | 1a754017143fb3c44c6029feab0d0fb7c42513b5 (diff) |
* lib/python/nvd.py:
Make runnable as a script, for testing purposes.
(Parser.characters): Keep whole node string, not just the last part.
git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@6061 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'lib/python/nvd.py')
-rw-r--r-- | lib/python/nvd.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/python/nvd.py b/lib/python/nvd.py index 77362e77a4..87b6d14bcc 100644 --- a/lib/python/nvd.py +++ b/lib/python/nvd.py @@ -103,7 +103,7 @@ class _Parser(xml.sax.handler.ContentHandler): 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 @@ def parse(file): parser.setContentHandler(p) parser.parse(file) return p.result + +if __name__ == "__main__": + import sys + for name in sys.argv[1:]: + parse(file(name)) |