diff python/ide.py @ 131:04e45faafd1d

Added register view
author Windel Bouwman
date Sat, 19 Jan 2013 18:41:49 +0100
parents 654093a9a1e3
children 9af544be5d2a
line wrap: on
line diff
--- a/python/ide.py	Sat Jan 19 18:16:04 2013 +0100
+++ b/python/ide.py	Sat Jan 19 18:41:49 2013 +0100
@@ -1,9 +1,7 @@
 #!/usr/bin/python
 
 import sys, os, base64
-if sys.version_info.major != 3:
-   print("Needs to be run in python version 3.x")
-   sys.exit(1)
+assert sys.version_info.major == 3, "Needs to be run in python version 3.x"
 
 from PyQt4.QtCore import *
 from PyQt4.QtGui import *
@@ -13,6 +11,7 @@
 import ppci
 from astviewer import AstViewer
 from codeeditor import CodeEdit
+stutil = __import__('st-util')
 
 lcfospng = base64.decodestring(b'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A\n/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJEhMKBk7B678AAAA/SURBVFjD\n7dbBCQAgDATBi9h/y7EFA4Kf2QLCwH1S6XQu6sqoujublc8BAAAAAAAAAAB8B+zXT6YJAAAAAKYd\nWSgFQNUyijIAAAAASUVORK5CYII=\n')
 
@@ -149,6 +148,9 @@
     self.builderrors.sigErrorSelected.connect(self.errorSelected)
     self.projectview = addComponent('Project explorer', ProjectView())
     self.projectview.sigLoadFile.connect(self.loadFile)
+    self.devxplr = addComponent('Device explorer', stutil.DeviceExplorer())
+    self.regview = addComponent('Registers', stutil.RegisterView())
+    self.devxplr.deviceSelected.connect(self.regview.mdl.setDevice)
 
     # About dialog:
     self.aboutDialog = AboutDialog()