コード例 #1
0
    def save_stylesheet(self):
        try:
            file_name = "%s.qss" % self.line_name.text()
            if not self._is_valid_scheme_name(file_name):
                QMessageBox.information(self,
                                        translations.TR_PREFERENCES_THEME,
                                        translations.TR_SCHEME_INVALID_NAME)
            file_name = ('{0}.qss'.format(
                file_manager.create_path(resources.NINJA_THEME_DOWNLOAD,
                                         file_name)))
            content = self.edit_qss.toPlainText()
            answer = True
            if file_manager.file_exists(file_name):
                answer = QMessageBox.question(
                    self, translations.TR_PREFERENCES_THEME,
                    translations.TR_WANT_OVERWRITE_FILE +
                    ": {0}?".format(file_name), QMessageBox.Yes,
                    QMessageBox.No)

            if answer in (QMessageBox.Yes, True):
                self.apply_stylesheet()
                file_manager.store_file_content(file_name,
                                                content,
                                                newFile=True)
                self.close()
        except file_manager.NinjaFileExistsException as ex:
            QMessageBox.information(
                self, self.tr("File Already Exists"),
                (self.tr("Invalid File Name: the file '%s' already exists.") %
                 ex.filename))
コード例 #2
0
ファイル: helloworld.py プロジェクト: freason/enki
    def __init__(self):
        QMessageBox.information(core.mainWindow(), "Hello, world", "Plugin loaded")
        self._addAction()
        self._createDock()
        self._readSettings()

        core.workspace().currentDocumentChanged.connect(self._onDocumentChanged)

        core.uiSettingsManager().dialogAccepted.connect(self._applySettings)
        core.uiSettingsManager().aboutToExecute.connect(self._onSettingsDialogAboutToExecute)
コード例 #3
0
 def _install_external(self):
     """Install external plugins"""
     if self._link.text().isEmpty():
         QMessageBox.information(self, translations.TR_EXTERNAL_PLUGIN,
                                 translations.TR_URL_IS_MISSING + "...")
         return
     plug = [
         file_manager.get_module_name(str(self._link.text())),
         'External Plugin', '1.0',
         str(self._link.text())
     ]
     self.parent().download_plugins(plug)
     self._link.setText('')
コード例 #4
0
    def __init__(self):
        QMessageBox.information(core.mainWindow(), "Hello, world",
                                "Plugin loaded")
        self._addAction()
        self._createDock()
        self._readSettings()

        core.workspace().currentDocumentChanged.connect(
            self._onDocumentChanged)

        core.uiSettingsManager().dialogAccepted.connect(self._applySettings)
        core.uiSettingsManager().aboutToExecute.connect(
            self._onSettingsDialogAboutToExecute)
コード例 #5
0
ファイル: __main__.py プロジェクト: hrnciar/enki
def _showErrorMessage(haveQt, header, html, plain):
    """Show error message with messagebox
    """
    print(header, file=sys.stderr)
    print(plain, file=sys.stderr)
    if haveQt:
        from PyQt5.QtGui import QApplication, QMessageBox
        app = QApplication(sys.argv)
        QMessageBox.critical(None, header, html)
    else:
        try:
            import tkinter.messagebox
        except ImportError:
            return
        tkinter.messagebox.showwarning(header, plain)
コード例 #6
0
ファイル: __main__.py プロジェクト: bjones1/enki
def _showErrorMessage(haveQt, header, html, plain):
    """Show error message with messagebox
    """
    print(header, file=sys.stderr)
    print(plain, file=sys.stderr)
    if haveQt:
        from PyQt5.QtGui import QApplication, QMessageBox
        app = QApplication(sys.argv)
        QMessageBox.critical(None, header, html)
    else:
        try:
            import tkinter.messagebox
        except ImportError:
            return
        tkinter.messagebox.showwarning(header, plain)
