#NEWLINE# def validate_condition_x_amz_meta_qqfilename( self , condition ) : #NEWLINE# #INDENT# '\n        Require that x-amz-meta-qqfilename is a valid URL-encoded\n        string containing only URL characters.\n        ' #NEWLINE# import urllib #NEWLINE# from . util import string_is_valid_filename #NEWLINE# if ( not isinstance ( condition . value , basestring ) ) : #NEWLINE# #INDENT# raise ValidationError ( _ ( 'Filename should be a string' ) ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# decoded_filename = urllib . unquote_plus ( str ( condition . value ) ) . decode ( 'utf-8' ) #NEWLINE# #UNINDENT# except UnicodeEncodeError : #NEWLINE# #INDENT# raise ValidationError ( _ ( 'Filename should be a valid URL-encoded string' ) ) #NEWLINE# #UNINDENT# if ( not string_is_valid_filename ( self ) ) : #NEWLINE# #INDENT# raise ValidationError ( _ ( 'Filename should not include fancy characters' ) )