def _find_pkg_data_path(data_name, package=None):
 if (package is None):
  module = find_current_module(1, True)
  if (module is None):
   return data_name
  if ((not hasattr(module, u'__package__')) or (not module.__package__)):
   if (u'.' in module.__name__):
    package = module.__name__.rpartition(u'.')[0]
   else:
    package = module.__name__
  else:
   package = module.__package__
 else:
  module = resolve_name(package)
 rootpkgname = package.partition(u'.')[0]
 rootpkg = resolve_name(rootpkgname)
 module_path = os.path.dirname(module.__file__)
 path = os.path.join(module_path, data_name)
 root_dir = os.path.dirname(rootpkg.__file__)
 assert _is_inside(path, root_dir), ((u'attempted to get a local data file outside of the ' + rootpkgname) + u' tree')
 return path

def _find_pkg_data_path ( data_name , package = None ) : if ( package is None ) : module = find_current_module ( 1 , True ) if ( module is None ) : return data_name if ( ( not hasattr ( module , u'__package__' ) ) or ( not module . __package__ ) ) : if ( u'.' in module . __name__ ) : package = module . __name__ . rpartition ( u'.' ) [ 0 ] else : package = module . __name__ else : package = module . __package__ else : module = resolve_name ( package ) rootpkgname = package . partition ( u'.' ) [ 0 ] rootpkg = resolve_name ( rootpkgname ) module_path = os . path . dirname ( module . __file__ ) path = os . path . join ( module_path , data_name ) root_dir = os . path . dirname ( rootpkg . __file__ ) assert _is_inside ( path , root_dir ) , ( ( u'attempted to get a local data file outside of the ' + rootpkgname ) + u' tree' ) return path
look for data in the source-included data directories and return the path .