pygamegsoc12 / alchemymadness / skelutil.py

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)))
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.