return a link label as a string

def link_label(link):
        '''return a link label as a string'''
        if hasattr(link, 'label'):
            label = link.label
        else:
            label = str(link.linknum+1)
        return label