Beispiel #1
0
 def loadUIFile(self, filename):
     for path in [BlissFramework.getStdBricksPath()
                  ] + BlissFramework.getCustomBricksDirs():
         # modulePath = sys.modules[self.__class__.__module__].__file__
         # path = os.path.dirname(modulePath)
         if os.path.exists(os.path.join(path, filename)):
             return qtui.QWidgetFactory.create(os.path.join(path, filename))
Beispiel #2
0
 def loadUIFile(self, filename):
     for path in [
         BlissFramework.getStdBricksPath()
     ] + BlissFramework.getCustomBricksDirs():
         # modulePath = sys.modules[self.__class__.__module__].__file__
         # path = os.path.dirname(modulePath)
         if os.path.exists(os.path.join(path, filename)):
             return qtui.QWidgetFactory.create(os.path.join(path, filename))
Beispiel #3
0
 def loadUIFile(self, filename):
     """
     Descript. :
     """
     for path in [BlissFramework.getStdBricksPath()] + \
                  BlissFramework.getCustomBricksDirs():
         if os.path.exists(os.path.join(path, filename)):
             return qtui.QWidgetFactory.create(os.path.join(path, filename))
Beispiel #4
0
 def refresh(self):
     """Refresh bricks window"""
     while self.bricksToolbox.currentItem():
         self.bricksToolbox.removeItem(self.bricksToolbox.currentItem())
    
     self.bricks = {}
     self.bricksTab = {}
         
     self.addBrickTab("General")
     # bricks without category fall into 'General'
     self.bricksTab[""] = self.bricksTab["General"]
    
     map(self.addBricks, (BlissFramework.getStdBricksPath(), ) + tuple(BlissFramework.getCustomBricksDirs()))
Beispiel #5
0
 def refresh(self):
     """Refresh bricks window"""
     while self.bricksToolbox.currentItem():
         self.bricksToolbox.removeItem(self.bricksToolbox.currentItem())
    
     self.bricks = {}
     self.bricksTab = {}
         
     self.addBrickTab("General")
     # bricks without category fall into 'General'
     self.bricksTab[""] = self.bricksTab["General"]
    
     map(self.addBricks, (BlissFramework.getStdBricksPath(), ) + tuple(BlissFramework.getCustomBricksDirs()))
Beispiel #6
0
    def launchGUIClicked(self):
        if self.guiEditorWindow.configuration.hasChanged or self.filename is None:
            if qt.QMessageBox.warning(self, "GUI file not saved yet",
                                      "Before starting the GUI, the file needs to be saved.\nContinue ?",
                                      qt.QMessageBox.Yes, qt.QMessageBox.No) == qt.QMessageBox.No:
                return
            
            self.saveClicked()
            
        terminal = os.environ["TERM"] or "xterm"

        try:
            hwr_server = HardwareRepository.HardwareRepository().serverAddress
        except:
            logging.getLogger().error("Sorry, could not find Hardware Repository server")
        else:
            customBricksDirs = os.path.pathsep.join(BlissFramework.getCustomBricksDirs())
            pid = subprocess.Popen("%s -title %s -e startGUI --bricksDirs=%s %s%s" % (terminal,os.path.basename(self.filename),customBricksDirs, (hwr_server and "--hardwareRepository=%s " % hwr_server or ""), self.filename), shell=True).pid
            
            logging.getLogger().debug("GUI launched, pid is %d", pid)
Beispiel #7
0
    def launchGUIClicked(self):
        if self.guiEditorWindow.configuration.hasChanged or self.filename is None:
            if qt.QMessageBox.warning(self, "GUI file not saved yet",
                                      "Before starting the GUI, the file needs to be saved.\nContinue ?",
                                      qt.QMessageBox.Yes, qt.QMessageBox.No) == qt.QMessageBox.No:
                return
            
            self.saveClicked()
            
        terminal = os.environ["TERM"] or "xterm"

        try:
            hwr_server = HardwareRepository.HardwareRepository().serverAddress
        except:
            logging.getLogger().error("Sorry, could not find Hardware Repository server")
        else:
            customBricksDirs = os.path.pathsep.join(BlissFramework.getCustomBricksDirs())
            pid = subprocess.Popen("%s -title %s -e startGUI --bricksDirs=%s %s%s" % (terminal,os.path.basename(self.filename),customBricksDirs, (hwr_server and "--hardwareRepository=%s " % hwr_server or ""), self.filename), shell=True).pid
            
            logging.getLogger().debug("GUI launched, pid is %d", pid)