changeset 8:3769f9d260d8

Add traditional / splite to filepath
author Neil Muller <drnlmuller@gmail.com>
date Sun, 01 Sep 2013 11:55:36 +0200
parents 7293e288e89f
children 8750e097afb5
files nagslang/data.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/nagslang/data.py	Sun Sep 01 11:54:58 2013 +0200
+++ b/nagslang/data.py	Sun Sep 01 11:55:36 2013 +0200
@@ -13,15 +13,18 @@
 data_py = os.path.abspath(os.path.dirname(__file__))
 data_dir = os.path.normpath(os.path.join(data_py, '..', 'data'))
 
+
 def filepath(filename):
     '''Determine the path to a file in the data directory.
     '''
+    # Allow using / as separator in filenames
+    filename = os.path.join(*filename.split('/'))
     return os.path.join(data_dir, filename)
 
+
 def load(filename, mode='rb'):
     '''Open a file in the data directory.
 
     "mode" is passed as the second arg to open().
     '''
     return open(os.path.join(data_dir, filename), mode)
-