On 04/19/2012 10:25 AM, Osier Yang wrote:
> From the codes, it's to generator the output log in XML format, but not to parse. The class name is also changed from "Logxml_parser" to "LogGenerator". --- libvirt-test-api | 8 ++++---- src/{logxmlparser.py => log_generator.py} | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) rename src/{logxmlparser.py => log_generator.py} (99%) diff --git a/libvirt-test-api b/libvirt-test-api index 62e18f6..a409556 100755 --- a/libvirt-test-api +++ b/libvirt-test-api @@ -28,7 +28,7 @@ from src import generator from src import env_clear from src import process from utils import log -from src.logxmlparser import Logxml_parser +from src.log_generator import LogGenerator from src.activityfilter import Filter from src.casecfgcheck import CaseCfgCheck @@ -93,7 +93,7 @@ class Main(object): testrunid = time.strftime("%Y%m%d%H%M%S") os.makedirs('log/%s' %testrunid) - log_xml_parser = Logxml_parser(self.logxml) + log_xml_parser = LogGenerator(self.logxml) # If the specified log xmlfile exists, then append the testrun # item of this time to the file, if not, create a new log xmlfile @@ -256,7 +256,7 @@ class Main(object): def remove_log(self, testrunid, testid = None): """ to remove log item in the log xmlfile """ - log_xml_parser = Logxml_parser(self.logxml) + log_xml_parser = LogGenerator(self.logxml) # remove a test in a testrun if testrunid and testid: @@ -289,7 +289,7 @@ class Main(object): def merge_logxmls(self, logxml_two): """ to merge two log xml files of log into one""" - log_xml_parser = Logxml_parser(self.logxml) + log_xml_parser = LogGenerator(self.logxml) log_xml_parser.merge_xmlfiles(logxml_two) print "Merge the second log xml file %s to %s successfully " % \ (logxml_two, self.logxml) diff --git a/src/logxmlparser.py b/src/log_generator.py similarity index 99% rename from src/logxmlparser.py rename to src/log_generator.py index 36d743e..a001ef2 100644 --- a/src/logxmlparser.py +++ b/src/log_generator.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# logxmlparser.py: Generate output log file in XML format. +# log_generator.py: Generate output log file in XML format. # Copyright (C) 2010-2012 Red Hat, Inc. # @@ -24,7 +24,7 @@ from xml.dom.minidom import Document from src import exception -class Logxml_parser(object): +class LogGenerator(object): """ Generate and parser log xml file """ def __init__(self, logxml):
ACK Guannan Ren -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list