#NEWLINE# def _unparse( self , directives ) : #NEWLINE# #INDENT# '\n        Create message string from directives.\n\n        @param directives: dictionary of directives (names to their values).\n                           For certain directives, extra quotes are added, as\n                           needed.\n        @type directives: L{dict} of L{str} to L{str}\n        @return: message string.\n        @rtype: L{str}.\n        ' #NEWLINE# directive_list = [ ] #NEWLINE# for ( name , value ) in directives . iteritems ( ) : #NEWLINE# #INDENT# if ( name in ( 'username' , 'realm' , 'cnonce' , 'nonce' , 'digest-uri' , 'authzid' , 'cipher' ) ) : #NEWLINE# #INDENT# directive = ( '%s="%s"' % ( name , value ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# directive = ( '%s=%s' % ( name , value ) ) #NEWLINE# #UNINDENT# directive_list . append ( directive ) #NEWLINE# #UNINDENT# return ',' . join ( directive_list )