コード例 #7
0
    def __validate_shortcut(self, keysequence):
        """
        Validate a shortcut
        """
        if keysequence.isEmpty():
            return True

        keyname = self.result_widget.currentItem().text(0)
        keystr = keysequence

        for top_index in range(self.result_widget.topLevelItemCount()):
            top_item = self.result_widget.topLevelItem(top_index)

            if top_item.text(0) != keyname:
                itmseq = top_item.text(1)
                if keystr == itmseq:
                    val = QMessageBox.warning(
                        self, translations.TR_SHORTCUT_ALREADY_ON_USE,
                        translations.TR_DO_YOU_WANT_TO_REMOVE, QMessageBox.Yes,
                        QMessageBox.No)
                    if val == QMessageBox.Yes:
                        top_item.setText(1, "")
                        return True
                    else:
                        return False
                if not itmseq:
                    continue

        return True
コード例 #8
0
ファイル: __init__.py プロジェクト: brownian/frescobaldi
 def printMusic(self):
     doc = self.actionCollection.music_document_select.currentDocument()
     if doc and doc.document():
         ### temporarily disable printing on Mac OS X
         import sys
         if sys.platform.startswith('darwin'):
             from PyQt5.QtCore import QUrl
             from PyQt5.QtGui import QMessageBox
             result =  QMessageBox.warning(self.mainwindow(),
                 _("Print Music"), _(
                 "Unfortunately, this version of Frescobaldi is unable to print "
                 "PDF documents on Mac OS X due to various technical reasons.\n\n"
                 "Do you want to open the file in the default viewer for printing instead? "
                 "(remember to close it again to avoid access problems)\n\n"
                 "Choose Yes if you want that, No if you want to try the built-in "
                 "printing functionality anyway, or Cancel to cancel printing."),
                 QMessageBox.Yes | QMessageBox.No | QMessageBox.Cancel)
             if result == QMessageBox.Yes:
                 import helpers
                 helpers.openUrl(QUrl.fromLocalFile(doc.filename()), "pdf")
                 return
             elif result == QMessageBox.Cancel:
                 return
         ### end temporarily disable printing on Mac OS X
         import popplerprint
         popplerprint.printDocument(doc, self)
コード例 #9
0
ファイル: uimain.py プロジェクト: lycying/seeking
    def __evt_close_tab_click(self, index):
        """
        because the first tab is the main window we'll show 
        so we never close it .
        If the tab's content need save , we also remind the user.
        """
        if 0 == index: return

        if hasattr(self.widget(index),
                   "bufferon") and self.widget(index).bufferon():

            reply = QMessageBox.question(
                self, "Save or not?",
                "Save your content first?\n%s" % self.tabText(index),
                QMessageBox.Yes | QMessageBox.No | QMessageBox.Cancel)
            if reply == QMessageBox.Yes:
                if hasattr(self.widget(index), "save"):
                    self.widget(index).save()
                    self.removeTab(index)
                    Seeking().new().emit(SIGNAL('updateWindows()'))
                    return "yes"
            elif reply == QMessageBox.No:
                self.removeTab(index)
                Seeking().new().emit(SIGNAL('updateWindows()'))
                return "no"
            elif reply == QMessageBox.Cancel:
                return "cancel"
        else:
            self.removeTab(index)
            Seeking().new().emit(SIGNAL('updateWindows()'))
            return "yes"
コード例 #10
0
ファイル: uimain.py プロジェクト: lycying/seeking
 def __evt_close_tab_click(self,index):
     """
     because the first tab is the main window we'll show 
     so we never close it .
     If the tab's content need save , we also remind the user.
     """
     if 0 == index :return
     
     if hasattr(self.widget(index),"bufferon") and  self.widget(index).bufferon():
         
             reply = QMessageBox.question(self, "Save or not?",
                 "Save your content first?\n%s" % self.tabText(index),
                 QMessageBox.Yes | QMessageBox.No | QMessageBox.Cancel)
             if reply == QMessageBox.Yes:
                 if hasattr(self.widget(index),"save"):
                     self.widget(index).save()
                     self.removeTab(index)
                     Seeking().new().emit(SIGNAL('updateWindows()'))
                     return "yes"
             elif reply == QMessageBox.No:
                 self.removeTab(index)
                 Seeking().new().emit(SIGNAL('updateWindows()'))
                 return "no"
             elif reply == QMessageBox.Cancel:
                 return "cancel"
     else:
             self.removeTab(index)
             Seeking().new().emit(SIGNAL('updateWindows()'))
             return "yes"
