#NEWLINE# def validate_bug_tracker( input_url ) : #NEWLINE# #INDENT# 'Validate a bug tracker URL.\n\n    This checks that the given URL string contains one (and only one) `%s`\n    Python format specification type (no other types are supported).\n    ' #NEWLINE# try : #NEWLINE# #INDENT# test_url = input_url . replace ( '%%' , '' ) #NEWLINE# if ( test_url . find ( '%s' ) == ( - 1 ) ) : #NEWLINE# #INDENT# raise TypeError #NEWLINE# #UNINDENT# test_url = ( test_url % 1 ) #NEWLINE# #UNINDENT# except ( TypeError , ValueError ) : #NEWLINE# #INDENT# raise ValidationError ( [ ( _ ( "%s has invalid format specification type(s). Use only one '%%s' to mark the location of the bug id. If the URL contains encoded values (e.g. '%%20'), prepend the encoded values with an additional '%%'." ) % input_url ) ] )