def collect_data_files(package, include_py_files=False, subdir=None):
 if (not isinstance(package, string_types)):
  raise ValueError
 (pkg_base, pkg_dir) = get_package_paths(package)
 if subdir:
  pkg_dir = os.path.join(pkg_dir, subdir)
 datas = []
 for (dirpath, dirnames, files) in os.walk(pkg_dir):
  for f in files:
   extension = os.path.splitext(f)[1]
   if (include_py_files or (extension not in PY_IGNORE_EXTENSIONS)):
    source = os.path.join(dirpath, f)
    dest = remove_prefix(dirpath, (os.path.dirname(pkg_base) + os.sep))
    datas.append((source, dest))
 return datas

def collect_data_files ( package , include_py_files = False , subdir = None ) : if ( not isinstance ( package , string_types ) ) : raise ValueError ( pkg_base , pkg_dir ) = get_package_paths ( package ) if subdir : pkg_dir = os . path . join ( pkg_dir , subdir ) datas = [ ] for ( dirpath , dirnames , files ) in os . walk ( pkg_dir ) : for f in files : extension = os . path . splitext ( f ) [ 1 ] if ( include_py_files or ( extension not in PY_IGNORE_EXTENSIONS ) ) : source = os . path . join ( dirpath , f ) dest = remove_prefix ( dirpath , ( os . path . dirname ( pkg_base ) + os . sep ) ) datas . append ( ( source , dest ) ) return datas
this routine produces a list of non-python files which reside in package .