コード例 #11
0
 def printMusic(self):
     doc = self.actionCollection.music_document_select.currentDocument()
     if doc and doc.document():
         ### temporarily disable printing on Mac OS X
         import sys
         if sys.platform.startswith('darwin'):
             from PyQt5.QtCore import QUrl
             from PyQt5.QtGui import QMessageBox
             result = QMessageBox.warning(
                 self.mainwindow(), _("Print Music"),
                 _("Unfortunately, this version of Frescobaldi is unable to print "
                   "PDF documents on Mac OS X due to various technical reasons.\n\n"
                   "Do you want to open the file in the default viewer for printing instead? "
                   "(remember to close it again to avoid access problems)\n\n"
                   "Choose Yes if you want that, No if you want to try the built-in "
                   "printing functionality anyway, or Cancel to cancel printing."
                   ), QMessageBox.Yes | QMessageBox.No | QMessageBox.Cancel)
             if result == QMessageBox.Yes:
                 import helpers
                 helpers.openUrl(QUrl.fromLocalFile(doc.filename()), "pdf")
                 return
             elif result == QMessageBox.Cancel:
                 return
         ### end temporarily disable printing on Mac OS X
         import popplerprint
         popplerprint.printDocument(doc, self)
コード例 #12
0
ファイル: statemanager.py プロジェクト: vdemir/pisi-2.0
    def conflictCheckPasses(self, packages):
        (C, D, pkg_conflicts) = self.iface.getConflicts(packages, self.state)

        conflicts_within = list(D)
        if conflicts_within:
            text = i18n("Selected packages [%1] are in conflict with each other. These packages can not be installed together.", ", ".join(conflicts_within))
            QMessageBox.critical(None, i18n("Conflict Error"), text, QMessageBox.Ok)
            return False

        if pkg_conflicts:
            text = i18n("The following packages conflicts:\n")
            for pkg in pkg_conflicts.keys():
                text += i18n("%1 conflicts with: [%2]\n", pkg, ", ".join(pkg_conflicts[pkg]))
            text += i18n("\nRemove the conflicting packages from the system?")
            return QMessageBox.warning(None, i18n("Conflict Error"), text, QMessageBox.Yes, QMessageBox.No) == QMessageBox.Yes

        return True
コード例 #13
0
    def save_scheme(self):
        """Save current scheme."""
        name = self.line_name.text().strip()
        if not self._is_valid_scheme_name(name):
            QMessageBox.information(
                self, translations.TR_PREFERENCES_EDITOR_SCHEME_DESIGNER,
                translations.TR_SCHEME_INVALID_NAME)
            return
        fileName = ('{0}.color'.format(
            file_manager.create_path(resources.EDITOR_SKINS, name)))
        answer = True
        if file_manager.file_exists(fileName):
            answer = QMessageBox.question(
                self, translations.TR_PREFERENCES_EDITOR_SCHEME_DESIGNER,
                translations.TR_WANT_OVERWRITE_FILE +
                ": {0}?".format(fileName), QMessageBox.Yes, QMessageBox.No)

        if answer in (QMessageBox.Yes, True):
            scheme = self._preview_style()
            self.original_style = copy.copy(scheme)
            json_manager.save_editor_skins(fileName, scheme)
            self._modified = False
            self.saved = True
            qsettings = IDE.ninja_settings()
            qsettings.setValue('preferences/editor/scheme', name)
            QMessageBox.information(
                self, translations.TR_PREFERENCES_EDITOR_SCHEME_DESIGNER,
                translations.TR_SCHEME_SAVED + ": {0}.".format(fileName))
            self.close()
        elif answer == QMessageBox.Yes:
            QMessageBox.information(
                self, translations.TR_PREFERENCES_EDITOR_SCHEME_DESIGNER,
                translations.TR_INVALID_FILENAME)
