parameters: (self, repaint)
return_statement: return (current_line, current_prompt, sel_symbol)
docstring: Repaint the screen.
docstring_summary: Repaint the screen.
docstring_tokens: Repaint the screen .
function: def redisplay(self, repaint):
          "Repaint the screen."
          sel_symbol = current_line = None
          if self.banner and self.in_menu():
              title = self.msgbuf + (" " * (self.columns - len(self.msgbuf) - len(self.banner) -1)) + self.banner
          else:
              title = (" " * ((self.columns-len(self.msgbuf)) / 2)) + self.msgbuf
          self.menus.viewport_height = self.lines-2 + (not configuration.expert_tie or cml.evaluate(configuration.expert_tie) != cml.n)
          self.window.move(0, 0)
          self.window.clrtoeol()
          self.window.addstr(title, curses.A_BOLD)
  
          (thumb_top, thumb_bottom) = self.menus.thumb()
  
          # Display the current band of entries 
          screenlines = self.menus.list()
          if self.in_menu():
              screenvals = self.values[self.menus.viewbase():self.menus.viewbase()+self.menus.viewport_height]
              configuration.debug_emit(1, "screenvals: " + `screenvals`)
          else:
              current_prompt = None
  
          # To change the number of lines on the screen that this paints,
          # change the initialization of the viewport_height member.
          for i in range(self.menus.viewport_height):
              self.window.move(i+1, 0)
              self.window.clrtoeol()
              if len(self.menus.top()) <= self.menus.viewport_height:
                  thumb = None
              elif i <= thumb_bottom and i >= thumb_top:
                  thumb = curses.ACS_CKBOARD
              else:
                  thumb = curses.ACS_VLINE
              if i < len(screenlines):
                  child = screenlines[i]
                  if type(child) is type(""):
                      self.window.addstr(i+1, 0, child) 
                  elif child.type == "message":
                      self.window.addstr(i+1, 0, child.prompt + " ") 
                      self.window.hline(i+1, len(child.prompt) + 2,
                                   curses.ACS_HLINE, self.columns-len(child.prompt)-3)
                  else:
                      if child == self.menus.selected():
                          lpointer = ">"
                          rpointer = "<"
                          highlight = curses.A_REVERSE
                          current_line = i
                          current_prompt = screenvals[i]
                          sel_symbol = child
                      else:
                          lpointer = rpointer = " "
                          highlight = curses.A_NORMAL
                          if curses.has_colors():
                              if child.frozen():
                                  highlight=curses.color_pair(curses.COLOR_CYAN)
                              #elif child.inspected:
                              #    highlight=curses.color_pair(curses.COLOR_GREEN)
                              elif child.setcount or child.included:
                                  highlight=curses.color_pair(curses.COLOR_GREEN)
                      # OK, now assemble the rest of the line
                      leftpart = ("  " * child.depth) + cgenprompt(child, not configuration.expert_tie or not cml.evaluate(configuration.expert_tie))
                      if configuration.is_new(child):
                          leftpart = leftpart + " " + lang["NEW"]
                      if child.frozen():
                          leftpart = leftpart + " " + lang["FREEZELABEL"]
                      if child.help():
                          helpflag = "?"
                      else:
                          helpflag = ""
                      rightpart = "=" + child.name + helpflag
                      # Now make sure the information will fit in the line
                      fixedlen = 1+curses_style_menu.valwidth+1+len(rightpart)+(thumb!=None) + 1
                      leftpart = leftpart[:self.columns-fixedlen]
                      filler = " " * (self.columns - len(leftpart) - fixedlen)
                      line = leftpart + filler + rightpart
                      # Write it
                      self.window.move(i+1, 0)
                      self.window.addstr(lpointer)
                      if "edit" in repaint and child == self.menus.selected():
                          self.window.move(i+1, curses_style_menu.valwidth+2)
                          self.window.attron(highlight)
                      else:
                          self.window.attron(highlight)
                          valstring = screenvals[i][:curses_style_menu.valwidth]
                          self.window.addstr(valstring + (" " * (curses_style_menu.valwidth - len(valstring))) + " ")
                      self.window.addstr(line)
                      self.window.attroff(highlight)
  
                      # Ignore error from writing to last cell of
                      # last line; the old curses module in 1.5.2
                      # doesn't like this.  The try/catch around the
                      # thumb write does the same thing.
                      try:
                          self.window.addstr(rpointer)
                      except:
                          pass
              if thumb:
                  try:
                      self.window.addch(i+1, self.columns-1, thumb)
                  except:
                      pass
          if not configuration.expert_tie or not cml.evaluate(configuration.expert_tie):
              self.window.move(self.lines-1, 0)
              self.window.clrtoeol()
              helpbanner = lang["HELPBANNER"]
              title = " " * ((self.columns - len(helpbanner))/2) + helpbanner
              self.window.addstr(title, curses.A_BOLD)
  
          if type(self.menus.selected()) is not type(""):
              self.window.move(current_line + 1, 0)
          if "main" in repaint or "edithelp" in repaint:
              self.window.noutrefresh()
          if "edit" in repaint:
              self.textbox.win.touchwin()
              self.textbox.win.noutrefresh()
          curses.doupdate()
          return (current_line, current_prompt, sel_symbol)
