magic.autopath API [rev. 38799]

def autopath(globs=None, basefile='__init__.py'):

return the (local) path of the "current" file pointed to by globals or - if it is none - alternatively the callers frame globals. the path will always point to a .py file or to None. the path will have the following payload: pkgdir is the last parent directory path containing 'basefile' starting backwards from the current file.