コード例 #14
0
 def reject(self):
     """Reject this dialog."""
     if self._modified:
         answer = QMessageBox.No
         answer = QMessageBox.question(
             self, translations.TR_PREFERENCES_EDITOR_SCHEME_DESIGNER,
             (translations.TR_IDE_CONFIRM_EXIT_TITLE + ".\n" +
              translations.TR_PREFERENCES_GENERAL_CONFIRM_EXIT + "?"),
             QMessageBox.Yes, QMessageBox.No)
         if answer == QMessageBox.No:
             return
     super(EditorSchemeDesigner, self).reject()
コード例 #15
0
ファイル: statemanager.py プロジェクト: vdemir/pisi-2.0
    def conflictCheckPasses(self, packages):
        (C, D, pkg_conflicts) = self.iface.getConflicts(packages, self.state)

        conflicts_within = list(D)
        if conflicts_within:
            text = i18n(
                "Selected packages [%1] are in conflict with each other. These packages can not be installed together.",
                ", ".join(conflicts_within),
            )
            QMessageBox.critical(None, i18n("Conflict Error"), text, QMessageBox.Ok)
            return False

        if pkg_conflicts:
            text = i18n("The following packages conflicts:\n")
            for pkg in pkg_conflicts.keys():
                text += i18n("%1 conflicts with: [%2]\n", pkg, ", ".join(pkg_conflicts[pkg]))
            text += i18n("\nRemove the conflicting packages from the system?")
            return (
                QMessageBox.warning(None, i18n("Conflict Error"), text, QMessageBox.Yes, QMessageBox.No)
                == QMessageBox.Yes
            )

        return True
コード例 #16
0
 def terminate(self):
     """This method is called by core for each plugin during termination
     """
     QMessageBox.information(core.mainWindow(), "Hello, world",
                             "Plugin terminated")
コード例 #17
0
 def screenshot(self):
     """The screenshot of mia_anatomist_2"""
     msg = QMessageBox()
     msg.setIcon(QMessageBox.Information)
     msg.setText('Not yet implemented!')
     msg.setWindowTitle("Information")
     msg.setStandardButtons(QMessageBox.Ok)
     msg.buttonClicked.connect(msg.close)
     msg.exec()
コード例 #18
0
 def _logging_error(self, log_conf, msg):
     """Callback from the log layer when an error occurs"""
     QMessageBox.about(self, "LocoPositioningTab error",
                       "Error when using log config",
                       " [{0}]: {1}".format(log_conf.name, msg))
コード例 #19
0
ファイル: uimain.py プロジェクト: lycying/seeking
 def __evt_changeLanguage(self,locale):
     Prefs.new().setLanguage(locale)
     QMessageBox.information(self,"Success",QApplication.translate("default","Success , this Will take effect at the next time"))
コード例 #20
0
ファイル: dialog.py プロジェクト: jrbeckwith/because
 def warning(self, title, message):
     QMessageBox.warning(self, title, message)
コード例 #21
0
ファイル: uimain.py プロジェクト: lycying/seeking
 def __evt_changeLanguage(self, locale):
     Prefs.new().setLanguage(locale)
     QMessageBox.information(
         self, "Success",
         QApplication.translate(
             "default", "Success , this Will take effect at the next time"))
コード例 #22
0
 def _logging_error(self, log_conf, msg):
     """Callback from the log layer when an error occurs"""
     QMessageBox.about(self, "LocoPositioningTab error",
                       "Error when using log config",
                       " [{0}]: {1}".format(log_conf.name, msg))
