[Oval-commits] r46 - trunk/tools/oval/parser

Pavel Vinogradov blaze-guest at alioth.debian.org
Tue Jun 12 17:59:58 UTC 2007


Author: blaze-guest
Date: 2007-06-12 17:59:58 +0000 (Tue, 12 Jun 2007)
New Revision: 46

Modified:
   trunk/tools/oval/parser/dsa.py
Log:
Do date normalization


Modified: trunk/tools/oval/parser/dsa.py
===================================================================
--- trunk/tools/oval/parser/dsa.py	2007-06-12 14:16:43 UTC (rev 45)
+++ trunk/tools/oval/parser/dsa.py	2007-06-12 17:59:58 UTC (rev 46)
@@ -34,7 +34,8 @@
 		datepatern = re.compile (r'report_date>([\d-]+)</define-tag>')
 		result = datepatern.search (line)
 		if result:
-			data["date"] = result.groups()[0]
+			date = result.groups()[0]
+			data["date"] = lambda (date): "-".join([(len(p) > 1 and p or "0"+p) for p in date.split("-")])
 		
 		refspatern = re.compile (r'secrefs>(.*?)</define-tag>')
 		result = refspatern.search (line)




More information about the Oval-commits mailing list