From 1b0abe2f6147cbb0ddff39680c0391556ed108bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ram=C3=B3n=20M=2E=20G=C3=B3mez?= Date: Mon, 4 May 2020 20:00:45 +0200 Subject: [PATCH] #940: Adapting OGAgent for Linux to Python 3 --- linux/debian/changelog | 6 ++++++ linux/debian/control | 4 ++-- linux/ogagent-template.spec | 5 ++++- linux/scripts/OGAgentTool | 6 +++--- linux/scripts/ogagent | 6 +++--- src/update.sh | 6 +++--- 6 files changed, 21 insertions(+), 12 deletions(-) diff --git a/linux/debian/changelog b/linux/debian/changelog index 9b59a25..d4db09c 100644 --- a/linux/debian/changelog +++ b/linux/debian/changelog @@ -1,3 +1,9 @@ +ogagent (1.2.0) unstable; urgency=medium + + * Python 3 and Qt 5 compatibility + + -- Ramón M. Gómez Mon, 4 May 2020 18:00:00 +0100 + ogagent (1.1.1b) stable; urgency=medium * Use python-distro to detect the distribution version diff --git a/linux/debian/control b/linux/debian/control index 7df4dea..1dee8fb 100644 --- a/linux/debian/control +++ b/linux/debian/control @@ -11,8 +11,8 @@ Section: admin Priority: optional Architecture: all Depends: - policykit-1 (>= 0.100), python2 (>=2.7) | python (>= 2.7), python-qt4 (>= 4.9),, python-requests (>= 0.8.2), - python-six (>= 1.1), python-prctl (>= 1.1.1), python-distro, libxss1, ${misc:Depends} + policykit-1 (>= 0.100), python3 (>=3.5) | python (>= 3.5), python3-qt5, python3-requests, + python3-six, python3-prctl, python3-distro, libxss1, ${misc:Depends} Suggests: gnome-shell-extension-top-icons-plus Description: OpenGnsys Agent for Operating Systems This package provides the required components to allow this machine to work on an environment managed by OpenGnsys. diff --git a/linux/ogagent-template.spec b/linux/ogagent-template.spec index 7f55454..f88071a 100644 --- a/linux/ogagent-template.spec +++ b/linux/ogagent-template.spec @@ -11,7 +11,7 @@ Release: %{release} Summary: OpenGnsys Agent for Operating Systems License: BSD3 Group: Admin -Requires: chkconfig initscripts python-six python-requests python-distro PyQt4 libXScrnSaver +Requires: chkconfig initscripts libXScrnSaver python3-distro python3-qt5 python3-requests python3-six Vendor: OpenGnsys Project URL: https://opengnsys.es/ Provides: ogagent @@ -65,6 +65,9 @@ This package provides the required components to allow this machine to work on a /usr/share/autostart/OGAgentTool.desktop %changelog +* Mon May 04 2020 Ramón M. Gómez - 1.2.0 +- Python 3 and Qt 5 compatibility + * Fri Feb 07 2020 Ramón M. Gómez - 1.1.1b-1 - Use python-distro to detect the distribution version diff --git a/linux/scripts/OGAgentTool b/linux/scripts/OGAgentTool index da91704..5195b11 100755 --- a/linux/scripts/OGAgentTool +++ b/linux/scripts/OGAgentTool @@ -1,10 +1,10 @@ #!/bin/sh -for p in python python2; do - [ -z "$PYTHON" ] && [ $($p -c 'import sys; print(sys.version_info[0])') -eq 2 ] && PYTHON=$p +for p in python python3; do + [ -z "$PYTHON" ] && [ $($p -c 'import sys; print(sys.version_info[0])') -eq 3 ] && PYTHON=$p done if [ -z "$PYTHON" ]; then - echo "ERROR: OGAgent needs Python 2" &>2 + echo "ERROR: OGAgent needs Python 3" &>2 exit 1 fi diff --git a/linux/scripts/ogagent b/linux/scripts/ogagent index 155af67..f06a004 100755 --- a/linux/scripts/ogagent +++ b/linux/scripts/ogagent @@ -1,10 +1,10 @@ #!/bin/sh -for p in python python2; do - [ -z "$PYTHON" ] && [ $($p -c 'import sys; print(sys.version_info[0])') -eq 2 ] && PYTHON=$p +for p in python python3; do + [ -z "$PYTHON" ] && [ $($p -c 'import sys; print(sys.version_info[0])') -eq 3 ] && PYTHON=$p done if [ -z "$PYTHON" ]; then - echo "ERROR: OGAgent needs Python 2" &>2 + echo "ERROR: OGAgent needs Python 3" &>2 exit 1 fi diff --git a/src/update.sh b/src/update.sh index e6e02ab..f1db2ad 100755 --- a/src/update.sh +++ b/src/update.sh @@ -28,13 +28,13 @@ function process { - pyuic4 about-dialog.ui -o about_dialog_ui.py -x - pyuic4 message-dialog.ui -o message_dialog_ui.py -x + pyuic5 about-dialog.ui -o about_dialog_ui.py -x + pyuic5 message-dialog.ui -o message_dialog_ui.py -x } cd $(dirname "$0") [ -r VERSION ] && sed -i "s/Version [^<]*/Version $(cat VERSION)/" about-dialog.ui -pyrcc4 -py3 OGAgent.qrc -o OGAgent_rc.py +pyrcc5 OGAgent.qrc -o OGAgent_rc.py # process current directory ui's