* Fixed version

* Moved actors to python3
This commit is contained in:
Adolfo Gómez García 2018-10-02 13:08:13 +02:00
parent a47df49ca8
commit d5be31f1d9
9 changed files with 30 additions and 32 deletions

View File

@ -1 +1 @@
2.2.0
2.2.1

View File

@ -1,3 +1,9 @@
udsactor (2.2.1) stable; urgency=medium
* Upgraded to 2.2.1 release
-- Adolfo Gómez García <agomez@virtualcable.es> Thu, 2 Oct 2018 12:44:12 +0200
udsactor (2.2.0) stable; urgency=medium
* Upgraded to 2.2.0 release

View File

@ -10,22 +10,7 @@ Package: udsactor
Section: admin
Priority: optional
Architecture: all
Depends: policykit-1(>=0.100), python-requests (>=0.8.2), python-qt4 (>=4.9), python-six(>=1.1), python-prctl(>=1.1.1), python (>=2.7), libxss1, xscreensaver, ${misc:Depends}
Depends: policykit-1(>=0.100), python3-requests (>=0.8.2), python3-qt4 (>=4.9), python3-six(>=1.1), python3-prctl(>=1.1.1), python3 (>=3.4), libxss1, xscreensaver, ${misc:Depends}
Description: Actor for Universal Desktop Services (UDS) Broker
This package provides the required components to allow this machine to work on an environment managed by UDS Broker.
Package: udsactor-xrdp
Section: x11
Priority: optional
Architecture: all
Depends: xrdp (>= 0.5.0), udsactor (>= ${binary:Version}), libpam-modules-bin (>=1.0), ${misc:Depends}
Description: UDS Actor component for xrdp
This package provides connection between uds actor and xrdp
Package: udsactor-nx
Section: x11
Priority: optional
Architecture: all
Depends: nxnode (>= 3.5.0), udsactor (>= ${binary:Version}), ${misc:Depends}
Description: UDS Actor component for nx
This package provides connection between uds actor and nx

View File

@ -3,4 +3,4 @@
FOLDER=/usr/share/UDSActor
cd $FOLDER
python2.7 -m udsactor.linux.UDSActorService $@
exec python3 -m udsactor.linux.UDSActorService $@

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2.7
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2014 Virtual Cable S.L.
@ -93,6 +93,7 @@ class UDSConfigDialog(QtGui.QDialog):
store.writeConfig(cfg)
self.close()
if __name__ == "__main__":
# If to be run as "sudo" on linux, we will need this to avoid problems

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2.7
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2014 Virtual Cable S.L.
@ -39,6 +39,7 @@ import pickle
import time
import datetime
import signal
import six
from udsactor import ipc
from udsactor import utils
from udsactor.log import logger
@ -90,8 +91,8 @@ class UDSMessageDialog(QtGui.QDialog):
class MessagesProcessor(QtCore.QThread):
logoff = QtCore.pyqtSignal(name='logoff')
displayMessage = QtCore.pyqtSignal(QtCore.QString, name='displayMessage')
script = QtCore.pyqtSignal(QtCore.QString, name='script')
displayMessage = QtCore.pyqtSignal(six.text_type, name='displayMessage')
script = QtCore.pyqtSignal(six.text_type, name='script')
exit = QtCore.pyqtSignal(name='exit')
information = QtCore.pyqtSignal(dict, name='information')
@ -147,11 +148,11 @@ class MessagesProcessor(QtCore.QThread):
msgId, data = msg
logger.debug('Got Message on User Space: {}:{}'.format(msgId, data))
if msgId == ipc.MSG_MESSAGE:
self.displayMessage.emit(QtCore.QString.fromUtf8(data))
self.displayMessage.emit(data)
elif msgId == ipc.MSG_LOGOFF:
self.logoff.emit()
elif msgId == ipc.MSG_SCRIPT:
self.script.emit(QtCore.QString.fromUtf8(data))
self.script.emit(data)
elif msgId == ipc.MSG_INFORMATION:
self.information.emit(pickle.loads(data))
except Exception as e:

View File

@ -101,6 +101,7 @@ def ensureResultIsOk(result):
class Api(object):
def __init__(self, host, masterKey, ssl):
self.host = host
self.masterKey = masterKey
@ -201,6 +202,8 @@ class Api(object):
raise ConnectionError('REST api has not been initialized')
if processData:
if not isinstance(data, six.text_type):
data = data.decode('utf8')
data = json.dumps({'data': data})
url = self._getUrl('/'.join([self.uuid, msg]))
return self._request(url, data)['result']

View File

@ -34,21 +34,22 @@ from __future__ import unicode_literals
# On centos, old six release does not includes byte2int, nor six.PY2
import six
VERSION = '2.2.0'
VERSION = '2.2.1'
__title__ = 'udsactor'
__version__ = VERSION
__build__ = 0x010755
__build__ = 0x010756
__author__ = 'Adolfo Gómez <dkmaster@dkmon.com>'
__license__ = "BSD 3-clause"
__copyright__ = "Copyright 2014-2017 VirtualCable S.L.U."
__copyright__ = "Copyright 2014-2018 VirtualCable S.L.U."
if not hasattr(six, 'byte2int'):
if six.PY3:
import operator
six.byte2int = operator.itemgetter(0)
else:
def _byte2int(bs):
return ord(bs[0])
six.byte2int = _byte2int

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2014 Virtual Cable S.L.
# Copyright (c) 2014-2018 Virtual Cable S.L.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
@ -46,6 +46,7 @@ class Daemon:
Usage: subclass the Daemon class and override the run() method
"""
def __init__(self, pidfile, stdin='/dev/null', stdout='/dev/null', stderr='/dev/null'):
self.stdin = stdin
self.stdout = stdout
@ -88,8 +89,8 @@ class Daemon:
sys.stdout.flush()
sys.stderr.flush()
si = open(self.stdin, 'r')
so = open(self.stdout, 'a+')
se = open(self.stderr, 'a+', 0)
so = open(self.stdout, 'ab+')
se = open(self.stderr, 'ab+', 0)
os.dup2(si.fileno(), sys.stdin.fileno())
os.dup2(so.fileno(), sys.stdout.fileno())
os.dup2(se.fileno(), sys.stderr.fileno())