def get_pkg_data_filenames(datadir, package=None, pattern=u'*'):
 path = _find_pkg_data_path(datadir, package=package)
 if os.path.isfile(path):
  raise IOError(u"Tried to access a data directory that's actually a package data file")
 elif os.path.isdir(path):
  for filename in os.listdir(path):
   if fnmatch.fnmatch(filename, pattern):
    (yield os.path.join(path, filename))
 else:
  raise IOError(u'Path not found')

def get_pkg_data_filenames ( datadir , package = None , pattern = u'*' ) : path = _find_pkg_data_path ( datadir , package = package ) if os . path . isfile ( path ) : raise IOError ( u"Tried to access a data directory that's actually a package data file" ) elif os . path . isdir ( path ) : for filename in os . listdir ( path ) : if fnmatch . fnmatch ( filename , pattern ) : ( yield os . path . join ( path , filename ) ) else : raise IOError ( u'Path not found' )
returns the path of all of the data files in a given directory that match a given glob pattern .