def _make_module_names(package_dir, paths):
 package_dir = os.path.abspath(package_dir)
 package_name = os.path.split(package_dir)[1]
 prefix_length = len(package_dir)
 module_names = []
 for path in paths:
  path = os.path.abspath(path)
  rel_path = path[prefix_length:]
  rel_path = os.path.splitext(rel_path)[0]
  parts = []
  while True:
   (rel_path, tail) = os.path.split(rel_path)
   if (not tail):
    break
   parts.insert(0, tail)
  parts.insert(0, package_name)
  module = '.'.join(parts)
  module_names.append(module)
 return module_names

def _make_module_names ( package_dir , paths ) : package_dir = os . path . abspath ( package_dir ) package_name = os . path . split ( package_dir ) [ 1 ] prefix_length = len ( package_dir ) module_names = [ ] for path in paths : path = os . path . abspath ( path ) rel_path = path [ prefix_length : ] rel_path = os . path . splitext ( rel_path ) [ 0 ] parts = [ ] while True : ( rel_path , tail ) = os . path . split ( rel_path ) if ( not tail ) : break parts . insert ( 0 , tail ) parts . insert ( 0 , package_name ) module = '.' . join ( parts ) module_names . append ( module ) return module_names
return a list of fully-qualified module names given a list of module paths .