(self, text)
return '\n'.join(newtext), '\n'.join(lines[len(newtext):])
Remove a tab from the front of each line of the given text.
Remove a tab from the front of each line of the given text.
Remove a tab from the front of each line of the given text .
def detab(self, text):
        """ Remove a tab from the front of each line of the given text. """
        newtext = []
        lines = text.split('\n')
        for line in lines:
            if line.startswith(' '*self.tab_length):
                newtext.append(line[self.tab_length:])
            elif not line.strip():
                newtext.append('')
            else:
                break
        return '\n'.join(newtext), '\n'.join(lines[len(newtext):])
def detab ( self , text ) : newtext = [ ] lines = text . split ( '\n' ) for line in lines : if line . startswith ( ' ' * self . tab_length ) : newtext . append ( line [ self . tab_length : ] ) elif not line . strip ( ) : newtext . append ( '' ) else : break return '\n' . join ( newtext ) , '\n' . join ( lines [ len ( newtext ) : ] )