diff options
author | Emilio Pozuelo Monfort <pochu@debian.org> | 2018-05-11 15:35:39 +0200 |
---|---|---|
committer | Emilio Pozuelo Monfort <pochu@debian.org> | 2018-06-08 08:38:46 +0200 |
commit | 0b664197d33a0e35348969561dafaad09b6c44a0 (patch) | |
tree | e6a22205a0301da6a9ae0d35e834b4c88cf2565f /lib | |
parent | e76e94cab6702eac4d9c38dbeccc6add906b184e (diff) |
Simplify DLAFile
Subclass DSAFile rather than copying it.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/python/bugs.py | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/lib/python/bugs.py b/lib/python/bugs.py index b876647da9..6a042033b5 100644 --- a/lib/python/bugs.py +++ b/lib/python/bugs.py @@ -814,47 +814,12 @@ class DSAFile(FileBase): bug.mergeNotes() return bug -class DLAFile(FileBase): - """A DLA file. - - Similar to a CVE file, only that it contains DLAs as its main - reference point, and release dates. - """ - +class DLAFile(DSAFile): re_dsa = re.compile(r'^\[(\d\d) ([A-Z][a-z][a-z]) (\d{4})\] ' + r'(DLA-\d+(?:-\d+)?)\s+' + r'(.*?)\s*$') - month_names = {'Jan': 1, - 'Feb': 2, - 'Mar': 3, - 'Apr': 4, - 'May': 5, - 'Jun': 6, - 'Jul': 7, - 'Aug': 8, - 'Sep': 9, - 'Oct': 10, - 'Nov': 11, - 'Dec': 12} - def matchHeader(self, line): - match = self.re_dsa.match(line) - if not match: - self.raiseSyntaxError("expected DLA record, got: %s" % `line`) - (record_name, description) = match.groups() - (day, month, year, name, desc) = match.groups() - try: - month = self.month_names[month] - except KeyError: - self.raiseSyntaxError("invalid month name %s" % `month`) - return ("%s-%02d-%s" % (year, month, day), name, desc) - - def finishBug(self, bug): - # Merge identical package notes, for historical reasons. - bug.mergeNotes() - return bug - class DTSAFile(FileBase): """A DTSA file. |