--- a/src/unicorn_ui.py Thu Oct 21 14:14:55 2010 -0400
+++ b/src/unicorn_ui.py Fri Nov 19 00:45:31 2010 +0900
@@ -10,6 +10,7 @@
"""
import sys
import os
+from red_speak import _Classifications
# Add working directory to Python path
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from red import ResourceExpertDroid
@@ -91,6 +92,21 @@
rootDoc.setAttribute("xml:lang", "en")
rootDoc.setAttribute("ref", self.test_uri)
doc.appendChild(rootDoc)
+
+ """
+ Getting group informatios from _Classifications class
+ This implimentation is little a bit hack :)
+ """
+ for k, v in _Classifications.__dict__.items():
+ if not str(k).startswith("_"):
+ group_element = doc.createElement("group")
+ group_element.setAttribute("name", str(k).lower())
+ title_element = doc.createElement("title")
+ title_text = doc.createTextNode(str(v))
+ title_element.appendChild(title_text)
+ group_element.appendChild(title_element)
+ rootDoc.appendChild(group_element)
+
return rootDoc, doc
def _generate_output_xml(self, test_uri, messages):
@@ -102,6 +118,14 @@
for i in messages:
m = doc.createElement("message")
m.setAttribute("type", self._convert_level(i.level))
+
+ """
+ Hack
+ TODO: clean up this code
+ """
+ category = str(_Classifications.__dict__.keys()[_Classifications.__dict__.values().index(i.category)].lower())
+ m.setAttribute("group", category)
+
title = doc.createElement("title")
title.appendChild(doc.createTextNode(i.summary['en'] % i.vars))
text = "<description>" + (i.text['en'] % i.vars) + "</description>"