function_tokens: def redisplay ( self , repaint ) : sel_symbol = current_line = None if self . banner and self . in_menu ( ) : title = self . msgbuf + ( " " * ( self . columns - len ( self . msgbuf ) - len ( self . banner ) - 1 ) ) + self . banner else : title = ( " " * ( ( self . columns - len ( self . msgbuf ) ) / 2 ) ) + self . msgbuf self . menus . viewport_height = self . lines - 2 + ( not configuration . expert_tie or cml . evaluate ( configuration . expert_tie ) != cml . n ) self . window . move ( 0 , 0 ) self . window . clrtoeol ( ) self . window . addstr ( title , curses . A_BOLD ) ( thumb_top , thumb_bottom ) = self . menus . thumb ( ) # Display the current band of entries  screenlines = self . menus . list ( ) if self . in_menu ( ) : screenvals = self . values [ self . menus . viewbase ( ) : self . menus . viewbase ( ) + self . menus . viewport_height ] configuration . debug_emit ( 1 , "screenvals: " + `screenvals` ) else : current_prompt = None # To change the number of lines on the screen that this paints, # change the initialization of the viewport_height member. for i in range ( self . menus . viewport_height ) : self . window . move ( i + 1 , 0 ) self . window . clrtoeol ( ) if len ( self . menus . top ( ) ) <= self . menus . viewport_height : thumb = None elif i <= thumb_bottom and i >= thumb_top : thumb = curses . ACS_CKBOARD else : thumb = curses . ACS_VLINE if i < len ( screenlines ) : child = screenlines [ i ] if type ( child ) is type ( "" ) : self . window . addstr ( i + 1 , 0 , child ) elif child . type == "message" : self . window . addstr ( i + 1 , 0 , child . prompt + " " ) self . window . hline ( i + 1 , len ( child . prompt ) + 2 , curses . ACS_HLINE , self . columns - len ( child . prompt ) - 3 ) else : if child == self . menus . selected ( ) : lpointer = ">" rpointer = "<" highlight = curses . A_REVERSE current_line = i current_prompt = screenvals [ i ] sel_symbol = child else : lpointer = rpointer = " " highlight = curses . A_NORMAL if curses . has_colors ( ) : if child . frozen ( ) : highlight = curses . color_pair ( curses . COLOR_CYAN ) #elif child.inspected: #    highlight=curses.color_pair(curses.COLOR_GREEN) elif child . setcount or child . included : highlight = curses . color_pair ( curses . COLOR_GREEN ) # OK, now assemble the rest of the line leftpart = ( "  " * child . depth ) + cgenprompt ( child , not configuration . expert_tie or not cml . evaluate ( configuration . expert_tie ) ) if configuration . is_new ( child ) : leftpart = leftpart + " " + lang [ "NEW" ] if child . frozen ( ) : leftpart = leftpart + " " + lang [ "FREEZELABEL" ] if child . help ( ) : helpflag = "?" else : helpflag = "" rightpart = "=" + child . name + helpflag # Now make sure the information will fit in the line fixedlen = 1 + curses_style_menu . valwidth + 1 + len ( rightpart ) + ( thumb != None ) + 1 leftpart = leftpart [ : self . columns - fixedlen ] filler = " " * ( self . columns - len ( leftpart ) - fixedlen ) line = leftpart + filler + rightpart # Write it self . window . move ( i + 1 , 0 ) self . window . addstr ( lpointer ) if "edit" in repaint and child == self . menus . selected ( ) : self . window . move ( i + 1 , curses_style_menu . valwidth + 2 ) self . window . attron ( highlight ) else : self . window . attron ( highlight ) valstring = screenvals [ i ] [ : curses_style_menu . valwidth ] self . window . addstr ( valstring + ( " " * ( curses_style_menu . valwidth - len ( valstring ) ) ) + " " ) self . window . addstr ( line ) self . window . attroff ( highlight ) # Ignore error from writing to last cell of # last line; the old curses module in 1.5.2 # doesn't like this.  The try/catch around the # thumb write does the same thing. try : self . window . addstr ( rpointer ) except : pass if thumb : try : self . window . addch ( i + 1 , self . columns - 1 , thumb ) except : pass if not configuration . expert_tie or not cml . evaluate ( configuration . expert_tie ) : self . window . move ( self . lines - 1 , 0 ) self . window . clrtoeol ( ) helpbanner = lang [ "HELPBANNER" ] title = " " * ( ( self . columns - len ( helpbanner ) ) / 2 ) + helpbanner self . window . addstr ( title , curses . A_BOLD ) if type ( self . menus . selected ( ) ) is not type ( "" ) : self . window . move ( current_line + 1 , 0 ) if "main" in repaint or "edithelp" in repaint : self . window . noutrefresh ( ) if "edit" in repaint : self . textbox . win . touchwin ( ) self . textbox . win . noutrefresh ( ) curses . doupdate ( ) return ( current_line , current_prompt , sel_symbol )