Changeset 4656:c10c83725693 in orange


Ignore:
Timestamp:
05/17/08 23:56:11 (6 years ago)
Author:
janezd <janez.demsar@…>
Branch:
default
Convert:
6b53c0adc543a0b188bcdd6182428c815e70f7e1
Message:
  • offers loading all file types registered in orngIO (in particular, arff)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/Data/OWFile.py

    r4607 r4656  
    1313from OWWidget import * 
    1414import OWGUI, string, os.path, user, sys, warnings 
     15import orngIO 
    1516 
    1617warnings.filterwarnings("error", ".*" , orange.KernelWarning, "OWFile", 11) 
     
    2627    contextHandlers = {"": FileNameContextHandler()} 
    2728 
     29    registeredFileTypes = [ft for ft in orange.getRegisteredFileTypes() if len(ft)>2 and ft[2]] 
     30    dlgFormats = 'Tab-delimited files (*.tab *.txt)\nC4.5 files (*.data)\nAssistant files (*.dat)\nRetis files (*.rda *.rdo)\nBasket files (*.basket)\n' \ 
     31                 + "\n".join("%s (%s)" % (ft[:2]) for ft in registeredFileTypes) \ 
     32                 + "\nAll files(*.*)" 
     33                  
    2834    def __init__(self, parent=None, signalManager = None): 
    2935        OWWidget.__init__(self, parent, signalManager, "File") 
     
    161167                startfile=self.recentFiles[0] 
    162168 
    163         filename = str(QFileDialog.getOpenFileName(startfile, 
    164         'Tab-delimited files (*.tab *.txt)\nC4.5 files (*.data)\nAssistant files (*.dat)\nRetis files (*.rda *.rdo)\nBasket files (*.basket)\nAll files(*.*)', 
    165         None, 'Open Orange Data File')) 
     169         
     170          
     171        filename = str(QFileDialog.getOpenFileName(startfile, self.dlgFormats, None, 'Open Orange Data File')) 
    166172 
    167173        if filename == "": return 
Note: See TracChangeset for help on using the changeset viewer.