Commit 7b7274e7 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Fix support for legacy systems

parent 4b766de1
......@@ -38,6 +38,21 @@ try:
except ImportError:
log.error('You must install speedometer first')
# Make sure the gui can import modules in the current directory
sys.path.insert(0, '.')
try:
import datamodel
except ImportError:
datamodel = None
try:
from PythonController import(OpenMsgQueueForReading,
GetMsgQueueBufferSize, DV, RetrieveMessageFromQueue)
python_controller = True
except ImportError:
python_controller = False
import resources
from mscHandler import mscHandler
......@@ -111,9 +126,6 @@ def gui():
# Exit app on Ctrl-C
signal.signal(signal.SIGINT, signal.SIG_DFL)
# Make sure the gui can import modules in the current directory
sys.path.insert(0, '.')
usage = 'usage: gui.py [--udp=IP_Address:in_Port:out_Port]'
version = 'taste auto-gui %s' % (__version__)
......@@ -154,9 +166,7 @@ def gui():
log.error('You entered ' + options.udp)
sys.exit(-1)
try:
import datamodel
except ImportError:
if not datamodel:
log.error('Could not import project data')
return -1
......@@ -164,13 +174,10 @@ def gui():
udp = None
dll = None
hasTM = False
if options.udp is None and options.shared_lib is None:
if not options.udp and not options.shared_lib:
# Default: use message queue
try:
from PythonController import(OpenMsgQueueForReading,
GetMsgQueueBufferSize, DV, RetrieveMessageFromQueue)
log.info('Using message queues to communicate')
except ImportError:
log.info('Using message queues to communicate')
if not python_controller:
log.error('Python module "PythonController" is missing')
return -1
elif options.udp:
......
......@@ -2,7 +2,7 @@
# Resource object code
#
# Created: Sun Nov 16 11:39:53 2014
# Created: Sun Nov 16 12:02:01 2014
# by: The Resource Compiler for PySide (Qt v4.8.6)
#
# WARNING! All changes made in this file will be lost!
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment