def select_resistance_json_file(self): """ Selects a json file to parse the resitance from """ new_file_path_json = QFileDialog.getOpenFileName()[0] if not new_file_path_json == '' and new_file_path_json[ -len('.json'):] == '.json': self.resistance_line.clear() self.resistance_json_path = new_file_path_json
def browse_path(self): filename = QFileDialog.getOpenFileName(self, 'Open pickler File', "", 'Logs Files (*.*)') if isinstance(filename, tuple): filename = filename[0] if filename: self.ui.label_file_log_1.setText(filename)
def select_json_file(self): """ Selects a json file to parse overall data from """ new_file_path_json = QFileDialog.getOpenFileName()[0] if not new_file_path_json == '' and new_file_path_json[ -len('.json'):] == '.json': self.clear_all_plots() self.file_path_json = new_file_path_json self.resistance_json_path = None
def loadOrderFile(self): """Méthode qui permet de charger un fichier et afficher dans le plainText""" filename = QFileDialog.getOpenFileName(self, caption="Load the File", directory=os.getcwd(), filter="Text files (*.txt *.tab);;All (*.*)") if filename == "" and self.orderPathFile == "": self.displayError(error = "\"%s\" is not a valid file \n" % (filename)) else: self.orderPathFile = filename self.workingDir = "/".join(str(filename).split("/")[:-1])+"/" self.basename = filename.split("/")[-1].split(".")[0] self.pathFileOut = self.workingDir+self.basename+"/" if os.path.isdir(self.pathFileOut): self.displayError(error = "Warnnig folder %s already exist,\nPlease remove/rename before run new analysis or use checkbox\n" % (self.pathFileOut)) self.ui.orderPlainTextEdit.setPlainText(filename) self.actualizeRunBouton()
def load_analysis_file(self): """ Loads analysis file and calls updates to data models """ FileDialog = QFileDialog() analysis_file_location = FileDialog.getOpenFileName( self, "Select object analysis data", "D:\\Austin\\", "CSV or Text Files (*csv *txt)") if os.path.isfile(analysis_file_location[0]): self._main_model.object_data = pd.read_csv( analysis_file_location[0]) self._main_model.filter_results = self._main_model.object_data self.update_models_from_analysis_file() return (True, os.path.split(analysis_file_location[0])[-1]) # if user cancelled loading dialog, skip indexing objects in main_view return (False, -1)
def loadOrderFile(self): """Méthode qui permet de charger un fichier et afficher dans le plainText""" filename = QFileDialog.getOpenFileName( self, caption="Load the File", directory=os.getcwd(), filter="Text files (*.txt *.tab);;All (*.*)") if filename == "" and self.orderPathFile == "": self.displayError(error="\"%s\" is not a valid file \n" % (filename)) else: self.orderPathFile = filename self.workingDir = "/".join(str(filename).split("/")[:-1]) + "/" self.basename = filename.split("/")[-1].split(".")[0] self.pathFileOut = self.workingDir + self.basename + "/" if os.path.isdir(self.pathFileOut): self.displayError( error= "Warnnig folder %s already exist,\nPlease remove/rename before run new analysis or use checkbox\n" % (self.pathFileOut)) self.ui.orderPlainTextEdit.setPlainText(filename) self.actualizeRunBouton()
def _load_plugin_path(self): """Ask the user a plugin filename""" path = QFileDialog.getOpenFileName(self, translations.TR_SELECT_PLUGIN_PATH) if path: self._txtFilePath.setText(path)
def selectFile(self): filename, _filter = QFileDialog.getOpenFileName( None, "Open File", '..\\Firmware\\Hexa', "Arduino Sketch File (*.ino)") self.inoFilePath.setText(filename)