forked from shaba/openuds
Merge remote-tracking branch 'origin/v1.9'
This commit is contained in:
commit
f6492256a8
@ -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):
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user