Mercurial > mamba
diff mamba/data.py @ 271:49c125e8bc2a
More helpers
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Thu, 15 Sep 2011 17:08:32 +0200 |
parents | 9827ce469834 |
children | dcd0642e12e0 |
line wrap: on
line diff
--- a/mamba/data.py Thu Sep 15 13:25:00 2011 +0200 +++ b/mamba/data.py Thu Sep 15 17:08:32 2011 +0200 @@ -68,3 +68,8 @@ def check_level_exists(level): return os.path.isfile(os.path.join(data_dir, 'levels', '%s.txt' % level)) + + +def list_levels(): + files = [os.path.splitext(x) for x in os.listdir(filepath('levels'))] + return [x[0] for x in files if x[1] == '.txt']