def load_commit_report(self):
        """Load new CommitReport from file_path."""
        options = QFileDialog.Options()
        options |= QFileDialog.DontUseNativeDialog
        file_paths, _ = QFileDialog.getOpenFileNames(
            self,
            "Load CommitReport file",
            "",
            "Yaml Files (*.yaml *.yml);;All Files (*)",
            options=options
        )

        for file_path in file_paths:
            if not path.isfile(file_path):
                err = QMessageBox()
                err.setIcon(QMessageBox.Warning)
                err.setWindowTitle("File not found.")
                err.setText("Could not find selected file.")
                err.setStandardButtons(QMessageBox.Ok)
                err.exec_()
                return

            if not (file_path.endswith(".yaml") or file_path.endswith(".yml")):
                err = QMessageBox()
                err.setIcon(QMessageBox.Warning)
                err.setWindowTitle("Wrong File ending.")
                err.setText("File seems not to be a yaml file.")
                err.setStandardButtons(QMessageBox.Ok)
                err.exec_()
                return

        for file_path in file_paths:
            skip = False
            for current_report in self.commit_reports:
                # skip files that were loaded bevor
                if current_report.path == file_path:
                    skip = True
                    continue
            if skip:
                continue
            self.loading_files += 1
            self.statusLabel.setText(
                "Loading files... " + str(self.loading_files)
            )
            VDM.load_data_class(
                file_path, CommitReport, self._set_new_commit_report
            )
Exemple #2
0
def load_pydriller_szz_report(file_path: Path) -> SZZReport:
    """
    Load a PyDrillerSZZReport from a file.

    Attributes:
        file_path (Path): Full path to the file
    """
    return VDM.load_data_class_sync(file_path, PyDrillerSZZReport)
Exemple #3
0
def load_szzunleashed_report(file_path: Path) -> SZZReport:
    """
    Load a SZZUnleashedReport from a file.

    Attributes:
        file_path (Path): Full path to the file
    """
    return VDM.load_data_class_sync(file_path, SZZUnleashedReport)
Exemple #4
0
def load_blame_report(file_path: Path) -> BlameReport:
    """
    Load a BlameReport from a file.

    Attributes:
        file_path (Path): Full path to the file
    """
    return VDM.load_data_class_sync(file_path, BlameReport)
Exemple #5
0
def load_commit_report(file_path: Path) -> CommitReport:
    """
    Load a CommitReport from a file.

    Attributes:
        file_path (Path): Full path to the file
    """
    return VDM.load_data_class_sync(file_path, CommitReport)
Exemple #6
0
def load_globals_with_report(file_path: Path) -> \
        GlobalsReportWith:
    """
    Load a GlobalsReportWith from a file.

    Attributes:
        file_path (Path): Full path to the file
    """
    return VDM.load_data_class_sync(file_path, GlobalsReportWith)
Exemple #7
0
def load_blame_verifier_report_opt(file_path: Path) -> \
        BlameVerifierReportOpt:
    """
    Load a BlameVerifierReportOpt from a file.

    Attributes:
        file_path (Path): Full path to the file
    """
    return VDM.load_data_class_sync(file_path, BlameVerifierReportOpt)
Exemple #8
0
def load_feature_analysis_report(file_path: Path) -> \
        FeatureAnalysisReport:
    """
    Load a FeatureAnalysisReport from a file.

    Attributes:
        file_path (Path): Full path to the file
    """
    return VDM.load_data_class_sync(file_path, FeatureAnalysisReport)