def truncate(value,arg):
	"""Truncates a string of a given length, adds three dots at the end."""
	try:
		if len(value) > arg:
			return "%s..." % value[0:arg-3]
		else:
			return value
	except ValueError:
		pass