def escapeQuotes(string):
    """Escape single quotes since values will be wrapped
    in single quotes in the wrap template.
    """
    try:
        return string.replace("'", "\\'")
    except AttributeError:
        # Not a string so return unaltered.
        return string