Removed six dependency for client-py3 and related

This commit is contained in:
Adolfo Gómez García 2021-06-09 12:39:06 +02:00
parent 44d8b2b754
commit 9e462478fc
3 changed files with 8 additions and 15 deletions

View File

@ -10,6 +10,6 @@ Package: udsclient3
Section: admin Section: admin
Priority: optional Priority: optional
Architecture: all Architecture: all
Depends: python3-paramiko (>=2.0.0), python3-cryptography, python3-pyqt5 (>=5.0), python3-six(>=1.1), python3 (>=3.6), freerdp2-x11 | freerdp-x11 | freerdp-nightly, desktop-file-utils, ${misc:Depends} Depends: python3-paramiko (>=2.0.0), python3-cryptography, python3-pyqt5 (>=5.0), python3 (>=3.6), freerdp2-x11 | freerdp-x11 | freerdp-nightly, desktop-file-utils, ${misc:Depends}
Description: Client connector for Universal Desktop Services (UDS) Broker Description: Client connector for Universal Desktop Services (UDS) Broker
This package provides the required components to allow this machine to connect to services provided by UDS Broker. This package provides the required components to allow this machine to connect to services provided by UDS Broker.

View File

@ -11,7 +11,7 @@ Release: %{release}
Summary: Client for Universal Desktop Services (UDS) Broker Summary: Client for Universal Desktop Services (UDS) Broker
License: BSD3 License: BSD3
Group: Applications/Productivity Group: Applications/Productivity
Requires: python3-six python3-requests python3-paramiko python3-qt5 python3-cryptography Requires: python3-requests python3-paramiko python3-qt5 python3-cryptography
Vendor: Virtual Cable S.L.U. Vendor: Virtual Cable S.L.U.
URL: http://www.udsenterprise.com URL: http://www.udsenterprise.com
Provides: udsclient Provides: udsclient

View File

@ -36,7 +36,6 @@ import json
import base64, bz2 import base64, bz2
from PyQt5 import QtCore, QtGui, QtWidgets # @UnresolvedImport from PyQt5 import QtCore, QtGui, QtWidgets # @UnresolvedImport
import six
from uds.rest import RestRequest from uds.rest import RestRequest
from uds.forward import forward # pylint: disable=unused-import from uds.forward import forward # pylint: disable=unused-import
@ -222,10 +221,10 @@ class UDSClient(QtWidgets.QMainWindow):
QtCore.QTimer.singleShot(3000, self.endScript) QtCore.QTimer.singleShot(3000, self.endScript)
self.hide() self.hide()
six.exec_(script.decode("utf-8"), globals(), {'parent': self, 'sp': params}) exec(script.decode("utf-8"), globals(), {'parent': self, 'sp': params})
except RetryException as e: except RetryException as e:
self.ui.info.setText(six.text_type(e) + ', retrying access...') self.ui.info.setText(str(e) + ', retrying access...')
# Retry operation in ten seconds # Retry operation in ten seconds
QtCore.QTimer.singleShot(10000, self.getTransportData) QtCore.QTimer.singleShot(10000, self.getTransportData)
@ -260,8 +259,8 @@ class UDSClient(QtWidgets.QMainWindow):
QtCore.QTimer.singleShot(100, self.getVersion) QtCore.QTimer.singleShot(100, self.getVersion)
def done(data): def done(data) -> None:
QtWidgets.QMessageBox.critical(None, 'Notice', six.text_type(data.data), QtWidgets.QMessageBox.Ok) # type: ignore QtWidgets.QMessageBox.critical(None, 'Notice', str(data.data), QtWidgets.QMessageBox.Ok) # type: ignore
sys.exit(0) sys.exit(0)
@ -298,13 +297,7 @@ if __name__ == "__main__":
if 'darwin' not in sys.platform: if 'darwin' not in sys.platform:
logger.debug('Mac OS *NOT* Detected') logger.debug('Mac OS *NOT* Detected')
app.setStyle('plastique') app.setStyle('plastique') # type: ignore
if six.PY3 is False:
logger.debug('Fixing threaded execution of commands')
import threading
threading._DummyThread._Thread__stop = lambda x: 42 # type: ignore # pylint: disable=protected-access
# First parameter must be url # First parameter must be url
try: try:
@ -360,7 +353,7 @@ if __name__ == "__main__":
logger.exception('Got an exception executing client:') logger.exception('Got an exception executing client:')
exitVal = 128 exitVal = 128
QtWidgets.QMessageBox.critical( QtWidgets.QMessageBox.critical(
None, 'Error', six.text_type(e), QtWidgets.QMessageBox.Ok # type: ignore None, 'Error', str(e), QtWidgets.QMessageBox.Ok # type: ignore
) )
logger.debug('Exiting') logger.debug('Exiting')