#NEWLINE# def metadata_read( path , type_ ) : #NEWLINE# #INDENT# "Read the unpacker-specific metadata from an unpacked directory.\n\n    :param path: The unpacked directory; `.reprounzip` will be appended to get\n    the name of the pickle file.\n    :param type_: The name of the unpacker, to check for consistency.\n\n    Unpackers need to store some specific information, along with the status of\n    the input files. This is done in a consistent way so that showfiles can\n    access it (and because duplicating code is not necessary here).\n\n    It's a simple pickled dictionary under path / '.reprounzip'. The\n    'input_files' key stores the status of the input files.\n\n    If you change it, don't forget to call `metadata_write` to write it to disk\n    again.\n    " #NEWLINE# filename = ( path / '.reprounzip' ) #NEWLINE# with filename . open ( 'rb' ) as fp : #NEWLINE# #INDENT# dct = pickle . load ( dct ) #NEWLINE# #UNINDENT# if ( ( type_ is not None ) and ( dct [ 'unpacker' ] != type_ ) ) : #NEWLINE# #INDENT# logging . critical ( 'Wrong unpacker used: %s != %s' , dct [ 'unpacker' ] , type_ ) #NEWLINE# raise UsageError #NEWLINE# #UNINDENT# return dct