<s> from biicode . common . output_stream import OutputStream , Color <EOL> class BiiOutputStream ( OutputStream ) : <EOL> '''<STR_LIT>''' <EOL> def success ( self , data ) : <EOL> self . writeln ( data , Color . GREEN ) <EOL> def input_text ( self , data ) : <EOL> self . write ( data , Color . GREEN ) <EOL> def header ( self , data ) : <EOL> self . writeln ( data , Color . CYAN ) <EOL> def listitem ( self , data , level = <NUM_LIT:0> ) : <EOL> if level == <NUM_LIT:0> : <EOL> color = Color . CYAN <EOL> elif level == <NUM_LIT:1> : <EOL> color = Color . BRIGHT_BLUE <EOL> else : <EOL> color = None <EOL> self . writeln ( '<STR_LIT:U+0020>' * level + str ( data ) , color ) <EOL> def diff ( self , data ) : <EOL> '''<STR_LIT>''' <EOL> lines = data . split ( "<STR_LIT:\n>" ) <EOL> for line in lines : <EOL> if line . startswith ( "<STR_LIT>" ) or line . startswith ( "<STR_LIT>" ) or not line : <EOL> continue <EOL> elif line . startswith ( "<STR_LIT>" ) and line . endswith ( "<STR_LIT>" ) : <EOL> color = Color . CYAN <EOL> elif line . startswith ( "<STR_LIT:->" ) : <EOL> color = Color . RED <EOL> elif line . startswith ( "<STR_LIT:+>" ) : <EOL> color = Color . GREEN <EOL> else : <EOL> color = None <EOL> self . writeln ( line , color ) </s>