コード例 #23
0
    """WebInspector widget class"""
    def __init__(self, parent):
        QWidget.__init__(self, parent)
        vbox = QVBoxLayout(self)
        self._webInspector = QWebInspector(self)
        vbox.addWidget(self._webInspector)
        self.btnDock = QPushButton(translations.TR_UNDOCK)
        vbox.addWidget(self.btnDock)

        ExplorerContainer.register_tab(translations.TR_TAB_WEB_INSPECTOR, self)
        IDE.register_service('web_inspector', self)

    def refresh_inspector(self):
        """Refresh WebInspector widget by hiding and showing"""
        self._webInspector.hide()
        self._webInspector.show()

    def set_inspection_page(self, page):
        """Method to load an argument page object on the WebInspector"""
        self._webInspector.setPage(page)
        self._webInspector.setVisible(True)


if settings.SHOW_WEB_INSPECTOR and settings.WEBINSPECTOR_SUPPORTED:
    webInspector = WebInspector()
else:
    if not settings.WEBINSPECTOR_SUPPORTED:
        QMessageBox.information(None, translations.TR_TAB_WEB_INSPECTOR,
                                translations.TR_WEB_INSPECTOR_NOT_SUPPORTED)
    webInspector = None
コード例 #24
0
ファイル: helloworld.py プロジェクト: freason/enki
 def _sayHello(self):
     """Handler for main menu action
     """
     QMessageBox.information(core.mainWindow(), "Hello, world", "Menu action has been triggered!")
コード例 #25
0
ファイル: helloworld.py プロジェクト: freason/enki
 def terminate(self):
     """This method is called by core for each plugin during termination
     """
     QMessageBox.information(core.mainWindow(), "Hello, world", "Plugin terminated")
コード例 #26
0
ファイル: statemanager.py プロジェクト: vdemir/pisi-2.0
 def showFailMessage(self):
     QMessageBox.critical(None,
                          i18n("Network Error"),
                          i18n("Please check your network connections and try again."),
                          QMessageBox.Ok)
コード例 #27
0
ファイル: statemanager.py プロジェクト: vdemir/pisi-2.0
 def showFailMessage(self):
     QMessageBox.critical(
         None, i18n("Network Error"), i18n("Please check your network connections and try again."), QMessageBox.Ok
     )
コード例 #28
0
 def _sayHello(self):
     """Handler for main menu action
     """
     QMessageBox.information(core.mainWindow(), "Hello, world",
                             "Menu action has been triggered!")
