def distutils_scheme(dist_name, user=False, home=None, root=None):
 from distutils.dist import Distribution
 scheme = {}
 d = Distribution({'name': dist_name})
 d.parse_config_files()
 i = d.get_command_obj('install', create=True)
 i.user = (user or i.user)
 i.home = (home or i.home)
 i.root = (root or i.root)
 i.finalize_options()
 for key in SCHEME_KEYS:
  scheme[key] = getattr(i, ('install_' + key))
 if running_under_virtualenv():
  scheme['headers'] = os.path.join(sys.prefix, 'include', 'site', ('python' + sys.version[:3]), dist_name)
  if (root is not None):
   scheme['headers'] = os.path.join(root, os.path.abspath(scheme['headers'])[1:])
 return scheme

def distutils_scheme ( dist_name , user = False , home = None , root = None ) : from distutils . dist import Distribution scheme = { } d = Distribution ( { 'name' : dist_name } ) d . parse_config_files ( ) i = d . get_command_obj ( 'install' , create = True ) i . user = ( user or i . user ) i . home = ( home or i . home ) i . root = ( root or i . root ) i . finalize_options ( ) for key in SCHEME_KEYS : scheme [ key ] = getattr ( i , ( 'install_' + key ) ) if running_under_virtualenv ( ) : scheme [ 'headers' ] = os . path . join ( sys . prefix , 'include' , 'site' , ( 'python' + sys . version [ : 3 ] ) , dist_name ) if ( root is not None ) : scheme [ 'headers' ] = os . path . join ( root , os . path . abspath ( scheme [ 'headers' ] ) [ 1 : ] ) return scheme
return a distutils install scheme .