All pastes #2045336 Raw Edit

Stuff

public python v1 · immutable
#2045336 ·published 2011-04-12 03:32 UTC
rendered paste body
def fileGlob(wpath , gst='*' , recuBool=1):	"""	recursivly (optional) glob a path for objects that	match the string 'gst' and return that list	1 == Recursive	"""	###################################################################	# NEED TO REPAIR THIS! BADLY ######################################	###################################################################	sep = '/'	###################################################################	###################################################################	###################################################################	if recuBool == 1:		fList = glob('%s%s%s' % (wpath, sep , gst))		aTmp  = glob('%s%s*' % (wpath, sep))		aList = []		# clean aList of matches		for a in aTmp:			if fList.count(a) == 0:				if isdir(a) == 1:					aList.append(a)		for a in aList:			aTmp = glob('%s%s%s' % (a, sep , gst))			for i in aTmp:				fList.append(i)	else:		fList = glob('%s%s%s' % (wpath, sep , gst))	return fList