emat/util/xmle/file_util.py
def single_matching(pattern, case_insensitive=False):
	"Get the only file matching a glob pattern, if 0 or 2+ matches raise NameError"
	if case_insensitive:
		pattern = _insensitive_glob(pattern)
	files = glob.glob(pattern)
	if len(files) > 1:
		raise NameError("More than one file matches pattern '{}'".format(pattern))
	if len(files) < 1:
		raise NameError("No file matches pattern '{}'".format(pattern))
	return files[0]
Get the only file matching a glob pattern, if 0 or 2+ matches raise NameError
Get the only file matching a glob pattern, if 0 or 2+ matches raise NameError
Get the only file matching a glob pattern if 0 or 2 + matches raise NameError
def single_matching(pattern, case_insensitive=False):
	if case_insensitive:
		pattern = _insensitive_glob(pattern)
	files = glob.glob(pattern)
	if len(files) > 1:
		raise NameError("More than one file matches pattern '{}'".format(pattern))
	if len(files) < 1:
		raise NameError("No file matches pattern '{}'".format(pattern))
	return files[0]
def single_matching ( pattern , case_insensitive = False ) : if case_insensitive : pattern = _insensitive_glob ( pattern ) files = glob . glob ( pattern ) if len ( files ) > 1 : raise NameError ( "More than one file matches pattern '{}'" . format ( pattern ) ) if len ( files ) < 1 : raise NameError ( "No file matches pattern '{}'" . format ( pattern ) ) return files [ 0 ]
Get the only file matching a glob pattern, if 0 or 2+ matches raise NameError
Get the only file matching a glob pattern if 0 or 2 + matches raise NameError
"Get the only file matching a glob pattern, if 0 or 2+ matches raise NameError"
pattern
case_insensitive