Changeset 8:3769f9d260d8


Ignore:
Timestamp:
Sep 1, 2013, 9:55:36 AM (7 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
Message:

Add traditional / splite to filepath

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/data.py

    r0 r8  
    1414data_dir = os.path.normpath(os.path.join(data_py, '..', 'data'))
    1515
     16
    1617def filepath(filename):
    1718    '''Determine the path to a file in the data directory.
    1819    '''
     20    # Allow using / as separator in filenames
     21    filename = os.path.join(*filename.split('/'))
    1922    return os.path.join(data_dir, filename)
     23
    2024
    2125def load(filename, mode='rb'):
     
    2529    '''
    2630    return open(os.path.join(data_dir, filename), mode)
    27 
Note: See TracChangeset for help on using the changeset viewer.