#NEWLINE# def _make_boundary( text = None ) : #NEWLINE# #INDENT# token = random . randrange ( sys . maxint ) #NEWLINE# boundary = ( ( ( '=' * 15 ) + ( _fmt % token ) ) + '==' ) #NEWLINE# if ( text is None ) : #NEWLINE# #INDENT# return boundary #NEWLINE# #UNINDENT# b = boundary #NEWLINE# counter = 0 #NEWLINE# while True : #NEWLINE# #INDENT# cre = re . compile ( ( ( '^--' + re . escape ( b ) ) + '(--)?$' ) , re . MULTILINE ) #NEWLINE# if ( not cre . search ( text ) ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# b = ( ( boundary + '.' ) + str ( counter ) ) #NEWLINE# counter += 1 #NEWLINE# #UNINDENT# return b