Merge remote-tracking branch 'origin/v1.9'

This commit is contained in:
Adolfo Gómez García 2015-11-19 11:49:21 +01:00
commit f6492256a8
3 changed files with 8 additions and 1 deletions

View File

@ -143,6 +143,7 @@ class UDSClient(QtGui.QMainWindow):
@QtCore.pyqtSlot(dict)
def transportDataReceived(self, data):
logger.debug('Transport data received')
try:
self.processError(data)
@ -166,6 +167,7 @@ class UDSClient(QtGui.QMainWindow):
QtCore.QTimer.singleShot(10000, self.getTransportData)
except Exception as e:
logger.exception('Got exception executing script:')
self.showError(e)
def endScript(self):

View File

@ -36,7 +36,7 @@ import os
import tempfile
logging.basicConfig(
filename=os.path.join(tempfile.gettempdir(), 'udsclient.log'),
filename=os.path.join(tempfile.gettempdir(), b'udsclient.log'),
filemode='a',
format='%(levelname)s %(asctime)s %(message)s',
level=logging.INFO

View File

@ -39,6 +39,7 @@ import os
import socket
import stat
import six
import sys
_unlinkFiles = []
_tasksToWait = []
@ -49,6 +50,8 @@ def saveTempFile(content, filename=None):
if filename is None:
filename = ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(16))
filename = filename + '.uds'
if 'win32' in sys.platform:
filename = filename.encode('utf-8')
filename = os.path.join(tempfile.gettempdir(), filename)
with open(filename, 'w') as f:
f.write(content)
@ -57,6 +60,8 @@ def saveTempFile(content, filename=None):
def findApp(appName, extraPath=None):
if 'win32' in sys.platform and isinstance(appName, six.text_type):
appName = six.binary_type(appName)
searchPath = os.environ['PATH'].split(os.pathsep)
if extraPath is not None:
searchPath += list(extraPath)