#NEWLINE# def align_text( text , left_margin = 17 , max_width = 160 ) : #NEWLINE# #INDENT# lines = [ ] #NEWLINE# for line in text . split ( '\n' ) : #NEWLINE# #INDENT# temp_lines = textwrap . wrap ( line , ( max_width - left_margin ) ) #NEWLINE# temp_lines = [ ( ( ' ' * left_margin ) + line ) for line in temp_lines ] #NEWLINE# lines . append ( '\n' . join ( temp_lines ) ) #NEWLINE# #UNINDENT# ret = '\n' . join ( lines ) #NEWLINE# return ret . lstrip ( )