Changeset 205:466147799786


Ignore:
Timestamp:
04/06/11 21:03:34 (12 years ago)
Author:
Simon Cross <hodgestar@…>
Branch:
default
Phase:
public
Rebase:
66326630303030393635313939356234383961643230656538636663306337356335333162313237
Message:

Add support for Windows in data loading.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • skaapsteker/data.py

    r88 r205  
    2222    '''Determine the path to a file in the data directory.
    2323    '''
     24    filename = os.path.join(*filename.split('/'))
    2425    return os.path.join(data_dir, filename)
    2526
     
    3031    "mode" is passed as the second arg to open().
    3132    '''
    32     return open(os.path.join(data_dir, filename), mode)
     33    return open(filepath(filename), mode)
    3334
    3435
    35 def get_files(filepath):
     36def get_files(folder):
    3637    """Return a sorted list of files in the given directory, with the directory stripped"""
    37     return sorted(os.listdir(os.path.join(data_dir, filepath)))
     38    return sorted(os.listdir(filepath(folder)))
    3839
    3940
Note: See TracChangeset for help on using the changeset viewer.