def fileList(paths, relative=False, folders=False):
 if (not isinstance(paths, list)):
  paths = [paths]
 files = []
 def append(directory, name):
  if (not name.startswith('.')):
   path = os.path.join(directory, name)
   files.append(path)
 for path in paths:
  for (directory, dirnames, filenames) in os.walk(path, followlinks=True):
   if folders:
    for dirname in dirnames:
     append(directory, dirname)
   for filename in filenames:
    append(directory, filename)
  if relative:
   files = map_apply((lambda x: x[(len(path) + 1):]), files)
 return files

def fileList ( paths , relative = False , folders = False ) : if ( not isinstance ( paths , list ) ) : paths = [ paths ] files = [ ] def append ( directory , name ) : if ( not name . startswith ( '.' ) ) : path = os . path . join ( directory , name ) files . append ( path ) for path in paths : for ( directory , dirnames , filenames ) in os . walk ( path , followlinks = True ) : if folders : for dirname in dirnames : append ( directory , dirname ) for filename in filenames : append ( directory , filename ) if relative : files = map_apply ( ( lambda x : x [ ( len ( path ) + 1 ) : ] ) , files ) return files
generate a recursive list of files from a given path .