Beispiel #1
0
 def currentProject(self):
     """Returns the current project, updating from the git repo if no
     project currently found"""
     if not self._currentProject:
         # Check for project
         try:
             project = getProject(str(self.currentFile))
             if hasattr(project, 'id'):
                 self._currentProject = project.id
         except NotADirectoryError as err:
             self.stdoutCtrl.write(err)
     return self._currentProject
Beispiel #2
0
    def onItemSelected(self, evt):
        """Set currentSelection to index of currently selected list item."""
        self.currentSelection = evt.Index
        self.currentFile = Path(
            self.expCtrl.GetItem(self.currentSelection, 1).Text)
        self.currentExperiment = self.experiment()
        self.currentProject = None

        # Check for project
        try:
            project = getProject(str(self.currentFile))
            if hasattr(project, 'id'):
                self.currentProject = project.id
        except NotADirectoryError as err:
            self.stdoutCtrl.write(err)