All pastes #815953 Raw Edit

Stuff

public text v1 · immutable
·published 2007-12-14 14:56 UTC
rendered paste body
def find_filenameconvention(files):
	winner = (0,None)
	for rx in common_filename_patterns:
		found = 0
		for filename in files:
			if rx.match(filename) != None:
				found += 1
		if found > winner[0]:
			winner = (found, rx)
	return winner