Ejemplo n.º 1
0
    def browseExpData(self):
        """
        Shows a file open dialog.
        """

        homeDir = filehelpers.getHomeDir()
        openDir = self.currentExpDataFilename if self.currentExpDataFilename else homeDir
        filenameTuple = QFileDialog.getOpenFileName(parent=self,
                                               caption="Browse for data file...",
                                               directory=openDir,
                                               filter="BioPARKIN CSV data file (*.csv *.txt);;Legacy PARKIN data file (*.dat);;All filetypes (*.*")

        self.setCurrentExpDataDirectory(filenameTuple[0])
Ejemplo n.º 2
0
    def browseExpData(self):
        """
        Shows a file open dialog.
        """

        homeDir = filehelpers.getHomeDir()
        openDir = self.currentExpDataFilename if self.currentExpDataFilename else homeDir
        filenameTuple = QFileDialog.getOpenFileName(
            parent=self,
            caption="Browse for data file...",
            directory=openDir,
            filter=
            "BioPARKIN CSV data file (*.csv *.txt);;Legacy PARKIN data file (*.dat);;All filetypes (*.*"
        )

        self.setCurrentExpDataDirectory(filenameTuple[0])
Ejemplo n.º 3
0
    def on_actionOpen_triggered(self):
        """
        This is a slot. It's automatically connected to the actionOpen
        created in the QtDesigner.
        """
        homeDir = filehelpers.getHomeDir()

        filenameTuple = QFileDialog.getOpenFileName(parent=self,
                                               directory=homeDir,
                                               filter="SBML files (*.sbml *.xml)",
                                               caption="Open SBML file...")

        if filenameTuple and filenameTuple[0]: # if user presses cancel, the tuple exists but is two empty unicode strings.
            filename = filenameTuple[0]
            self.load_model(filename)
        else:
            logging.info("No file selected. Didn't load anything.")