import re

def format_list(lst):
	return u", ".join([u"'%s'" % (elem,) for elem in lst])

def format_string(string, args):
	"""Format string like str.format does in Python >= 2.5

	Arguments:
	- string - template string
	- args - arguments dictionary
	"""
	for k, v in args.iteritems():
		string = re.sub(ur'\{%s\}' % k, lambda _: unicode(v), string)
	return string