コード例 #29
0
ファイル: GUI_EBimage.py プロジェクト: FlorianCHA/scripts
    def run(self):
        print("RUN")
        try:
            warning = ""  # initialise le nombre d'erreur
            val = 0  # initialise le nombre d'erreur
            txtInfo = ""

            # import R's "base" package
            base = importr('base')

            with open("fonctions_apprentissage.r", "r",
                      encoding="utf-8") as apprentissageRopen:
                apprentissage = "".join(apprentissageRopen.readlines())
            print(apprentissage)

            apprentissage = SignatureTranslatedAnonymousPackage(
                apprentissage, "apprentissage")

            #path_sample = "/media/sebastien/Bayer/ScriptsSEB/scripts/GUI/EBimage/AnalyseImagesV2/Samples/5583"
            path_sample = "/".join(
                str(self.dicoFoldersCallibration["leaf"]).split("/")[:-1])
            print(path_sample)
            print(dir(apprentissage))
            result, pathRdataFile = apprentissage.apprentissage(
                path_sample).r_repr().replace('"',
                                              '').replace("c(", "").replace(
                                                  ")", "").split(",")
            print(result, pathRdataFile)
            if result == "1":
                reply = QMessageBox.question(
                    parent=self,
                    title='Attention',
                    text=
                    'File will be overwritten.\nDo you still want to proceed?',
                    buttons=QMessageBox.Yes | QMessageBox.No,
                    defaultButton=QMessageBox.No)
                if reply == QMessageBox.Yes:
                    print("OK")
                self.callibrationFileOpenLineEdit.setText(pathRdataFile)
            else:

                print("BAD")

            ##grise les boutons pour pas relancer job
            #self.ui.frameRun.show()
            #self.ui.runPushButton.setDisabled(True)
            #self.ui.loadMatriceFilePushButton.setDisabled(True)
            #self.ui.loadOrderFilePushButton.setDisabled(True)
            #self.ui.PCAlineEdit.setDisabled(True)
            #self.ui.DAlineEdit.setDisabled(True)
            #self.ui.popMinLineEdit.setDisabled(True)
            #self.ui.popMaxLineEdit.setDisabled(True)
            #self.ui.rmOldCheckBox.setDisabled(True)
            #self.ui.expertCheckBox.setDisabled(True)
            #self.ui.expertFrame.setDisabled(True)
            #self.ui.graphTypeComboBox.setDisabled(True)
            #if self.expertMode == "True":
            #self.EBimagefix = str(self.ui.EBimagefixPlainTextEdit.toPlainText().toUtf8())
            #self.EBimagechange = str(self.ui.EBimagechangePlainTextEdit.toPlainText().toUtf8())

            #"""to run programme"""
            ## création du pathout
            #if os.path.isdir(self.pathFileOut):
            #if self.rmOld == "True":
            #shutil.rmtree(str(self.pathFileOut))
            #os.mkdir(self.pathFileOut)
            #else:
            #warning += "Warnnig folder "+self.pathFileOut+" already exist,\nPlease remove/rename before run new analysis or use checkbox"
            #raise Exception(warning)
            #else:
            #os.mkdir(self.pathFileOut)

            ################################################
            ## code commun mode graphique ou interface
            ################################################

            ## charge l'ordre a refaire
            #self.orderList = loadInListCol(self.orderPathFile, 0)

            ## copie de la matrice dans un dico
            #self.dicoMatrice = loadInDictLine(self.matricePathFile)

            ## Comptage du nombre d'individus, de markers et ncode:
            #self.nbindParam = len(self.dicoMatrice.keys())-1

            #if self.nbindParam != len(self.orderList):
            #txtInfo += "WARNING: More individu in Matrice file (%s) than Order label file (%s)!!!\n" % (self.nbindParam, len(self.orderList))

            #fileMat = open(self.matricePathFile,"r")
            #header = fileMat.readline()
            #self.nbmarkParam = len(header.split("\t"))
            #header = " \t"+"\t".join(header.split("\t")[1:])

            #nbcode = fileMat.readline().split("\t")[1]
            #while nbcode == "-9":
            #nbcode = fileMat.readline().split("\t")[1]
            #self.ncodeParam = len(nbcode)
            #fileMat.close()

            ## ouverture du nouveau fichier trier
            #with open(self.pathFileOut+self.basename+"_Reorder.tab","w") as reorderMatriceFile:
            #reorderMatriceFile.write(header)
            #for ind in self.orderList:
            #if ind not in self.dicoMatrice.keys():
            #error = "ERROR: The individu %s define in label file was not in the matrice file !!! Exit programme" % ind
            #raise Exception(error)

            #line = self.dicoMatrice[ind].split("\t")[0]+"\t"+"\t".join(self.dicoMatrice[ind].split("\t")[1:]).replace("999","-9")
            #reorderMatriceFile.write(line)

            #txtInfo += "Nb individus: %i\tNb markers: %i\tncodeParam: %i\tGraph type: %s\n" % (self.nbindParam,int(self.nbmarkParam)-1,self.ncodeParam, self.graphType)
            #if args.cmdMode:
            #pass
            #else:
            #self.ui.runningPlainTextEdit.setPlainText(txtInfo)

            ##ouverture du script R
            #Rscript = open(self.pathFileOut+self.basename+"_R_EBimage.R","w")
            #Rscript.write(installPackageR)

            ## Ajout du path du fichier matrice dans EBimagefix
            ## modifie Script R pour adapter aux parametres rentrés
            #dictToReplace = {
            #"**MAKERS**"	:		str(self.nbmarkParam),
            #"**NCODE**"	:			str(self.ncodeParam),
            #"**INDIV**"	:			str(self.nbindParam),
            #"**PATHTOFILE**":		str(reorderMatriceFile.name),
            #"**current_dir**"	:	str(self.pathFileOut),
            #"**GRAPH**"	:	str(self.graphType)
            #}

            #EBimagefixModif = replace_all(dictToReplace, self.EBimagefix)

            ##print(EBimagefixModif)

            #Rscript.write(EBimagefixModif)

            #for pop in range(int(self.popMinValue),int(self.popMaxValue)+1):
            ##print(pop)
            #popstr=str(pop)
            #EBimagechange2 = self.EBimagechange.replace("**pop**",popstr).replace("**current_dir**",str(self.pathFileOut)).replace("**PCARETAIN**",str(self.PCAvalue)).replace("**DARETAIN**",str(self.DAvalue))
            ##print(EBimagechange2)
            #Rscript.write(EBimagechange2)

            #Rscript.close()
            #self.ui.statusbar.showMessage(str("FINISH, script product on : %s" % self.pathFileOut),9600)

            #txtInfo += "FINISH, script product on :\n %s" % (self.pathFileOut)

            #if args.cmdMode:
            #print(txtInfo)
            #else:
            #self.ui.runningPlainTextEdit.setPlainText(txtInfo)

            ## si des erreurs:

        except Exception as e:
            self.displayError(error=e)
