#NEWLINE# def _change_colours( self , colour , attr , bg ) : #NEWLINE# #INDENT# '\n            Change current colour if required.\n\n            :param colour: New colour to use.\n            :param attr: New attributes to use.\n            :param bg: New background colour to use.\n            ' #NEWLINE# if ( attr != self . _attr ) : #NEWLINE# #INDENT# sys . stdout . write ( self . _a_normal ) #NEWLINE# if ( colour != 0 ) : #NEWLINE# #INDENT# sys . stdout . write ( self . _ATTRIBUTES [ attr ] ) #NEWLINE# #UNINDENT# self . _attr = attr #NEWLINE# self . _colour = None #NEWLINE# self . _bg = None #NEWLINE# #UNINDENT# if ( colour != self . _colour ) : #NEWLINE# #INDENT# sys . stdout . write ( curses . tparm ( self . _fg_color , colour ) . decode ( 'utf-8' ) ) #NEWLINE# self . _colour = colour #NEWLINE# #UNINDENT# if ( bg != self . _bg ) : #NEWLINE# #INDENT# sys . stdout . write ( curses . tparm ( self . _bg_color , bg ) . decode ( 'utf-8' ) ) #NEWLINE# self . _bg = bg