'Remove a tab from the front of each line of the given text.'

def detab(self, text):

    newtext = []
    lines = text.split(u'\n')
    for line in lines:
        if line.startswith((u'    ' * self.tab_length)):
            newtext.append(line[self.tab_length:])
        elif (not line.strip()):
            newtext.append(u'')
        else:
            break
    return (u'\n'.join(newtext), u'\n'.join(lines[len(newtext):]))