コード例 #30
0
ファイル: GUI_EBimage.py プロジェクト: sravel/scripts
	def run(self):
		print("RUN")
		try:
			warning = ""	# initialise le nombre d'erreur
			val = 0			# initialise le nombre d'erreur
			txtInfo = ""

			# import R's "base" package
			base = importr('base')

			with open("fonctions_apprentissage.r", "r", encoding="utf-8") as apprentissageRopen:
				apprentissage = "".join(apprentissageRopen.readlines())
			print(apprentissage)

			apprentissage = SignatureTranslatedAnonymousPackage(apprentissage, "apprentissage")

			#path_sample = "/media/sebastien/Bayer/ScriptsSEB/scripts/GUI/EBimage/AnalyseImagesV2/Samples/5583"
			path_sample = "/".join(str(self.dicoFoldersCallibration["leaf"]).split("/")[:-1])
			print(path_sample)
			print(dir(apprentissage))
			result , pathRdataFile= apprentissage.apprentissage(path_sample).r_repr().replace('"','').replace("c(","").replace(")","").split(",")
			print(result, pathRdataFile)
			if result == "1":
				reply = QMessageBox.question(parent=self, title='Attention', text='File will be overwritten.\nDo you still want to proceed?', buttons=QMessageBox.Yes | QMessageBox.No, defaultButton=QMessageBox.No)
				if reply == QMessageBox.Yes:
					print("OK")
				self.callibrationFileOpenLineEdit.setText(pathRdataFile)
			else:

				print("BAD")


			##grise les boutons pour pas relancer job
			#self.ui.frameRun.show()
			#self.ui.runPushButton.setDisabled(True)
			#self.ui.loadMatriceFilePushButton.setDisabled(True)
			#self.ui.loadOrderFilePushButton.setDisabled(True)
			#self.ui.PCAlineEdit.setDisabled(True)
			#self.ui.DAlineEdit.setDisabled(True)
			#self.ui.popMinLineEdit.setDisabled(True)
			#self.ui.popMaxLineEdit.setDisabled(True)
			#self.ui.rmOldCheckBox.setDisabled(True)
			#self.ui.expertCheckBox.setDisabled(True)
			#self.ui.expertFrame.setDisabled(True)
			#self.ui.graphTypeComboBox.setDisabled(True)
			#if self.expertMode == "True":
				#self.EBimagefix = str(self.ui.EBimagefixPlainTextEdit.toPlainText().toUtf8())
				#self.EBimagechange = str(self.ui.EBimagechangePlainTextEdit.toPlainText().toUtf8())

			#"""to run programme"""
			## création du pathout
			#if os.path.isdir(self.pathFileOut):
				#if self.rmOld == "True":
					#shutil.rmtree(str(self.pathFileOut))
					#os.mkdir(self.pathFileOut)
				#else:
					#warning += "Warnnig folder "+self.pathFileOut+" already exist,\nPlease remove/rename before run new analysis or use checkbox"
					#raise Exception(warning)
			#else:
				#os.mkdir(self.pathFileOut)

			################################################
			## code commun mode graphique ou interface
			################################################

			## charge l'ordre a refaire
			#self.orderList = loadInListCol(self.orderPathFile, 0)

			## copie de la matrice dans un dico
			#self.dicoMatrice = loadInDictLine(self.matricePathFile)

			## Comptage du nombre d'individus, de markers et ncode:
			#self.nbindParam = len(self.dicoMatrice.keys())-1

			#if self.nbindParam != len(self.orderList):
				#txtInfo += "WARNING: More individu in Matrice file (%s) than Order label file (%s)!!!\n" % (self.nbindParam, len(self.orderList))

			#fileMat = open(self.matricePathFile,"r")
			#header = fileMat.readline()
			#self.nbmarkParam = len(header.split("\t"))
			#header = " \t"+"\t".join(header.split("\t")[1:])


			#nbcode = fileMat.readline().split("\t")[1]
			#while nbcode == "-9":
				#nbcode = fileMat.readline().split("\t")[1]
			#self.ncodeParam = len(nbcode)
			#fileMat.close()

			## ouverture du nouveau fichier trier
			#with open(self.pathFileOut+self.basename+"_Reorder.tab","w") as reorderMatriceFile:
				#reorderMatriceFile.write(header)
				#for ind in self.orderList:
					#if ind not in self.dicoMatrice.keys():
						#error = "ERROR: The individu %s define in label file was not in the matrice file !!! Exit programme" % ind
						#raise Exception(error)

					#line = self.dicoMatrice[ind].split("\t")[0]+"\t"+"\t".join(self.dicoMatrice[ind].split("\t")[1:]).replace("999","-9")
					#reorderMatriceFile.write(line)

			#txtInfo += "Nb individus: %i\tNb markers: %i\tncodeParam: %i\tGraph type: %s\n" % (self.nbindParam,int(self.nbmarkParam)-1,self.ncodeParam, self.graphType)
			#if args.cmdMode:
				#pass
			#else:
				#self.ui.runningPlainTextEdit.setPlainText(txtInfo)

			##ouverture du script R
			#Rscript = open(self.pathFileOut+self.basename+"_R_EBimage.R","w")
			#Rscript.write(installPackageR)

			## Ajout du path du fichier matrice dans EBimagefix
			## modifie Script R pour adapter aux parametres rentrés
			#dictToReplace = {
			#"**MAKERS**"	:		str(self.nbmarkParam),
			#"**NCODE**"	:			str(self.ncodeParam),
			#"**INDIV**"	:			str(self.nbindParam),
			#"**PATHTOFILE**":		str(reorderMatriceFile.name),
			#"**current_dir**"	:	str(self.pathFileOut),
			#"**GRAPH**"	:	str(self.graphType)
			#}

			#EBimagefixModif = replace_all(dictToReplace, self.EBimagefix)

			##print(EBimagefixModif)

			#Rscript.write(EBimagefixModif)

			#for pop in range(int(self.popMinValue),int(self.popMaxValue)+1):
				##print(pop)
				#popstr=str(pop)
				#EBimagechange2 = self.EBimagechange.replace("**pop**",popstr).replace("**current_dir**",str(self.pathFileOut)).replace("**PCARETAIN**",str(self.PCAvalue)).replace("**DARETAIN**",str(self.DAvalue))
				##print(EBimagechange2)
				#Rscript.write(EBimagechange2)

			#Rscript.close()
			#self.ui.statusbar.showMessage(str("FINISH, script product on : %s" % self.pathFileOut),9600)

			#txtInfo += "FINISH, script product on :\n %s" % (self.pathFileOut)

			#if args.cmdMode:
				#print(txtInfo)
			#else:
				#self.ui.runningPlainTextEdit.setPlainText(txtInfo)

			## si des erreurs:

		except Exception as e:
			self.displayError(error = e)