Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37855890
en ru br
ALT Linux repos
S:0.5.6-alt1.1

Group :: Graphical desktop/Other
RPM: bamf

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: 1004_py2to3_gtester2xunit.patch
Download


Description: Run gtester2xunit.py with Python3, port libxml2/libxslt to lxml module..
Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
--- a/tests/gtester2xunit.py
+++ b/tests/gtester2xunit.py
@@ -1,18 +1,17 @@
-#! /usr/bin/python
+#! /usr/bin/python3
 from argparse import ArgumentParser
-import libxslt
-import libxml2
+from lxml import etree
 import sys
 import os
 
 XSL_TRANSFORM='/usr/share/gtester2xunit/gtester.xsl'
 
 def transform_file(input_filename, output_filename, xsl_file):
-    gtester = libxml2.parseFile(xsl_file)
-    style = libxslt.parseStylesheetDoc(gtester)
-    doc = libxml2.parseFile(input_filename)
-    result = style.applyStylesheet(doc, None)
-    result.saveFormatFile(filename=output_filename, format=True)
+    gtester = etree.parse(xsl_file)
+    transform = etree.XSLT(gtester)
+    doc = etree.parse(input_filename)
+    result = transform(doc)
+    result.write(output_filename)
 
 
 def get_output_filename(input_filename):
--- a/configure.ac
+++ b/configure.ac
@@ -109,11 +109,11 @@
 # gtester2xunit checks    #
 ###########################
 
-AC_PATH_PROG([PYTHON],[python])
+AC_PATH_PROG([PYTHON],[python3])
 AC_MSG_CHECKING(for gtester2xunit dependencies)
-if !($PYTHON -c "import libxslt, libxml2" 2> /dev/null); then
+if !($PYTHON -c "from lxml import etree" 2> /dev/null); then
   AC_MSG_RESULT([no])
-  AC_MSG_ERROR([You need to install python-libxslt1 and python-libxml2]);
+  AC_MSG_ERROR([You need to install python3-lxml]);
 fi
 AC_MSG_RESULT([yes])
 
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin