def render(self):
    tb = self.host.textBuffer
    colorPrefs = self.program.color
    color = colorPrefs.get(u'status_line')
    if self.host.showTips:
        tipRows = app.help.docs[u'tips']
        if ((len(tipRows) + 1) < self.rows):
            for i in range(self.rows):
                self.addStr(i, 0, (u' ' * self.cols), color)
            for (i, k) in enumerate(tipRows):
                self.addStr((i + 1), 4, k, color)
            self.addStr(1, 40, u'(Press F1 to show/hide tips)', (color | curses.A_REVERSE))
    statusLine = u''
    if tb.message:
        statusLine = tb.message[0]
        color = (tb.message[1] if (tb.message[1] is not None) else colorPrefs.get(u'status_line'))
    if 0:
        if tb.isDirty():
            statusLine += u' * '
        else:
            statusLine += u' . '
    rowPercentage = 0
    colPercentage = 0
    lineCount = len(tb.lines)
    if lineCount:
        rowPercentage = ((self.host.textBuffer.penRow * 100) // lineCount)
        charCount = len(tb.lines[self.host.textBuffer.penRow])
        if (charCount and (self.host.textBuffer.penCol != 0)):
            colPercentage = ((self.host.textBuffer.penCol * 100) // charCount)
    rightSide = u''
    if len(statusLine):
        rightSide += u' |'
    if self.program.prefs.startup.get('showLogWindow'):
        rightSide += (u' %s | %s |' % (tb.cursorGrammarName(), tb.selectionModeName()))
    rightSide += (u' %4d,%2d | %3d%%,%3d%%' % ((self.host.textBuffer.penRow + 1), (self.host.textBuffer.penCol + 1), rowPercentage, colPercentage))
    statusLine += ((u' ' * ((self.cols - len(statusLine)) - len(rightSide))) + rightSide)
    self.addStr((self.rows - 1), 0, statusLine[:self.cols], color)
def render(self):
    tb = self.host.textBuffer
    colorPrefs = self.program.color
    color = colorPrefs.get(u'status_line')
    if self.host.showTips:
        tipRows = app.help.docs[u'tips']
        if ((len(tipRows) + 1) < self.rows):
            for i in range(self.rows):
                self.addStr(i, 0, (u' ' * self.cols), color)
            for (i, k) in enumerate(tipRows):
                self.addStr((i + 1), 4, k, color)
            self.addStr(1, 40, u'(Press F1 to show/hide tips)', (color | curses.A_REVERSE))
    statusLine = u
    if tb.message:
        statusLine = tb.message[0]
        color = (tb.message[1] if (tb.message[1] is not None) else colorPrefs.get(u'status_line'))
    if 0:
        if tb.isDirty():
            statusLine += u' * '
        else:
            statusLine += u' . '
    rowPercentage = 0
    colPercentage = 0
    lineCount = len(tb.lines)
    if lineCount:
        rowPercentage = ((self.host.textBuffer.penRow * 100) // lineCount)
        charCount = len(tb.lines[self.host.textBuffer.penRow])
        if (charCount and (self.host.textBuffer.penCol != 0)):
            colPercentage = ((self.host.textBuffer.penCol * 100) // charCount)
    rightSide = u
    if len(statusLine):
        rightSide += u' |'
    if self.program.prefs.startup.get('showLogWindow'):
        rightSide += (u' %s | %s |' % (tb.cursorGrammarName(), tb.selectionModeName()))
    rightSide += (u' %4d,%2d | %3d%%,%3d%%' % ((self.host.textBuffer.penRow + 1), (self.host.textBuffer.penCol + 1), rowPercentage, colPercentage))
    statusLine += ((u' ' * ((self.cols - len(statusLine)) - len(rightSide))) + rightSide)
    self.addStr((self.rows - 1), 0, statusLine[:self.cols], color)