Ejemplo n.º 1
0
    def ShowProcessUtils(self):

        SERVICE_NAME = "editor"
        self.editor_service = self.locator.get_service(SERVICE_NAME)
        fullFileName = self.editor_service.get_editor_path()

        try:  # check if .nja file exists
            filePath = os.path.split(fullFileName)[0]
            fileName = os.path.split(fullFileName)[1]
            #print os.path.splitext(fileName)[1]
            self.jsonfile = json_manager.read_json(
                filePath + os.sep +
                fileName.replace(os.path.splitext(fileName)[1], ".nja"))
            #filetoparse = filePath + os.sep + fileName.replace("py", "nja")
            self.ocrdata = self.jsonfile["ocrdatafolder"]
        except:
            self.message = QMessageBox.critical(
                self.editor_service.get_editor(), 'Error',
                "You can use this button only on an Al'exa Project!",
                QMessageBox.Ok)
            return
        self.processUtils = ProcessUtils(self)
        self.processUtils.show()