def _indentUpTo(self, text, width):
        """Add space to text, so text width will be at least width.
        Return text, which must be added
        """
        visibleTextWidth = self._realToVisibleColumn(text, len(text))
        diff = width - visibleTextWidth
        if diff <= 0:
            return ''
        elif self._qpart.indentUseTabs and \
           all([char == '\t' for char in text]):  # if using tabs and only tabs in text
            return '\t' * (diff // self._qpart.indentWidth) + \
                   ' ' * (diff % self._qpart.indentWidth)
        else:
            return ' ' * int(diff)
def _indentUpTo ( self , text , width ) : visibleTextWidth = self . _realToVisibleColumn ( text , len ( text ) ) diff = width - visibleTextWidth if diff <= 0 : return '' elif self . _qpart . indentUseTabs and all ( [ char == '\t' for char in text ] ) : return '\t' * ( diff // self . _qpart . indentWidth ) + ' ' * ( diff % self . _qpart . indentWidth ) else : return ' ' * int ( diff )
Add space to text, so text width will be at least width.
        Return text, which must be added