#NEWLINE# def options_dictionary_to_string( options_dictionary ) : #NEWLINE# #INDENT# 'Given a dictionary, returns a string in the form:\n\n    "\x00KEY1\x00VALUE1\x00KEY2\x00VALUE2\x00...\x00"\n\n    Sorted in order of key\n    ' #NEWLINE# ops = [ ] #NEWLINE# for ( key , value ) in sorted ( options_dictionary . iteritems ( ) ) : #NEWLINE# #INDENT# ops . append ( key ) #NEWLINE# ops . append ( value ) #NEWLINE# #UNINDENT# ops_string = '\x00' . join ( ops ) #NEWLINE# ops_string += ( '\x00' if ops else '' ) #NEWLINE# return options_dictionary