From d243a1667e8409a649bafcb80458807f9d9b45f0 Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Sun, 28 Jun 2020 21:17:16 +0200 Subject: [PATCH] BugFixes needed to update latex and python --- run.py | 10 +++++++--- templates/coverage/report.tex | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/run.py b/run.py index a7ddc18..8f1dc7b 100644 --- a/run.py +++ b/run.py @@ -7,9 +7,13 @@ import reqif import json import os -import platform -import getpass import sys +import platform +try: + from platform import dist as dist +except ImportError: + from distro import linux_distribution as dist +import getpass import subprocess import imp import xml.dom.minidom @@ -224,7 +228,7 @@ def unittest_init(unittest_folder): system_info['Architecture'] = platform.architecture()[0] system_info['Machine'] = platform.machine() system_info['Hostname'] = platform.node() - system_info['Distribution'] = ' '.join(platform.dist()) + system_info['Distribution'] = ' '.join(dist()) system_info['System'] = platform.system() system_info['Kernel'] = platform.release() + ' (%s)' % platform.version() system_info['Username'] = getpass.getuser() diff --git a/templates/coverage/report.tex b/templates/coverage/report.tex index 22c7375..72d68d7 100644 --- a/templates/coverage/report.tex +++ b/templates/coverage/report.tex @@ -12,9 +12,9 @@ {%- for fragment in py_file.fragments %} \lstset{backgroundcolor=\color{bg-{{fragment.coverage_state}}}}\vspace*{-2.7ex} {%- if fragment.end is not none %} - \lstinputlisting[language=Python, linerange={{fragment.start}}-{{fragment.end}}, firstnumber={{fragment.start}}]{ {{py_file.filepath}} } + \lstinputlisting[language=Python, linerange={{fragment.start}}-{{fragment.end}}, firstnumber={{fragment.start}}]{{ "{" ~ py_file.filepath ~ "}" }} {%- else %} - \lstinputlisting[language=Python, firstline={{fragment.start}}, firstnumber={{fragment.start}}]{ {{py_file.filepath}} } + \lstinputlisting[language=Python, firstline={{fragment.start}}, firstnumber={{fragment.start}}]{{ "{" ~ py_file.filepath ~ "}" }} {%- endif %} {%- endfor %} {% endfor %}