File Check-only-for-Python-3-for-erml2pdf.py.patch of Package kraft4

From 7eff90f462c740b527a1484e31383ea707351180 Mon Sep 17 00:00:00 2001
From: Pino Toscano <toscano.pino@tiscali.it>
Date: Mon, 30 Dec 2019 08:24:25 +0100
Subject: [PATCH] Check for only for Python 3 for erml2pdf.py

Python 3 has been around for many years, and even not so recent distros
ship it. Considering Python 2 is EOL since 2020, switch the search for
the Python interpreter for erml2pdf.py to Python 3 only.
---
 src/reportgenerator.cpp | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/src/reportgenerator.cpp b/src/reportgenerator.cpp
index 4547319..6ca4dcc 100644
--- a/src/reportgenerator.cpp
+++ b/src/reportgenerator.cpp
@@ -433,14 +433,10 @@ QStringList ReportGenerator::findTrml2Pdf( )
     QString ermlpy = KStandardDirs::locate( "data", "kraft/tools/erml2pdf.py" );
     kDebug() << "Ermlpy: " << ermlpy;
     if( ! ermlpy.isEmpty() ) {
-      // need the python interpreter
-      // First check for python2 in python3 times. 
-      QString python = KStandardDirs::findExe("python2");
+      // need the python3 interpreter, check for it
+      QString python = KStandardDirs::findExe("python3");
       if( python.isEmpty() ) {
-	python = KStandardDirs::findExe("python");
-      }
-      if( python.isEmpty() ) {
-        kError() << "ERR: Unable to find python, thats a problem";
+        kError() << "ERR: Unable to find python3, thats a problem";
       } else {
         kDebug() << "Using python: " << python;
         retList << python;
@@ -454,7 +450,7 @@ QStringList ReportGenerator::findTrml2Pdf( )
           p += QLatin1String("/tools/erml2pdf.py");
           kDebug() << "Found erml2pdf from KRAFT_HOME: " << p;
           if( QFile::exists( p ) ) {
-              retList << "python";
+              retList << "python3";
               retList << p;
               mHavePdfMerge = true;
           }
@@ -497,7 +593,7 @@ void ReportGenerator::runTrml2Pdf( const QString& rmlFile, const QString& docID,
 
   mErrors = QString();
   // findTrml2Pdf returns a list of command line parts for the converter, such as
-  // /usr/bin/pyhton /usr/local/share/erml2pdf.py
+  // /usr/bin/pyhton3 /usr/local/share/erml2pdf.py
   QStringList rmlbin = findTrml2Pdf();
 
   if ( ! rmlbin.size() ) {
openSUSE Build Service is sponsored by