コード例 #1
0
ファイル: actions.py プロジェクト: emayssat/python-eggs
    def on_fileOpenAction_triggered(self):
        fileName = "%s" % QFileDialog.getOpenFileName(self.parent(), "Tabbed Feedbacks -- Open File")
        config = ConfigParser.ConfigParser()
        config.read(fileName)
        for section in config.sections():
            if re.match("^(.*)/(LOneVariableFeedbackComposite)/(.*)$", section):
                match = re.match("^(.*)/(LOneVariableFeedbackComposite)/(.*)$", section)
                item = LMyItem()
                item.setName(match.group(1))
                item.setCompositeClassName(match.group(2))
                item.setVersion(match.group(3))
                debug(self, "Found section %s" % match.group(0), 3)
                item.setConfigurationFile(fileName)
                item.buildComposite()
                item.loadCompositeConfiguration()
                self.dataContainer.feedbacks.append(item)
            if re.match("^(.*)/(LXVariableFeedbackComposite)/(.*)$", section):
                match = re.match("^(.*)/(LXVariableFeedbackComposite)/(.*)$", section)
                item = LMyItem()
                item.setName(match.group(1))
                item.setCompositeClassName(match.group(2))
                item.setVersion(match.group(3))
                debug(self, "Found section %s" % match.group(0), 3)
                item.setConfigurationFile(fileName)
                item.buildComposite()
                item.loadCompositeConfiguration()
                self.dataContainer.feedbacks.append(item)
        self.parent().updateUi()

        tabWidget = self.parent().tabWidget
        numberOfTabs = tabWidget.count()
        lastTabIndex = numberOfTabs - 1
        tabWidget.setCurrentIndex(lastTabIndex)
        debug(self, "Jump to tab %d" % lastTabIndex, 5)