def browse_files(self, in_demos=False): start_file = self.last_path() or os.path.expanduser("~/") filenames = QFileDialog.getOpenFileNames(self, 'Open Multiple Data Files', start_file, dialog_formats()) if isinstance(filenames, tuple): # has a file description filenames = filenames[0] self.load_files(filenames)
def browse_file(self, in_demos=False): if in_demos: start_file = get_sample_datasets_dir() if not os.path.exists(start_file): QMessageBox.information( None, "File", "Cannot find the directory with documentation data sets") return else: start_file = self.last_path() or os.path.expanduser("~/") filename, _ = QFileDialog.getOpenFileName( self, 'Open Orange Data File', start_file, dialog_formats()) if not filename: return self.add_path(filename) self.source = self.LOCAL_FILE self.load_data()
def browse_file(self, in_demos=False): if in_demos: start_file = get_sample_datasets_dir() if not os.path.exists(start_file): QMessageBox.information( None, "File", "Cannot find the directory with documentation data sets") return else: start_file = self.last_path() or os.path.expanduser("~/") filename, _ = QFileDialog.getOpenFileName(self, 'Open Orange Data File', start_file, dialog_formats()) if not filename: return self.add_path(filename) self.source = self.LOCAL_FILE self.load_data()
def test_add_new_format(self): # test adding file formats after registering the widget formats = dialog_formats() self.assertTrue(".123" in formats)
def test_call_deprecated_dialog_formats(self): with self.assertWarns(OrangeDeprecationWarning): self.assertIn("Tab", dialog_formats())
def test_call_deprecated_dialog_formats(self): with self.assertWarns(OrangeDeprecationWarning): self.assertIn("Tab", dialog_formats())
def test_add_new_format(self): # test adding file formats after registering the widget formats = dialog_formats() self.assertTrue(".123" in formats)