Author: gnichols Date: 2011-06-15 19:41:25 +0000 (Wed, 15 Jun 2011) New Revision: 955
Modified: trunk/v7/documentbase.py trunk/v7/report.py Log: 690676 - FEAT: v7 should generate zipped xml file as results
Modified: trunk/v7/documentbase.py =================================================================== --- trunk/v7/documentbase.py 2011-06-08 15:47:56 UTC (rev 954) +++ trunk/v7/documentbase.py 2011-06-15 19:41:25 UTC (rev 955) @@ -14,13 +14,14 @@ # # Author: Greg Nichols # -import string, sys, os +import string, sys, os, zlib import time, datetime from xml.dom.minidom import getDOMImplementation, parse import xml.dom.ext from tags import Tags, Attributes, Constants import version from device import Device, HalDevice, ProcDevice, KudzuDevice, UdevDevice +from command import Command, V7CommandException
class DocumentWrapper: # non-printing ascii unacceptable to xml @@ -263,6 +264,18 @@ sys.exit(1)
file.close() + + def compressToFile(self, filename): + self.save(filename) + try: + gzip = Command("gzip %s" % filename) + gzip.run() + return True + except Exception, exception: + print "Error: could not compress %s" % filename + print exception + + return False
def importElement(self, topElement): dom = getDOMImplementation()
Modified: trunk/v7/report.py =================================================================== --- trunk/v7/report.py 2011-06-08 15:47:56 UTC (rev 954) +++ trunk/v7/report.py 2011-06-15 19:41:25 UTC (rev 955) @@ -203,7 +203,7 @@ self.makeDirectoryPath(etcDirectory) resultsXML = CertificationDocument() resultsXML.load(os.path.join(self.options.data, self.environment.getResultsFileName())) - resultsXML.save(os.path.join(etcDirectory, self.environment.getResultsFileName())) + resultsXML.compressToFile(os.path.join(etcDirectory, self.environment.getResultsFileName())) shutil.copy("/etc/v7.xml", os.path.join(etcDirectory, "v7.xml")) # save v7 environment settings
v7-commits@lists.stg.fedorahosted.org