#NEWLINE# def print_time( now ) : #NEWLINE# #INDENT# 'main time function' #NEWLINE# twentyfourhours = twentyfourhourarg #NEWLINE# time_line = now . strftime ( ( '%H:%M:%S' if twentyfourhours else '%I:%M:%S' ) ) #NEWLINE# time_array = [ '' for i in range ( 0 , 7 ) ] #NEWLINE# for char in time_line : #NEWLINE# #INDENT# char_array = glyph [ char ] #NEWLINE# for row in range ( 0 , len ( char_array ) ) : #NEWLINE# #INDENT# time_array [ row ] += char_array [ row ] #NEWLINE# #UNINDENT# #UNINDENT# for y in range ( 0 , len ( time_array ) ) : #NEWLINE# #INDENT# for x in range ( 0 , len ( time_array [ y ] ) ) : #NEWLINE# #INDENT# char = time_array [ y ] [ x ] #NEWLINE# color = ( 1 if ( char == ' ' ) else 3 ) #NEWLINE# addstr ( y , ( x if ( not twentyfourhours ) else ( x + 2 ) ) , ' ' , curses . color_pair ( color ) ) #NEWLINE# #UNINDENT# #UNINDENT# if ( not twentyfourhours ) : #NEWLINE# #INDENT# addstr ( 6 , len ( time_array [ 0 ] ) , now . strftime ( '%p' ) , ( curses . color_pair ( 2 ) | curses . A_BOLD ) )