Commit 7f8bb920 authored by Thanassis Tsiodras's avatar Thanassis Tsiodras
parents 7e94b03b ecf56fda
Subproject commit b05bb19ffd8d213e53f1f273e0b58ffa4b087692 Subproject commit fe4253f5e42dc6bc8c9c6aa6a9f177667d3861e9
...@@ -7,51 +7,46 @@ from PySide.QtGui import (QApplication, ...@@ -7,51 +7,46 @@ from PySide.QtGui import (QApplication,
QMessageBox) QMessageBox)
def install_gr740_rtems410_gaisler_posix(): def install_gr740_rtems410_gaisler_posix():
print 'Installing this nice target' """ $ /home/taste/tool-src/add-ons/install-gaisler-4.10.sh """
os.system("xterm -e $HOME/tool-src/add-ons/install-gaisler-4.10.sh")
def check_gr740_rtems410_gaisler_posix(): def check_gr740_rtems410_gaisler_posix():
if not os.path.isdir("/opt/rtems-4.10"): if not os.path.isdir("/opt/rtems-4.10"):
raise NotImplementedError(install_gr740_rtems410_gaisler_posix) raise NotImplementedError(install_gr740_rtems410_gaisler_posix)
# When editing, replace dot (.) with underscore (_)
PLATFORMS = { "crazyflie_v2.gnat" : lambda: True, # the TASTE GUI mixes them up if there is more than one underscore
"stm32f4_discovery.gnat" : lambda: True, PLATFORMS = { "crazyflie_v2_gnat" : lambda: True,
"leon.rtems_posix" : lambda: True, "stm32f4_discovery_gnat" : lambda: True,
"leon2.rtems412_posix" : lambda: True, "leon_rtems_posix" : lambda: True,
"leon3.rtems412_posix" : lambda: True, "leon2_rtems412_posix" : lambda: True,
"gr712.rtems412_posix" : lambda: True, "leon3_rtems412_posix" : lambda: True,
"gr740.rtems412_posix" : lambda: True, "gr712_rtems412_posix" : lambda: True,
"gr740.rtems410_gaisler_posix" : "gr740_rtems412_posix" : lambda: True,
"gr740_rtems410_gaisler_posix" :
check_gr740_rtems410_gaisler_posix, check_gr740_rtems410_gaisler_posix,
"x86.linux" : lambda: True, "x86_linux" : lambda: True,
"x86.win32" : lambda: True "x86_win32" : lambda: True
} }
def query_user(platform): def query_user(platform):
msg_box = QMessageBox() msg_box = QMessageBox()
msg_box.setWindowTitle("This plaform is not installed!") msg_box.setWindowTitle("This plaform is not installed!")
ok = msg_box.addButton("Install now", QMessageBox.AcceptRole) ok = msg_box.addButton("Install now", QMessageBox.AcceptRole)
later = msg_box.addButton("Install later", QMessageBox.RejectRole) later = msg_box.addButton("Install later", QMessageBox.RejectRole)
msg_box.setEscapeButton(later) msg_box.setEscapeButton(later)
msg_box.setDefaultButton(ok) msg_box.setDefaultButton(ok)
msg_box.setIcon(QMessageBox.Warning) msg_box.setIcon(QMessageBox.Warning)
msg_box.setText("Do you want to install target\n{} ?".format(platform)) msg_box.setText("Do you want to install target\n{} ?".format(platform))
msg_box.exec_() msg_box.exec_()
if msg_box.clickedButton() == ok: return msg_box.clickedButton() == ok
return True
else:
warn_box = QMessageBox()
warn_box.setIcon(QMessageBox.Information)
warn_box.setText("You can install the platform later, manually")
warn_box.exec_()
return False
def main(): def main():
app = QApplication(sys.argv) app = QApplication(sys.argv)
# check if the target in supported # check if the target in supported
try: try:
platform = sys.argv[1] platform = sys.argv[1]
PLATFORMS[platform]() PLATFORMS[platform.replace('.', '_')]()
except KeyError: except KeyError:
warn_box = QMessageBox() warn_box = QMessageBox()
warn_box.setIcon(QMessageBox.Information) warn_box.setIcon(QMessageBox.Information)
...@@ -64,6 +59,13 @@ def main(): ...@@ -64,6 +59,13 @@ def main():
install_it, = exc.args install_it, = exc.args
if query_user(platform): if query_user(platform):
install_it() install_it()
else:
warn_box = QMessageBox()
warn_box.setIcon(QMessageBox.Information)
warn_box.setText("You can install the platform later by typing:\n"
+ str(install_it.__doc__))
warn_box.exec_()
else: else:
print("Platform {} is installed".format(platform)) print("Platform {} is installed".format(platform))
sys.exit(0) sys.exit(0)
......
Markdown is supported
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