Source

pygamegsoc12 / alchemymadness / skelutil.py

Full commit
import os

_DATA_DIR = None
def data_dir(*args):
    """ data_dir() returns the path to where the data is stored.  
        Use it like os.path.join() where the first part of the path 
        is the data dir.
    """
    global _DATA_DIR
    if _DATA_DIR is None:
        _DATA_DIR = os.path.join('alchemymadness', 'data')
        if not os.path.exists(_DATA_DIR):
            _DATA_DIR = os.path.join(os.path.split(__file__)[0], 'data')
    return os.path.join(*([_DATA_DIR] + list(args)))