args = argparser.parse_args() # init parts of the file names to enable looped file download file_prefix = "nvdcve-2.0-" file_suffix = ".xml" file_mod = "modified" file_rec = "recent" # get the current year. This enables us to download all CVE's up to this year :-) date = datetime.datetime.now() year = date.year + 1 # default config defaultvalue = {} defaultvalue['cvss'] = Configuration.getDefaultCVSS() defaultvalue['cwe'] = "Unknown" cveStartYear = Configuration.getCVEStartYear() # define the CVE parser. Thanks to Meredith Patterson (@maradydd) for help on this one. class CVEHandler(ContentHandler): def __init__(self): self.cves = [] self.inCVSSElem = 0 self.inSUMMElem = 0 self.inDTElem = 0 self.inPUBElem = 0 self.inAccessvElem = 0