Ejemplo n.º 1
0
    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)
Ejemplo n.º 2
0
    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()
Ejemplo n.º 3
0
    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()
Ejemplo n.º 4
0
 def test_add_new_format(self):
     # test adding file formats after registering the widget
     formats = dialog_formats()
     self.assertTrue(".123" in formats)
Ejemplo n.º 5
0
 def test_call_deprecated_dialog_formats(self):
     with self.assertWarns(OrangeDeprecationWarning):
         self.assertIn("Tab", dialog_formats())
Ejemplo n.º 6
0
 def test_call_deprecated_dialog_formats(self):
     with self.assertWarns(OrangeDeprecationWarning):
         self.assertIn("Tab", dialog_formats())
Ejemplo n.º 7
0
 def test_add_new_format(self):
     # test adding file formats after registering the widget
     formats = dialog_formats()
     self.assertTrue(".123" in formats)