#NEWLINE# @ classmethod #NEWLINE# def load( cls , repository , key = None ) : #NEWLINE# #INDENT# from . key import key_factory #NEWLINE# cdata = repository . get ( cls . MANIFEST_ID ) #NEWLINE# if ( not key ) : #NEWLINE# #INDENT# key = key_factory ( repository , cdata ) #NEWLINE# #UNINDENT# manifest = cls ( key , repository ) #NEWLINE# data = key . decrypt ( None , cdata ) #NEWLINE# manifest . id = key . id_hash ( data ) #NEWLINE# m = msgpack . unpackb ( data ) #NEWLINE# if ( not ( m . get ( b'version' ) == 1 ) ) : #NEWLINE# #INDENT# raise ValueError ( 'Invalid manifest version' ) #NEWLINE# #UNINDENT# manifest . archives = dict ( ( ( k . decode ( 'utf-8' ) , v ) for ( k , v ) in m [ b'archives' ] . items ( ) ) ) #NEWLINE# manifest . timestamp = m . get ( b'timestamp' ) #NEWLINE# if manifest . timestamp : #NEWLINE# #INDENT# manifest . timestamp = manifest . timestamp . decode ( 'ascii' ) #NEWLINE# #UNINDENT# manifest . config = m [ b'config' ] #NEWLINE# return ( manifest , key )