#NEWLINE# def __init__( self , **kwargs ) : #NEWLINE# #INDENT# if ( 'sorted_keys' in kwargs ) : #NEWLINE# #INDENT# if ( type ( msg [ 'sorted_keys' ] ) not in ( tuple , list ) ) : #NEWLINE# #INDENT# msg = 'DictAdapter: sorted_keys must be tuple or list' #NEWLINE# raise Exception ( msg ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . sorted_keys = sorted ( kwargs [ 'data' ] . keys ( ) ) #NEWLINE# #UNINDENT# super ( DictAdapter , self ) . __init__ ( ** kwargs ) #NEWLINE# self . fbind ( 'sorted_keys' , self . initialize_sorted_keys )