#940: Adapting OGAgent for Linux to Python 3

remotes/github/python3
Ramón M. Gómez 2020-05-04 20:00:45 +02:00
parent 909a626001
commit 1b0abe2f61
6 changed files with 21 additions and 12 deletions

View File

@ -1,3 +1,9 @@
ogagent (1.2.0) unstable; urgency=medium
* Python 3 and Qt 5 compatibility
-- Ramón M. Gómez <ramongomez@us.es> Mon, 4 May 2020 18:00:00 +0100
ogagent (1.1.1b) stable; urgency=medium ogagent (1.1.1b) stable; urgency=medium
* Use python-distro to detect the distribution version * Use python-distro to detect the distribution version

View File

@ -11,8 +11,8 @@ Section: admin
Priority: optional Priority: optional
Architecture: all Architecture: all
Depends: Depends:
policykit-1 (>= 0.100), python2 (>=2.7) | python (>= 2.7), python-qt4 (>= 4.9),, python-requests (>= 0.8.2), policykit-1 (>= 0.100), python3 (>=3.5) | python (>= 3.5), python3-qt5, python3-requests,
python-six (>= 1.1), python-prctl (>= 1.1.1), python-distro, libxss1, ${misc:Depends} python3-six, python3-prctl, python3-distro, libxss1, ${misc:Depends}
Suggests: gnome-shell-extension-top-icons-plus Suggests: gnome-shell-extension-top-icons-plus
Description: OpenGnsys Agent for Operating Systems Description: OpenGnsys Agent for Operating Systems
This package provides the required components to allow this machine to work on an environment managed by OpenGnsys. This package provides the required components to allow this machine to work on an environment managed by OpenGnsys.

View File

@ -11,7 +11,7 @@ Release: %{release}
Summary: OpenGnsys Agent for Operating Systems Summary: OpenGnsys Agent for Operating Systems
License: BSD3 License: BSD3
Group: Admin 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 Vendor: OpenGnsys Project
URL: https://opengnsys.es/ URL: https://opengnsys.es/
Provides: ogagent 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 /usr/share/autostart/OGAgentTool.desktop
%changelog %changelog
* Mon May 04 2020 Ramón M. Gómez <ramongomez@us.es> - 1.2.0
- Python 3 and Qt 5 compatibility
* Fri Feb 07 2020 Ramón M. Gómez <ramongomez@us.es> - 1.1.1b-1 * Fri Feb 07 2020 Ramón M. Gómez <ramongomez@us.es> - 1.1.1b-1
- Use python-distro to detect the distribution version - Use python-distro to detect the distribution version

View File

@ -1,10 +1,10 @@
#!/bin/sh #!/bin/sh
for p in python python2; do for p in python python3; do
[ -z "$PYTHON" ] && [ $($p -c 'import sys; print(sys.version_info[0])') -eq 2 ] && PYTHON=$p [ -z "$PYTHON" ] && [ $($p -c 'import sys; print(sys.version_info[0])') -eq 3 ] && PYTHON=$p
done done
if [ -z "$PYTHON" ]; then if [ -z "$PYTHON" ]; then
echo "ERROR: OGAgent needs Python 2" &>2 echo "ERROR: OGAgent needs Python 3" &>2
exit 1 exit 1
fi fi

View File

@ -1,10 +1,10 @@
#!/bin/sh #!/bin/sh
for p in python python2; do for p in python python3; do
[ -z "$PYTHON" ] && [ $($p -c 'import sys; print(sys.version_info[0])') -eq 2 ] && PYTHON=$p [ -z "$PYTHON" ] && [ $($p -c 'import sys; print(sys.version_info[0])') -eq 3 ] && PYTHON=$p
done done
if [ -z "$PYTHON" ]; then if [ -z "$PYTHON" ]; then
echo "ERROR: OGAgent needs Python 2" &>2 echo "ERROR: OGAgent needs Python 3" &>2
exit 1 exit 1
fi fi

View File

@ -28,13 +28,13 @@
function process { function process {
pyuic4 about-dialog.ui -o about_dialog_ui.py -x pyuic5 about-dialog.ui -o about_dialog_ui.py -x
pyuic4 message-dialog.ui -o message_dialog_ui.py -x pyuic5 message-dialog.ui -o message_dialog_ui.py -x
} }
cd $(dirname "$0") cd $(dirname "$0")
[ -r VERSION ] && sed -i "s/Version [^<]*/Version $(cat VERSION)/" about-dialog.ui [ -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 # process current directory ui's