Read some files and return a stream.

def src(globs, **options):
	"""Read some files and return a stream."""

	# Create an array of globs if only one string is given
	if isinstance(globs, str):
		globs = [ globs ]

	# Find files
	files = find_files(globs)

	# Create a stream
	stream = Stream()

	# Options
	options["cwd"] = config.cwd

	if "base" in options:
		options["base"] = os.path.abspath(options["base"])

	# Create a File object for each file to include
	for infile in files:
		file = File(infile[2], **options)
		file.relpath = file.path
		file.order = infile[0]
		file.base = options.get("base", infile[1])
		stream.append_file(file)

	# No more files to add
	stream.end_of_stream()

	# Pipe a file reader and return the stream
	if options.get("read", True):
		return stream.pipe(FileReader())
	return stream