[Oval-commits] r53 - in trunk/tools: . oval/definition oval/parser

Pavel Vinogradov blaze-guest at alioth.debian.org
Sat Jun 16 19:11:03 UTC 2007


Author: blaze-guest
Date: 2007-06-16 19:11:02 +0000 (Sat, 16 Jun 2007)
New Revision: 53

Modified:
   trunk/tools/oval/definition/generator.py
   trunk/tools/oval/parser/wml.py
   trunk/tools/parse-dsa-oval.py
Log:
Code cleanup

Modified: trunk/tools/oval/definition/generator.py
===================================================================
--- trunk/tools/oval/definition/generator.py	2007-06-16 14:03:29 UTC (rev 52)
+++ trunk/tools/oval/definition/generator.py	2007-06-16 19:11:02 UTC (rev 53)
@@ -204,7 +204,7 @@
 	doc = xml.dom.minidom.Document ()
 	generator = doc.createElement ("generator")
 
-	generator.appendChild ( __createXMLElement ("oval:product_name", "The MITRE Corporation") )
+	generator.appendChild ( __createXMLElement ("oval:product_name", "Debian") )
 	generator.appendChild ( __createXMLElement ("oval:schema_version", "5.2") )
 	generator.appendChild ( __createXMLElement ("oval:timestamp", datetime.datetime.now().strftime ("%Y-%m-%dT%H:%M:%S.188-04:00")) )
 

Modified: trunk/tools/oval/parser/wml.py
===================================================================
--- trunk/tools/oval/parser/wml.py	2007-06-16 14:03:29 UTC (rev 52)
+++ trunk/tools/oval/parser/wml.py	2007-06-16 19:11:02 UTC (rev 53)
@@ -30,7 +30,7 @@
 		
 		for line in wmlFile:
 			line = line.decode(locale.getpreferredencoding())
-			
+				
 			descrpatern = re.compile (r'description>(.*?)</define-tag>')
 			result = descrpatern.search (line)
 			if result:
@@ -60,9 +60,7 @@
 	return (dsa, data)
 
 def parseMoreinfo (info):
-	
-	from xml.sax import saxutils
-	
+
 	p = re.compile ("<p>(.*?)</p>", re.DOTALL)
 	paragraphs = [m.groups()[0]  for m in re.finditer(p, info, re.DOTALL)]
 	result = ""
@@ -72,9 +70,4 @@
 			break
 		result += "\n" + par
 	
-	return result
-
-if __name__ == "__main__":
-	(dsa, info) = parseFile ("/home/blaze/opt/testdata/simple/dsa-1282.wml")
-	print dsa
-	print info["moreinfo"]
\ No newline at end of file
+	return result
\ No newline at end of file

Modified: trunk/tools/parse-dsa-oval.py
===================================================================
--- trunk/tools/parse-dsa-oval.py	2007-06-16 14:03:29 UTC (rev 52)
+++ trunk/tools/parse-dsa-oval.py	2007-06-16 19:11:02 UTC (rev 53)
@@ -9,6 +9,7 @@
                                                                                                                                                
 import os
 import sys
+import locale
 import getopt
 import logging
 
@@ -76,6 +77,7 @@
 
 if __name__ == "__main__":
     
+    locale.setlocale(locale.LC_ALL, "")
     # Parse cmd options with getopt
     opts = {}
     




More information about the Oval-commits mailing list