def addSortHeader(self, name, reference, width=None, sep=u' |'):

    def draw(control):
        decoration = (u'v' if control[u'dict'][control[u'name']] else u'^')
        if (control[u'dict'][control[u'name']] is None):
            decoration = u'-'
        if (control[u'width'] < 0):
            return (u'%s %s' % (control[u'name'], decoration))
        return (u'%s %s' % (decoration, control[u'name']))
    self.addElement(draw, u'sort', name, reference, width, sep, len(u' v'))
def addSortHeader(self, name, reference, width=None, sep=u' |'):

    def draw(control):
        decoration = (u'v' if control[u'dict'][control[u'name']] else u'^')
        if (control[u'dict'][control[u'name']] is None):
            decoration = u'-'
        if (control[u'width'] < 0):
            return (u'%s %s' % (control[u'name'], decoration))
        return (u'%s %s' % (decoration, control[u'name']))
    self.addElement(draw, u'sort', name, reference, width, sep, len(u' v'))