original_docstring: tool to find files based on user request.  This can be a single file, a folder start point for recursive search or a wild card
docstring: tool to find files based on user request.  This can be a single file, a folder start point for recursive search or a wild card
docstring_tokens: tool to find files based on user request . This can be a single file a folder start point for recursive search or a wild card
code: def findFiles(recursive, filespec, filter):
  	'''tool to find files based on user request.  This can be a single file, a folder start point for recursive search or a wild card'''
  	filespec = filespec + "/"
  	matches = []
  	if recursive:
  		if not os.path.exists(filespec):
  			#if the user passes a relative path, deal with it
  			filespec = os.path.join(os.getcwd(), filespec)
  		for root, dirnames, filenames in os.walk(os.path.dirname(filespec)):
  			for f in fnmatch.filter(filenames, filter):
  				matches.append(os.path.join(root, f))
  				print (matches[-1])
  	else:
  		if os.path.exists(filespec):
  			matches.append (os.path.abspath(filespec))
  		else:
  			for filename in glob(filespec):
  				matches.append(filename)
  	if len(matches) == 0:
  		print ("Nothing found to convert, quitting")
  		return []
  	print ("File Find Count:", len(matches))
  	return matches
code_tokens: def findFiles ( recursive , filespec , filter ) : filespec = filespec + "/" matches = [ ] if recursive : if not os . path . exists ( filespec ) : filespec = os . path . join ( os . getcwd ( ) , filespec ) for root , dirnames , filenames in os . walk ( os . path . dirname ( filespec ) ) : for f in fnmatch . filter ( filenames , filter ) : matches . append ( os . path . join ( root , f ) ) print ( matches [ - 1 ] ) else : if os . path . exists ( filespec ) : matches . append ( os . path . abspath ( filespec ) ) else : for filename in glob ( filespec ) : matches . append ( filename ) if len ( matches ) == 0 : print ( "Nothing found to convert, quitting" ) return [ ] print ( "File Find Count:" , len ( matches ) ) return matches
short_docstring: tool to find files based on user request.
short_docstring_tokens: tool to find files based on user request .
comment: '''tool to find files based on user request.  This can be a single file, a folder start point for recursive search or a wild card'''$SEP$#if the user passes a relative path, deal with it