Changeset 9111:639e7d0c60f6 in orange


Ignore:
Timestamp:
10/14/11 14:48:10 (3 years ago)
Author:
ales_erjavec <ales.erjavec@…>
Branch:
default
Convert:
653297b4d99aaec7b747dcf02f5fcd2d8c357887
Message:

Fixed some problems with dataset paths.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orange/Orange/data/io.py

    r9090 r9111  
    877877         
    878878    """ 
    879     print "expand", prefixed_name 
    880879    prefix, filename = prefixed_name.split(":", 1) #TODO: windows drive letters. 
    881880    paths = search_paths(prefix) 
     
    889888    """ Find the prefixed filename and return its full path. 
    890889    """ 
    891     print "find", prefixed_name 
    892890    if not os.path.exists(prefixed_name): 
    893891        if ":" not in prefixed_name: 
  • source/orange/lib_kernel.cpp

    r9090 r9111  
    21202120  } 
    21212121 
    2122   // Try fo find the file using Orange.data.io.find_file 
    2123   PyObject *ioModule = PyImport_ImportModule("Orange.data.io"); 
    2124   if (ioModule) { 
    2125       PyObject *find_file = PyObject_GetAttrString(ioModule, "find_file"); 
    2126       if (find_file){ 
    2127           PyObject *py_args = Py_BuildValue("(s)", filename); 
    2128           PyObject *ex_filename = PyObject_Call(find_file, py_args, NULL); 
    2129           if (ex_filename && PyString_Check(ex_filename)){ 
    2130               res = loadDataFromFileNoSearch(type, PyString_AsString(ex_filename), argstuple, keywords, generatorOnly); 
    2131               Py_DECREF(ex_filename); 
     2122  if (!res) { 
     2123      // Try fo find the file using Orange.data.io.find_file 
     2124      PyObject *ioModule = PyImport_ImportModule("Orange.data.io"); 
     2125      if (ioModule) { 
     2126          PyObject *find_file = PyObject_GetAttrString(ioModule, "find_file"); 
     2127          if (find_file){ 
     2128              PyObject *py_args = Py_BuildValue("(s)", filename); 
     2129              PyObject *ex_filename = PyObject_Call(find_file, py_args, NULL); 
     2130              if (ex_filename && PyString_Check(ex_filename)){ 
     2131                  res = loadDataFromFileNoSearch(type, PyString_AsString(ex_filename), argstuple, keywords, generatorOnly); 
     2132                  Py_DECREF(ex_filename); 
     2133              } 
     2134              PyErr_Clear(); 
     2135              Py_DECREF(py_args); 
     2136              Py_DECREF(find_file); 
    21322137          } 
    2133           else 
    2134               PyErr_Clear(); 
    2135           Py_DECREF(py_args); 
    2136           Py_DECREF(find_file); 
     2138          Py_DECREF(ioModule); 
    21372139      } 
    2138       Py_DECREF(ioModule); 
    21392140  } 
    21402141  if (!res) 
Note: See TracChangeset for help on using the changeset viewer.