changeset 31:51ff46f42ed2

Add pth seperator normalisation to data helpers
author Neil Muller <drnlmuller@gmail.com>
date Sun, 06 May 2012 20:54:03 +0200
parents 746af82c36b3
children 00aff02bc6fc
files gamelib/data.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gamelib/data.py	Sun May 06 20:45:37 2012 +0200
+++ b/gamelib/data.py	Sun May 06 20:54:03 2012 +0200
@@ -14,6 +14,7 @@
 def filepath(filename):
     '''Determine the path to a file in the data directory.
     '''
+    filename = os.path.join(*filename.split('/'))
     return os.path.join(data_dir, filename)
 
 
@@ -22,4 +23,4 @@
 
     "mode" is passed as the second arg to open().
     '''
-    return open(os.path.join(data_dir, filename), mode)
+    return open(filepath(filename), mode)